five-on-it / packages/protocol/src/messages / parseDebugCommand
Function: parseDebugCommand()
parseDebugCommand(
text): {ahead?:number;carClass?:number;climate?:"none"|"temperate"|"meadow"|"forest"|"alpine"|"farmland"|"steppe"|"desert"|"autumn"|"coast";cmd:"police"|"clock"|"give"|"invincible"|"maxHealth"|"chaos"|"weather"|"budget"|"tech"|"spawnChaser"|"clearChasers"|"teleport"|"wanted"|"pedestrian"|"carHealth"|"rtcDrop"|"fit"|"ignite";crew?:number;event?:"riot"|"bridge"|"blackout"|"petrol";health?:number;heat?:number;hours?:number;intensity?:number;items?:object[];kind?:"clear"|"overcast"|"rain"|"storm"|"fog"|"snow";minutes?:number;mode?:"foot"|"car";mods?: ("smoke"|"runFlats"|"caltrops"|"oil"|"bullBar"|"plating"|"hardened"|"nitro")[];night?:boolean;on?:boolean;pace?:number;points?:number;profile?:string;road?:string;stars?:number;tune?:Record<string,number|boolean>;type:"debug";unit?:"boat"|"apc"|"dart"|"grappler"|"helicopter"|"sniper"|"cannon"|"bike"; } |undefined
Defined in: packages/protocol/src/messages.ts:563
Parses a text frame as a debug command; undefined when it is not one.
Parameters
text
string
Returns
Type Literal
{ ahead?: number; carClass?: number; climate?: "none" | "temperate" | "meadow" | "forest" | "alpine" | "farmland" | "steppe" | "desert" | "autumn" | "coast"; cmd: "police" | "clock" | "give" | "invincible" | "maxHealth" | "chaos" | "weather" | "budget" | "tech" | "spawnChaser" | "clearChasers" | "teleport" | "wanted" | "pedestrian" | "carHealth" | "rtcDrop" | "fit" | "ignite"; crew?: number; event?: "riot" | "bridge" | "blackout" | "petrol"; health?: number; heat?: number; hours?: number; intensity?: number; items?: object[]; kind?: "clear" | "overcast" | "rain" | "storm" | "fog" | "snow"; minutes?: number; mode?: "foot" | "car"; mods?: ("smoke" | "runFlats" | "caltrops" | "oil" | "bullBar" | "plating" | "hardened" | "nitro")[]; night?: boolean; on?: boolean; pace?: number; points?: number; profile?: string; road?: string; stars?: number; tune?: Record<string, number | boolean>; type: "debug"; unit?: "boat" | "apc" | "dart" | "grappler" | "helicopter" | "sniper" | "cannon" | "bike"; }
ahead?
optionalahead?:number
carClass?
optionalcarClass?:number
climate?
optionalclimate?:"none"|"temperate"|"meadow"|"forest"|"alpine"|"farmland"|"steppe"|"desert"|"autumn"|"coast"
cmd
cmd:
"police"|"clock"|"give"|"invincible"|"maxHealth"|"chaos"|"weather"|"budget"|"tech"|"spawnChaser"|"clearChasers"|"teleport"|"wanted"|"pedestrian"|"carHealth"|"rtcDrop"|"fit"|"ignite"
crew?
optionalcrew?:number
event?
optionalevent?:"riot"|"bridge"|"blackout"|"petrol"
chaos: a chaos event set off now where the player stands (@foi/ai's chaos.ts, the simulation's bascules, substations and pumps): a riot round them, the nearest bridge raised, the nearest district blacked out, the nearest pumps lit.
health?
optionalhealth?:number
heat?
optionalheat?:number
hours?
optionalhours?:number
intensity?
optionalintensity?:number
items?
optionalitems?:object[]
give: items put in the player's inventory (the room's item ids, how many of each).
kind?
optionalkind?:"clear"|"overcast"|"rain"|"storm"|"fog"|"snow"
minutes?
optionalminutes?:number
mode?
optionalmode?:"foot"|"car"
mods?
optionalmods?: ("smoke"|"runFlats"|"caltrops"|"oil"|"bullBar"|"plating"|"hardened"|"nitro")[]
fit: the upgrades fitted to the player's car (the simulation's MOD_SHOP ids).
night?
optionalnight?:boolean
on?
optionalon?:boolean
pace?
optionalpace?:number
points?
optionalpoints?:number
budget: the room's public safety budget set outright (@foi/ai's BUDGET, points; none runs it dry).
profile?
optionalprofile?:string
road?
optionalroad?:string
stars?
optionalstars?:number
tune?
optionaltune?:Record<string,number|boolean>
type
type:
"debug"
unit?
optionalunit?:"boat"|"apc"|"dart"|"grappler"|"helicopter"|"sniper"|"cannon"|"bike"
police: a unit of the heavy response sent after the player now (@foi/ai's HEAVY_UNITS), at stars first when given; on, alone (the police send them nothing else).
undefined