five-on-it / packages/sim/src/fire
packages/sim/src/fire
Cars on fire and blowing up (the user's list of 2026-10-11): a car brought low catches fire, burns for a while and blows up, sooner if it is hurt further, and its blast lights the cars beside it, so a row of them goes up one after the other.
- Catching fire. A car with an engine (not a bicycle) catches fire at FIRE
.igniteHealthhit points or below, whatever brought it there (a crash, a shot, lava; a wreck too); a blast (a rocket, a grenade, another car's) lights it at.blastIgniteor below, a bullet at.shotIgniteor below. Never in water (its body in it:water.ts'vehicleInWater, wading deep, flooding or sunk), which puts a fire out, a burning car's and a blown-up wreck's alike; lava wrecks a car and sets it alight. - Burning. The fire takes
.burnPerSecondhit points a second off the car and.occupantsPerSecondoff everyone still in it, and its fuse runs: a few seconds, longer for a bigger vehicle (fuseTicks). A car wrecked while it burns (shot to pieces) blows up within.wreckFuseSeconds. - Blowing up. A blast as big as the vehicle (blastSize: a car's 7 m, a bus's over 11) hurts and shoves everything in reach, kills whoever is still aboard, whatever the vehicle (the dead slumped in a car's seats; a two-wheeler's riders thrown off it, dead, and flung by the blast), and throws the wreck up; a car in the inner part of the reach catches fire with a short fuse (the nearer, the shorter), one further out if the blast left it low. The wreck burns
.wreckBurnSeconds(half that in a downpour,.rainBurnout), then smoulders. Only the deliberate protections spare anyone aboard: the debug switch of infinite health and the griefing rules (griefing.ts'mayHurt: a ghost, another player's fire where players may not hurt each other). - Whose fire. Whoever set a car alight owns its fire, its blast and the fires its blast lights in turn: a chain is theirs (
@foi/ai's police count it).
The server's world alone runs it (the rule vehicleFire); a client's draws the fires the snapshots carry (burning, exploded). Deterministic: cars in ascending id order, the fuses in ticks, and the state hashed.