Skip to content

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

packages/ai/src/police-negotiator ​

The negotiator (GAME_DESIGN §12, six stars; C29): a wanted player at six stars or more who holds a captive (@foi/sim's captives.ts: held up, kneeling or restrained by them) inside a building or in cover, once a SWAT team is out after them (police-swat.ts), gets a call. A negotiator stands off by the van, and the team holds where it stands for as long as the talk lasts: it neither breaches nor shoots. One talk each time the player is wanted.

  • The call rings for NEGOTIATOR.ringTicks (the police tells carry it to the player's phone, police-tells.ts); answered, the talk holds the team for NEGOTIATOR.holdTicks; hung up on or let ring out, it is over.
  • The choices, each once: "Time", NEGOTIATOR.timeTicks more of holding; "A car", a car delivered to the kerb about NEGOTIATOR.carDistance from the player, a GPS tag on it (@foi/sim's tracking.ts: the police know where it is, a sighting every two seconds, police-fittings.ts), the team holding a while longer.
  • Releasing the captive (letting them go free, alive) drops a star and ends the talk; hurting them is a crime of its own, an escalation (wanted.ts' captiveHurt), and ends it with the team going in at once. Driving off ends it too, and so does the time running out: the team breaches.

Deterministic: talks in the order they began, captives in id order; the book is hashed.

Interfaces ​

Type Aliases ​

Variables ​

Functions ​