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
- Action
- Actor
- App
- AppButton
- AppScreen
- CameraActor
- CatchObjective
- ChaseObjective
- ChasersActor
- CircleZone
- CollectObjective
- ComparisonOp
- Condition
- Contact
- ContainerActor
- DefendObjective
- DefuseObjective
- DeliverObjective
- DestroyObjective
- Dialogue
- DialogueChoice
- DialogueNode
- DoorActor
- EliminateObjective
- EscapeObjective
- EscortObjective
- FormField
- GameDoc
- GameDocInput
- GameRules
- GameState
- GarageActor
- GiveObjective
- GotoObjective
- GroupObjective
- HackObjective
- HideObjective
- HoldupObjective
- IncapacitateObjective
- Item
- ItemActor
- LeafObjective
- LoseObjective
- Mission
- MissionStart
- NpcActor
- ObjectActor
- Objective
- Path
- PhotographObjective
- PickupObjective
- Place
- PlantObjective
- Play
- PlayerRange
- PolygonZone
- PropActor
- Query
- QueryFilter
- RaceObjective
- Ref
- RepairObjective
- RestrainObjective
- Reward
- Rule
- ScheduleHour
- SearchAreaObjective
- ShopActor
- SneakObjective
- StealObjective
- StealthHooks
- SurviveObjective
- TalkObjective
- Team
- TerminalActor
- UnlockObjective
- UseObjective
- Value
- VehicleActor
- WaitObjective
- WhenRule
- WhileRule
- Zone
- ZonePoint
Variables
- Action
- Actor
- ALERT_PHASES
- App
- AppButton
- AppScreen
- BLAST_SIZES
- CameraActor
- CatchObjective
- ChaseObjective
- ChasersActor
- CircleZone
- CollectObjective
- COMPARISONS
- Condition
- Contact
- ContainerActor
- DefendObjective
- DefuseObjective
- DeliverObjective
- DestroyObjective
- Dialogue
- DialogueChoice
- DialogueNode
- DoorActor
- EliminateObjective
- ENEMY_PROFILES
- EscapeObjective
- EscortObjective
- EVENT_PATTERN
- EventName
- FormField
- GAME_ID_PATTERN
- GameDoc
- GameRules
- GameState
- GarageActor
- GiveObjective
- GotoObjective
- GROUP_EVENT_PATTERN
- GroupObjective
- HackObjective
- HideObjective
- HoldupObjective
- Id
- ID_PATTERN
- IncapacitateObjective
- Item
- ItemActor
- ItemCount
- ItemId
- LeafObjective
- LoseObjective
- MAX_ZONE_POINTS
- Mission
- MissionStart
- NPC_DOINGS
- NPC_WEAPONS
- NpcActor
- OBJECT_KINDS
- ObjectActor
- Objective
- OBJECTIVE_VERBS
- ObjectiveNext
- Path
- PhotographObjective
- PickupObjective
- Place
- PlantObjective
- Play
- PLAY_MODES
- PlayerRange
- PolygonZone
- PropActor
- Query
- QueryFilter
- RaceObjective
- Ref
- RepairObjective
- Reply
- RestrainObjective
- Reward
- Rule
- RuleEvent
- Schedule
- ScheduleHour
- SearchAreaObjective
- SHOP_KINDS
- ShopActor
- SneakObjective
- StealObjective
- STEALTH_EVENT_PATTERN
- StealthHooks
- SurviveObjective
- Tag
- TalkObjective
- Team
- TEAM_EVENT_PATTERN
- TERMINAL_KINDS
- TerminalActor
- Time
- UnlockObjective
- UseObjective
- Value
- VEHICLE_OWNERS
- VehicleActor
- WaitObjective
- WhenRule
- WhileRule
- WIN_PATTERN
- Zone
- ZONE_KINDS
- ZonePoint