Skip to content

five-on-it / packages/missions/src/schema

packages/missions/src/schema ​

The game document and the mission language, as zod schemas exported twice under one name (the runtime validator and the inferred type). A game is a level by name, the named places and zones of that level its missions refer to, the game's rules and its missions. A mission defines its own items, spawns its actors at places (vehicles, locked or not and whose, groups of enemies, items on the ground, containers, people, guards and civilians, terminals) or binds them (the level's doors, cameras, garages and light pieces; drivers, targets and VIPs; shops), keeps its counters, runs its objectives in order or along their branches, several at once in a parallel group (goto, steal_vehicle, deliver, pickup, collect, use, give, survive, defend, lose, eliminate, talk, unlock, incapacitate, sneak, race, escort, chase, photograph, wait, escape, destroy), keeps its hooks of stealth (without kills, alerts, being seen) and its rules: when an event happens, if a condition holds, do the actions; or while a condition holds, actions on entering it, every few seconds and on leaving it. Conditions compare values: numbers, counters, clocks and queries over the world. A mission's phone side is data too: its contacts, its dialogues (calls and face-to-face conversations) and its apps (screens of text with buttons and short forms). A game's zones have kinds (a pickup, a drop-off, a checkpoint, a race gate, a restricted zone, a safe zone, a spawn area), its paths are races (gates and laps) and patrols, its places may mark spawn points with a role, and its rules set the room clock and the shops' prices. Everything is data: the developer and the AI write the same documents (GAME_DESIGN §9, TECHNICAL_SPECS §9.5).

The schemas are strict: an unknown key is an error, so a typo never passes for a default. Ids are lower-case words of letters, digits and underscores, joined by dots (docks.warehouse_7).

Interfaces ​

Type Aliases ​

Variables ​