Skip to content

five-on-it / packages/sim/src/jets

packages/sim/src/jets ​

Water jets (C11, C9): the water cannon's turret and the police boat's bow nozzle, a class's jet (vehicle-classes.ts' JetDef). Non-lethal: water hurts nobody.

Who works it. The person in the jet's seat (the water cannon's operator beside its driver, the police boat's beside its helm), or the driver while that seat is empty: the trigger fires the jet, never a weapon (operatesJet: weapons.ts' heldWeapon hands them the fists, which fire nothing from a seat). It points where they aim, as far round as its arc lets it (a roof turret all round, a bow nozzle the front third of a circle).

What it does while the trigger is held and its tank has water (jetSystem, every tick before the physics step): its stream runs from the nozzle along its heading as far as its range, or the first wall in the way (a ray a metre over the street that cars and people do not stop: the water arcs over them onto what is behind). A person on foot in the stream is knocked down (stunned, status.ts) and kept down while it lasts, and shoved along it; a vehicle in it is shoved along it and soaked; what burns where the water lands is put out (a soaked car, VehicleState.soaked, catches no fire for a while: fire.ts), and every few ticks a douse event says where the water lands and how wide, for whatever else burns there (a ground fire, a later phase's zones). Its tank drains in tankSeconds of spraying and fills again in refillSeconds while it rests.

The trigger is the server's (a client's prediction never fires), so the jet runs in the server's world: the snapshots carry the tank, whether it sprays and its heading (snapshot.ts), and the client draws the stream from them.

Variables ​

Functions ​