Skip to content

five-on-it / packages/sim/src/weapons / WeaponDef

Interface: WeaponDef ​

Defined in: packages/sim/src/weapons.ts:68

One weapon of the table.

Properties ​

ammo? ​

optional ammo?: string

Defined in: packages/sim/src/weapons.ts:92

The item a shot uses up, by id (a round, a shell, a rocket, a dart, the grenade itself); none for the fists.


blast? ​

optional blast?: BlastSize

Defined in: packages/sim/src/weapons.ts:106

Its blast, when it is not a grenade's or a rocket's (a charge's bigger one, a launcher's smaller).


charges? ​

optional charges?: number

Defined in: packages/sim/src/weapons.ts:108

A taser's charges: it fires without ammunition, each shot one charge, each charge back in recharge ticks.


damage ​

damage: number

Defined in: packages/sim/src/weapons.ts:86

Hit points taken per pellet or punch; at the centre of a blast, fading to zero at its edge.


effect? ​

optional effect?: WeaponEffect

Defined in: packages/sim/src/weapons.ts:98

What its projectile does where it goes off (ordnance.ts): a blast (the default), a cloud of smoke or tear gas, a ground fire, a flash that stuns, an EMP's pulse; what its dart does: put to sleep (the default) or stun (a taser's).


fuse ​

fuse: number

Defined in: packages/sim/src/weapons.ts:84

Ticks a projectile lives before it blows up.


impact? ​

optional impact?: "burst" | "stick"

Defined in: packages/sim/src/weapons.ts:104

A projectile that flies its own arc (no body; gravity pulls it) and goes off where it hits (burst: a bottle, a launcher's grenade), or sticks to what it hits and goes off at its fuse from there (stick: a charge on a car). Thrown, it never cooks in the hand.


item? ​

optional item?: string

Defined in: packages/sim/src/weapons.ts:90

The item that is this weapon, by id (items.ts); none for the fists.


kind ​

kind: WeaponKind

Defined in: packages/sim/src/weapons.ts:72

How it delivers its shot.


moveSpread? ​

optional moveSpread?: number

Defined in: packages/sim/src/weapons.ts:118

The spread a shot takes when the shooter moves (rad): a rifle that wants its shooter still.


name ​

name: string

Defined in: packages/sim/src/weapons.ts:70

Display name.


noise ​

noise: number

Defined in: packages/sim/src/weapons.ts:88

How far its shot is heard (m): NPCs within it hear it (@foi/ai), a loud one wakes sleepers (status.ts).


nonLethal? ​

optional nonLethal?: boolean

Defined in: packages/sim/src/weapons.ts:120

It never kills and takes people down instead (a taser, a dart, a flashbang, tear gas, smoke): what @foi/ai's police count as a non-lethal takedown.


pace? ​

optional pace?: number

Defined in: packages/sim/src/weapons.ts:116

The share of its pace a character keeps while it holds it (a minigun's weight).


pellets ​

pellets: number

Defined in: packages/sim/src/weapons.ts:80

Rays per shot (a shotgun's pellets).


range ​

range: number

Defined in: packages/sim/src/weapons.ts:78

Reach of a hitscan ray or a punch (m).


rateTicks ​

rateTicks: number

Defined in: packages/sim/src/weapons.ts:74

Ticks between two shots with the trigger held.


recharge? ​

optional recharge?: number

Defined in: packages/sim/src/weapons.ts:110

Ticks a charge takes to come back.


speed ​

speed: number

Defined in: packages/sim/src/weapons.ts:82

Launch speed of a projectile (m/s).


spinUp? ​

optional spinUp?: number

Defined in: packages/sim/src/weapons.ts:114

Ticks the barrels spin with the trigger held before the first round goes (a minigun's).


spread ​

spread: number

Defined in: packages/sim/src/weapons.ts:76

Half-angle of the random spread per pellet (rad); of the arc a punch covers.


stun? ​

optional stun?: number

Defined in: packages/sim/src/weapons.ts:112

Ticks a dart's stun lasts (a taser's).