This entity class represents weapon based items.
QUAKED NSWeapon (0 0.8 0.8) (-16 -16 0) (16 16 72)
OVERVIEW
This entity class represents weapon based items. It is based on NSItem. The only difference is that the attack related keys get forwarded only to items of this class.
FireInfo
Weapon firing events are split into optional decl titled 'FireInfo' that are queried for implemented attack types.
The "def_fireInfo" key points to the decl containing the primary-attack FireInfo. If that doesn't exist, the keys that would be queried from there are read from the main decl. This goes for any key that is not present in a FireInfo.
The "def_altFireInfo" key points to the decl containing the secondary-attack FireInfo. If that does not exist, secondary attacks are not possible.
KEYS
- "targetname" : Name
- "weapon_scriptobject" : mapC progs with the weapon code within.
- "clipSize" : maximum clip size
- "mtr_flashShader" : muzzleflash material to Use.
- "model_flash" : muzzleflash model/sprite to use.
- "flashColor" : muzzleflash dlight color
- "flashRadius" : muzzleflash dlight radius
- "def_dropItem" : when this item is dropped from someones inventory, will spawn this entityDef item instead.
- "snd_acquire" : pickup noise
- "snd_respawn" : respawn noise
- "snd_hum" : idle shader
- "smoke_muzzle" : smoke particle effect name
- "continuousSmoke" : whether the particle effect is continous
- "clipSizeDefault" : CUSTOM: Default clip size on pickup.
FireInfo related keys
- "def_onFire" : Def to spawn when the weapon is fired.
- "def_onRelease" : Def to spawn when the weapon has been released.
Ammo management related keys
- "ammoType" : name of the ammo type def entry which the weapon uses
- "ammoRequired" : set to 1 if we require ammo.
- "ammoPerShot" : Amount of ammo to deduct per successful shot.
Charging/Overcharging
For an overcharge effect, spawn a self-destructive explosion on "def_onFire", and rely on "def_onRelease" for delivering a lethal charge to other enemies.
- "chargeTime" : Amount of time the weapon has to charge before "def_onFire" is spawned.
Overheating weapons
Overheating of the weapon is done when both keys are set.
- "overheatLength" : Time in which it takes for the weapon to cool down.
- "overheatPerShot" : Time added against "overheatLength" when a shot is fired.
Mode switching
- "altMode" : When 1, then secondary-attack will toggle between "def_fireInfo" and "def_altFireInfo" on primary-attack.
Act overrides
Activities are used to decide which animation gets played and which actions are available for this object. If a model does not define them, you can override them here. This system is SUBJECT to change. It may be removed altogether when FTEQW adds a proper activity override format for existing models.
- "actIdle" : Sequences to play when idle.
- "actIdleEmpty" : Sequences to play when idle and with an empty clip.
- "actDraw" : Sequences to play when drawing the weapon.
- "actDrawEmpty" : Sequences to play when drawing the empty weapon.
- "actHolster" : Sequences to play when holstering the weapon.
- "actHolsterEmpty" : Sequences to play when holstering the empty weapon.
- "actFire" : Sequences to play when "def_onFire" fires.
- "actFireLast" : Sequences to play when firing the last shot in the weapon.
- "actFireEmpty" : Sequences to play when failing to fire the weapon.
- "actReload" : Sequences to play when reloading the weapon.
- "actReloadEmpty" : Sequences to play when reloading the empty weapon.
- "actReloadStart" : When set will play sequences for the start of a shotgun-style reload.
- "actReloadEnd" : Like "actReloadStart" but for the end of the shotgun-style reload.
- "actDelay" : Sequence to play while the weapon is charging (see "chargeTime")
- "actLoop" : Sequence to play while the weapon is still charging, or in a firing-loop.
- "actDetonate" : Sequences to play when "detonateOnFire" is triggered.
- "actMeleeMiss" : Sequences to play when the melee attack fails.
- "actMeleeHit" : Sequences to play when the melee attack hits.
- "actFireStart" : Sequences to play at the start of a loop/charge attack.
- "actFireStop" : Sequences to play at the end of a loop/charge attack.
- "actRelease" : Sequences to play when "def_onRelease" fires.
Misc keys
- "reloadTime" : Time in seconds between the start/end of a reload.
- "detonateOnFire" : When set, will detonate all entities of specified classname.
- "punchAngle" : Weapon punchangle to be applied to the camera when shooting "def_onFire".
- "fireRate" : Firing rate between shots.
- "semiAuto" : If not set to "1", the weapon will be fully automatic.