five-on-it / packages/ai/src/police-roadblocks
packages/ai/src/police-roadblocks
The police's roadblocks (GAME_DESIGN §12, four stars and up), two kinds:
- A fixed barricade at a chokepoint of the road a driving player is predicted to take (
police-precrime.ts: a bridge or a tunnel first, then a long stretch without a junction, then any road), ROADBLOCKS.aheadMinto.aheadMaxalong it: two police cars parked angled across the road, noses in, a nail strip (@foi/sim'snails.ts) across the gap between them, and two armed officers behind them holding their posts (profiles.ts'POLICE_POST). The cars are ordinary parked cars: a heavy vehicle shoves them aside, and a narrow car threads the gap at the price of its tyres; the way round is another road, or the river. It stands while its player comes, and is cleared once they have passed it, are far from it, the time is up or the stars drop below what sets them; its officers and cars go once no player is near. At most the stars' count of them a player (police-ladder.ts), one every ROADBLOCKS.everyTicks. - A rolling block: a pack of two or three cruisers sent from ahead on the predicted route (a way the dispatch sends cars,
police.ts), driving toward the player and stopping side by side across the lanes before them, braking together (chaser.ts' block goal); once the player is past the line, has stopped short of it, or the time is up, they are ordinary cruisers again.
Every roadblock is said on the radio (police-radio.ts) with the place it is at, and marked on the minimap (police-tells.ts). Deterministic: players by stars then client id, the book's lists in the order they were made.