Skip to content

five-on-it / apps/server/src/cops-host

apps/server/src/cops-host ​

A room's players as the police, its prison transports and its bounty board (the ten-star build's F phase, GAME_DESIGN §12, §13): the server's side of @foi/ai's police-cops.ts.

  • Cops (P1, P2): every tick the players of a run's police team (@foi/missions' Team.police) are the AI's cops, the one who took the Dispatcher's role its dispatcher (held where they stand, out of the world: they drive nothing, they place backup on the map), and the players of a team that is wanted have their stars pinned (P4's ten). A client's cop frame is an order the AI checks (a cop's, the dispatcher's for a point, the budget, the cool-down, the rate, a robber the police know of), never trusted beyond that. A cuff is the run's catch, by the cop who made it.
  • Roles (P2, P3): a client's role frame takes a role in their team while the run gathers or counts down (run-host.ts). Once it is live: the gunner gets a rifle and its rounds, the medic first-aid kits (each heals 50: nobody lies downed in this game, so a kit is the medic's), the driver's car gets its nitro back by itself (a charge every PERKS.nitroTicks, three at most), and the hacker's hacks (the phone's traffic hack, camera loop and cruiser hack) cool down in half the time.
  • The prison transport (M8, P5): a player riding one is held in its back seat; their crew (crewOf: a co-op run's teammates, a versus run's when no team plays the police, else a party in the room) sees the van; a mission's person freed or arrived is told to its mission.
  • The bounty board (M9, bounties.ts): a client's bounties frame switches theirs; a hit that downs a carrier or a cop's cuff claims their bounty.

Each player gets a cops frame when what they see of it changes (their dispatch, the transports they ride or could stop, the board), at most COPS_EVERY ticks apart.

Classes ​

Interfaces ​