Skip to content

five-on-it / packages/ai/src/police-cops

packages/ai/src/police-cops ​

Players as the police (the ten-star build's F phase, GAME_DESIGN §12, §13):

  • Cop players (P1): a game's team with police powers (@foi/missions' Team.police) makes its players cops (setCop). A cop on foot who holds the interaction key at a robber lying down, stunned or standing still within COPS.cuffRange (a robber in a car at a standstill within .cuffCarRange) for .cuffTicks cuffs them: the police's arrest (police.ts: the fine, the stars cleared), an outcome the server turns into the game's catch. A cop never gets Wanted.
  • Backup (P1, P2): a cop calls a cruiser, a roadblock, a drone or a SWAT team after a robber (placeCopOrder), paid from their team's dispatch budget (points that come back one every COPS.refillTicks), each kind once per cooldown, one order of theirs every .orderGapTicks at most. The units come out of the director's own senders and under the room's cap on police actors, and they stay their time (COPS.keepTicks) whatever the robber's stars ask for. The Dispatcher (P2) places them on the map instead: a roadblock on the road nearest the point, a drone that hovers over it, a cruiser that comes out on the road there, SWAT to the building there; each after the robber the police last placed nearest the point.
  • Pinned stars (P4): a player whose stars a game pins (pinStars: Most Wanted's ten) never cools below them.
  • The prison transport (M8, P5): a player busted at TRANSPORT.minStars or more who has a crew (the server's CopBook.crewOf: a run's teammates, a party in the room) is not arrested at once (startTransport): they ride in the back of a police van (the SWAT van's class, its light bar on), an NPC officer at the wheel and a cruiser behind, to the nearest police station (the server's setPoliceStations) or TRANSPORT.fallback metres down the road. Its tell is the van itself, marked on the crew's maps, and its siren. A crew member on foot who holds the interaction key at its rear doors while it stands still (stopped, or wrecked) for .rescueTicks frees the captive, wanted again at .freedStars with the escort after them (the van is locked: nobody climbs in beside the captive); a van that arrives completes the arrest. A mission's person rides the same way (P5's contact).

Deterministic: the cops by client id, the requests and the transports in the order they were made; the book is hashed (police-cops-state.ts).

Interfaces ​

Type Aliases ​

Variables ​

Functions ​