Skip to content

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

packages/sim/src/mods ​

Armour and upgrades (the ten-star build's V1 phase: R5–R11, R13, C10, C17): what makes a vehicle tougher than a car, of its class or fitted at a garage, and what those fittings do.

Armour of a class (vehicle-classes.ts): more hit points than a car's 100 (health), a share of a bullet's damage (bullets), run-flat tyres (runFlats), a ram plate on the nose (ram). Its hit points stay out of 100 (what is left of them, on the wire and on the HUD): a hit's damage is scaled by damageShare instead (the armoured limo's 400 take a quarter of a car's damage), so the fires' and the smoke's thresholds read every class the same. A bullet is a hitscan weapon's shot (weapons.ts); a blast, a crash or a fire is no bullet: explosives are what beats armour.

The mod garage (R13): a garage that resprays fits upgrades too (garages.ts: the services from 3 up, MOD_SHOP), each for its price in the room's Cash:

  • run-flats (R7): a nail strip a tyre crosses (a level's, the police's, someone's caltrops) no longer pops it; the car limps, a little slower for a few seconds;
  • a bull bar (R8): a ram plate on its nose: what it rams takes more of the crash, the car less (ramShare); a parked car it pushes nose first lets go of its parking brake, so a barricade's cars shove aside (shoveParked, an APC's plate too);
  • armour plating: half as many hit points again, bullets do 60 %; a little heavier (vehicle.ts builds its body heavier) and slower;
  • nitro (R11): three charges; the nitro key fires one: a two-second burn of a strong engine and a higher top speed (nitroBurn), its exhaust flame scorching a car or a person right behind (exhaustFlame, where cars burn: the server's world);
  • a rear dispenser (R9) of four charges of caltrops or of oil; the dispense key drops one behind the car (dispense): caltrops are the driver's own nail strip (nails.ts, popping a follower's tyres), oil a slick laid the same way (a strip of kind 1) that cuts the grip of a car driving over it for a couple of seconds (vehicle.ts, VehicleState.oiled).

The upgrades are the vehicle's (VehicleState.mods, the charges, the timers): they stay with it through a reset or a class change, into a garage's storage and out of it again. The snapshot carries them on a vehicle's record (kitByte); a client's prediction reads the mods, the nitro and the limp and oil timers, and fires its own nitro (the dispenser and the purchases are the server's alone).

Interfaces ​

Type Aliases ​

Variables ​

Functions ​