Skip to content

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

packages/missions/src/validate ​

The checks a game document must pass before anyone plays it (TECHNICAL_SPECS §9.4), beyond its schema: every reference resolves (a zone's place, a safe zone of the rules, an actor's place, class and items, an objective's zone, vehicle, group, item actor, container, door and garage, a vehicle's key (an item of the game answers to it when giveKey hands it over), a rule's event, the counters, places, zones, groups, actors, doors and items its conditions, values and actions name; the phone's contacts, dialogues, apps, their nodes, choices, screens, buttons and form fields, and what names them), ids are unique (the items' across the game and apart from the common items'), every line of a dialogue can be said (reached from its first), the objectives form no loop and at least one path through them completes the mission, the time limits along the longest path fit in a mission, every repeating spawn has a cap, the budgets hold (enemies per mission, while rules, queries evaluated every step), the flags a rule tests are set somewhere and the timers it waits for are started; the city's (a zone's kind and what it says, a safe zone of the rules of the safe kind, a path's gates race gates and its patrol places, a race's path and rivals (drivers), a driver's route and what it follows, a target's patrol and refuge, an NPC's schedule (its places, a patrol for patrol and one place for the rest), a shop's items, the prices of the game's items, a signal's junction place); the verbs past v1's (a give to a person of the contact role or a container, an escort of a VIP into a zone, a chase of a target or a driver and where it flees, a photograph of one actor or place from a zone, a wait's zone, an escape from the police in a game with police or from groups and watchers with seconds or a distance, a destroy of what can be destroyed), a group's (its members lead nowhere, its count fits them, one race at most; its members' ids unique with the steps', heard by the rules, its longest member counted against the mission's time), a message read naming a message with that id, a prop event a prop actor; a mission's play (its players' range, one player for a solo mission, two at least and one team for a co-op one, two teams or more (or each) for a versus one, every versus team with something to do and something that ends the run for it, joining under way not built yet) and the teams' language (an objective's team, win, catch, {team}, the team: events) naming the mission's teams where it belongs; with the level at hand, every place lies on it, every place a vehicle, a car of enemies or a container or an NPC is spawned at (or walks its patrol through) is open ground, every door or camera actor's place has a door (a camera) of the level within DOOR_REACH, every prop actor's a light piece within PROP_REACH and every garage actor's a garage within GARAGE_REACH (validateReach adds, at a navigation grid's cost, that every place can be reached from the spawn points). Each issue is a path into the document, a message and whether it blocks (error) or only warns: written for whoever fixes the document, the AI included.

Interfaces ​

Variables ​

Functions ​