five-on-it / packages/sim/src/grappler
packages/sim/src/grappler
The Grappler (C3, GAME_DESIGN §12 at seven stars): a police cruiser's bumper net that catches the rear wheel of the car ahead and drags it to a stop. A cruiser is fitted with one by the police (@foi/ai), the net drawn on its bumper (VehicleState.grappler, on the wire).
- The hook (grappleSystem): a fitted cruiser with a live driver whose nose comes within GRAPPLER
.reachof the rear of a car a player drives, square behind it, closing slower than GRAPPLER.closing(15 km/h), hooks it: the car is held (VehicleState.hooked, and which cruiser holds it,hookedBy), ahookevent. A car heavier than GRAPPLER.heavy(the APC, the armoured limo: R5) is never held: it snaps the net at once. - The tether: a held car's engine drives it no further forward and its brakes drag at GRAPPLER
.dragof their force, so it slows to a stop in three seconds or so (vehicle.tsreads the flag); the officers then pull its driver out as at any car standing still (@foi/ai's police). - The escapes: its driver pulling hard in reverse for a second snaps it; so does the cruiser's driver shot at the wheel (one that got out to make the arrest leaves the cruiser parked, the net holding), the cruiser wrecked or gone, or the two pulled more than GRAPPLER
.tetherapart. A snap is ahookevent too, and the cruiser's net takes GRAPPLER.resetTicksto be ready again (VehicleState.grapplercounts them down).
Deterministic and hashed. The hook is the server's (a client's twins of the police's cars are fitted with nothing), but a client's predicted car is held as the server's is (the snapshots carry hooked, setHooked): its drag, and the snap of a hard reverse, replay as on the server.