Skip to content

five-on-it / apps/api/src/store / Draft

Interface: Draft ​

Defined in: apps/api/src/store.ts:48

A game being made.

Properties ​

byModel? ​

optional byModel?: boolean

Defined in: apps/api/src/store.ts:68

Whether the platform's model wrote it, once or more: its texts are checked when it is published, by link too.


createdAt ​

createdAt: string

Defined in: apps/api/src/store.ts:70

ISO times.


creation? ​

optional creation?: DraftCreation

Defined in: apps/api/src/store.ts:66

The creation whose model last wrote it (creations.ts), until its texts were checked.


game ​

game: object

Defined in: apps/api/src/store.ts:56

The game document as it stands (its id is the draft's game id, its level the draft's).

blurb? ​

optional blurb?: string

id ​

id: string

level ​

level: string

missions ​

missions: object[]

paths ​

paths: Record<string, { gates: string[]; laps: number; } | { loop: boolean; patrol: string[]; }>

places ​

places: Record<string, { kind?: "extraction" | "safehouse" | "sniperRoof" | "roadblockSpot" | "swatStaging"; name?: string; role?: "players" | "police" | "traffic" | "guards" | "hospital"; tags?: string[]; x: number; y?: number; yaw?: number; z: number; }>

rules ​

rules: object

rules.chaos ​

chaos: object

The city's big events the game lets loose by itself (GAME_DESIGN §12, chaos): whether a wanted driver's approach raises the bascule bridges, whether the billboards show a wanted player's face (from six stars), and a place where a riot runs from the start. A mission's chaos sets one off where it says.

rules.chaos.billboards ​

billboards: boolean

rules.chaos.bridges ​

bridges: boolean

rules.chaos.riot? ​

optional riot?: string

rules.clock? ​

optional clock?: object

The room clock (GAME_DESIGN §5.7): the time the room starts at and its pace, game minutes per real second (1 is an hour a minute, a day in 24 minutes; 0 stops it; up to 60 for a day in 24 seconds).

rules.clock.pace ​

pace: number

rules.clock.start ​

start: string

rules.dropMissionItems ​

dropMissionItems: boolean

Whether a character that dies drops the items a mission defined that it carried, where it fell (GAME_DESIGN §7.4).

rules.extractions? ​

optional extractions?: string[]

Places that are extraction points (GAME_DESIGN §12), besides the places of the kind extraction: held 30 s at 9 stars or more, they lose the police.

rules.fallDamage ​

fallDamage: boolean

Whether a long fall hurts (from about 4 m) and a very long one kills (from about 12 m).

rules.garages? ​

optional garages?: object

What every garage of the level charges ($), over the level's own prices (GAME_DESIGN §5.5).

rules.garages.respray? ​

optional respray?: number

rules.garages.store? ​

optional store?: number

rules.ghostSeconds ​

ghostSeconds: number

Seconds a player is a ghost after coming back (passing through cars and people, taking no harm).

rules.loadout? ​

optional loadout?: object[]

What every player starts with (GAME_DESIGN §7.4): stacks of items by id (weapons and their ammunition are items), each in the slot of the strip it names (1 to 16; the number keys select the first nine, and the slot a key selects is the weapon held) or the first free one. Absent: free roam's arsenal, the fists' slot 1 left empty, the pistol, shotgun, rifle, rocket launcher, grenades and tranquilizer on 2 to 7 and the guns' ammunition from 9 on; an empty list: nothing but the phone.

rules.maxPlayers ​

maxPlayers: number

How many players a room of this game takes.

rules.maxStars ​

maxStars: number

The most stars a player may have (GAME_DESIGN §12, 0 to 10): five come from the Heat, six to ten from escalations; a lower cap holds the police's response there (4: no drone).

rules.mode? ​

optional mode?: "solo" | "coop" | "versus"

How the game is played, one mode for all its missions (its creator's pick): single player (solo: no mission has a play, and every room of it is its opener's alone), co-op (coop: every mission is co-op, played by a crew in a run's room from a lobby) or versus (versus: every mission pits two teams or more against each other). Absent: the missions say, each its own (a curated game's mix).

rules.partyRewards ​

partyRewards: "split" | "shared"

How a party's mission reward is paid: each member the whole of it (shared), or the reward divided among them (split).

rules.phone ​

phone: boolean

Whether every character starts with a phone (GAME_DESIGN §7.5); a mission may give one.

rules.playerDamage ​

playerDamage: "on" | "off" | "rivals"

Whether players hurt each other: never, only rivals (players outside one's party), or always.

rules.police ​

police: boolean

Whether the room has police: crimes raise a Wanted level and police cars come (GAME_DESIGN §12).

rules.prices? ​

optional prices?: Record<string, number>

What the shops charge ($), by item id, over the items' own prices (GAME_DESIGN §14).

rules.respawn ​

respawn: "hospital" | "mission"

Where a player who went down comes back: the nearest spawn point (hospital), or where their mission started (mission).

rules.safehouses? ​

optional safehouses?: string[]

Places that are safe houses' doors, besides the places of the kind safehouse: rented for cash, the Heat cools three times as fast inside.

rules.safeZones ​

safeZones: string[]

The game's zones where players cannot hurt each other and no car is carjacked.

rules.traffic ​

traffic: number

Ambient cars driving the level's roads around the players: none unless the game asks (at most 64).

rules.vehicleFire ​

vehicleFire: boolean

Whether a car brought low catches fire, burns and blows up, its blast lighting the cars beside it.

rules.weather? ​

optional weather?: object

The room's weather (GAME_DESIGN §5.7): its climate (the level's by default: a region's biome, temperate for a town; none is always clear), the weather it opens with (start, at an intensity), and whether it changes on its own from there (a front every half an hour, by the climate's odds) or holds. Missions change it (setWeather).

