Skip to content

five-on-it / packages/sim/src/devices

packages/sim/src/devices ​

Devices (GAME_DESIGN §5.5, §9): the things a mission puts down for its player to work by holding the interaction key (hold-kinds.ts, holds.ts), each a prop of models/props.glb (assets/blender/models/props.py) standing on a fixed body of its model's hull (prop-hulls.json, which npm run models:check holds to the model; a small one, a bomb or a car jack, has none):

  • a bomb: a site first (nothing there yet, no body: where a mission's bomb goes), planted there by holding the key (with the item its lock asks for, used up), then armed: its fuse runs down, a tick at a time, and at zero it goes off (a blast as big as its size, the cars in reach set alight: fire.ts' blastAt); held at again, it is defused;
  • a laptop on its folding table: hacked;
  • a fuse box: its power cut, which switches off every security camera within its reach (the client darkens the street lamps there too), or put back on;
  • a safe: a container (items.ts' safe) shut until it is cracked, then open;
  • a generator: broken until it is repaired;
  • a workbench and a car jack: worked, as often as wanted;
  • a dumpster: a body dragged to it is hidden inside (drag.ts), the key held at it.

A car is repaired the same way (the key held at its front, with a toolbox: carRepairGap), as good as new. What each is worked into raises a device event (its outcome, DEVICE_OUTCOMES), which the server's missions read; the snapshots carry each device's kind and state. A device's lock (SimWorld.locks) is the item working it asks for. The state, the fuse and the rest are components, hashed with the rest.

Interfaces ​

Type Aliases ​

Variables ​

Functions ​