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, devices: a bomb, a laptop, a fuse box, a safe, a generator, a workbench, a car jack) 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, hack, plant, defuse, repair), 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 mission's start (on joining, in a zone, a contact's message read or call answered) and the missions it comes after make a campaign, and a game's own state (flags and counters) outlives its missions. A game's zones (circles round a place, or polygons) 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 ​