Skip to content

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

packages/ai/src/police-snipers ​

The rooftop snipers (C23, GAME_DESIGN §12 at seven stars) and the marksmen's laser rule they share with the helicopter's door gunner (police-helicopter.ts).

  • The laser (laserStep): a marksman paints its target with a laser for LASER.holdTicks (a second and a half) before every round, one round every LASER.everyTicks (six seconds) at most; the round goes only when the line held on the target the whole time (nothing of the scenery and no smoke between them, the target in reach): a line broken starts the laser over. The laser is the tell (M4): the client draws it from the marksman to the player (police-tells.ts).
  • The snipers: one to two per player at seven stars, on the tallest roofs within SNIPERS.reach of them, a roof the level's ladders or lifts reach first (where the player can climb up and take them out), any flat roof of a building else (roofSpots), at the roof's edge nearest the player. A sniper is a police officer that is no NPC: it stands where it was put and fires its rifle through its input as a marksman (@foi/sim's marksman.ts: a round reaching 170 m that hurts a person, or pops a car's tyre and hurts its engine). Its counters: cover from above (any roof, deck or arcade between it and the player), smoke, or going up and taking it out; one shot down is replaced after a while, its body taken away. They go when the stars drop below seven.

Deterministic: snipers in the order they were sent, roofs in the level's order.

Interfaces ​

Variables ​

Functions ​