rules.weather.changes ​

changes: boolean

rules.weather.climate? ​

optional climate?: "none" | "temperate" | "meadow" | "forest" | "alpine" | "farmland" | "steppe" | "desert" | "autumn" | "coast"

rules.weather.intensity ​

intensity: number

rules.weather.start? ​

optional start?: "clear" | "overcast" | "rain" | "storm" | "fog" | "snow"

schemaVersion? ​

optional schemaVersion?: number

The document's format (migrate.ts): 1 when absent; a newer one is migrated away before this reads it.

state? ​

optional state?: object

state.counters ​

counters: Record<string, number>

state.flags ​

flags: string[]

title ​

title: string

zones ​

zones: Record<string, { kind?: "pickup" | "spawn" | "safe" | "restricted" | "race_gate" | "checkpoint" | "dropoff"; place: string; radius: number; raises?: "alert" | "heat"; role?: "players" | "police" | "traffic" | "guards" | "hospital"; } | { kind?: "pickup" | "spawn" | "safe" | "restricted" | "race_gate" | "checkpoint" | "dropoff"; polygon: object[]; raises?: "alert" | "heat"; role?: "players" | "police" | "traffic" | "guards" | "hospital"; y?: number; }>


gameId ​

gameId: string

Defined in: apps/api/src/store.ts:64

The game id its versions are published under (g-…).


id ​

id: string

Defined in: apps/api/src/store.ts:50

draft-….


owner ​

owner: string

Defined in: apps/api/src/store.ts:52

The owner's account id.


ownerName ​

ownerName: string

Defined in: apps/api/src/store.ts:54

The owner's name, as the game will credit them.


remixOf? ​

optional remixOf?: RemixCredit

Defined in: apps/api/src/store.ts:60

The game it is a remix of, credited on every version it publishes.


revision ​

revision: number

Defined in: apps/api/src/store.ts:62

Bumped on every change; a build is of one revision.


spec? ​

optional spec?: { climate?: "none" | "temperate" | "meadow" | "forest" | "alpine" | "farmland" | "steppe" | "desert" | "autumn" | "coast"; clock?: { pace: number; start: string; }; districts: object[]; grids: object[]; hills: object[]; lakes: object[]; name: string; parks: object[]; places: object[]; relief: ({ at: [number, number] | { at: [number, number]; grid: string; } | { arm: number; roundabout: string; } | { at: number | "start" | "end"; road: string; } | { hill: string; }; height: number; kind: "rise"; reach: number; } | { from: [number, number] | { at: [number, number]; grid: string; } | { arm: number; roundabout: string; } | { at: number | "start" | "end"; road: string; } | { hill: string; }; height: number; kind: "slope"; to: [number, number] | { at: [number, number]; grid: string; } | { arm: number; roundabout: string; } | { at: number | "start" | "end"; road: string; } | { hill: string; }; })[]; roads: object[]; roundabouts: object[]; seed: number; size: number; spawn?: { near?: [number, number] | { at: [number, number]; grid: string; } | { arm: number; roundabout: string; } | { at: number | "start" | "end"; road: string; } | { hill: string; }; road: string; }; template: "city"; water: object[]; } | { base: number; biome: "meadow" | "forest" | "alpine" | "farmland" | "steppe" | "desert" | "autumn" | "coast"; climate?: "none" | "temperate" | "meadow" | "forest" | "alpine" | "farmland" | "steppe" | "desert" | "autumn" | "coast"; clock?: { pace: number; start: string; }; details: "plain" | "rich"; features: ({ at: [number, number]; kind: "hill"; level: number; lighthouse?: boolean; name?: string; radius?: number; steep?: boolean; } | { at: [number, number]; kind: "mountain"; level: number; name?: string; radius?: number; } | { at: [number, number]; kind: "plateau"; level: number; name?: string; size: [number, number]; } | { at: [number, number]; kind: "valley"; level: number; name?: string; radius: number; steep?: boolean; } | { at: [number, number]; kind: "lake"; level: number; name?: string; size: [number, number]; } | { at: [number, number]; flow?: "north" | "east" | "south" | "west"; kind: "volcano"; level: number; name?: string; radius?: number; } | { at: [number, number]; kind: "ski"; name?: string; to: [number, number]; })[]; landuse: object[]; name: string; props: { rocks: boolean; trees: boolean; }; roads: object[]; seed: number; size: [number, number]; start?: string; template: "region"; towns: object[]; } | { avenues: { x: number[]; z: number[]; }; blocks: [number, number]; blockSize: number; climate?: "none" | "temperate" | "meadow" | "forest" | "alpine" | "farmland" | "steppe" | "desert" | "autumn" | "coast"; clock?: { pace: number; start: string; }; compounds: object[]; districts: object & object[]; dressing: "none" | "lived-in"; name: string; parks: [number, number][]; props: { hydrants: boolean; lamps: boolean; trafficLights: boolean; trees: boolean; }; seed: number; streetWidth: number; template: "grid-town"; }

Defined in: apps/api/src/store.ts:58

The level spec, for a draft whose level is generated: its name, and the game's level, is the draft's id.


updatedAt ​

updatedAt: string

Defined in: apps/api/src/store.ts:71