five-on-it / packages/sim/src/weapons / fireWeapon
Function: fireWeapon()
fireWeapon(
sim,shooter):void
Defined in: packages/sim/src/weapons.ts:725
Fires a character's selected weapon where it aims, spending one of its ammunition (a round, a shell for all of a shotgun's pellets, a rocket, a dart): fists punch, a hitscan weapon traces its rays now, turned and pitched to the chosen target on the line of fire if there is one (the first pellet straight at it, the others with the weapon's spread around it), hurts whatever they hit and records one shot event with the nearest hit; a launcher spawns a projectile just clear of the shooter (or of the car it sits in). The caller checks canFire.
Parameters
sim
shooter
number
Returns
void