five-on-it / packages/sim/src/ordnance
packages/sim/src/ordnance
What a thrown or launched thing does where it goes off (weapons.ts' effect): a blast (a grenade, a launcher's grenade, a charge, whose blast hits the car it rode twice), a cloud of smoke or tear gas, a ground fire (a bottle), a patch of sticky foam (the police's foam gun's glob), a flashbang's flash, an EMP's pulse, a GPS dart's tag on the car it stuck to (tracking.ts). The clouds, the fire and the foam are zones (zones.ts), laid on the ground under where it went off.
- The flashbang (flashAt): a bang (an event,
flash, the burst) and a white flash; everyone on foot within FLASH.radiuswith a line of sight to it (no wall, no smoke between) is stunned for FLASH.stunSeconds(status.ts; the juggernaut suit and an adrenaline shot shrug it off), and each one the flash reached has its ownflashevent, so its player's screen whites out. An NPC's flashbang (a SWAT breacher's) never blinds a police officer: their visors. - The EMP (empPulse): a pulse (an event,
emp, which whatever else listens for it reads:@foi/ai's robots shut down, a hack in progress reset, a jammer fried); every car with an engine and electronics within EMP.radius(not an old car with nothing to hack,vehicle-classes.ts'isAnalog, nor one with a hardened ECU:mods.ts'unhackable) stalls for EMP.stallSeconds(VehicleState.stalled: no drive, no siren), every camera on within it goes off for EMP.cameraSeconds, and every drone in the air within it falls (flyers.ts'downFlyer: the police's, a swarm's, a scout).
Server-authoritative as every weapon is (weapons.ts): a client's world never fires.