Defines the weapon_vort weapon (Vorti-Beam), the vortigaunt's beam attack and healing ability.

Primary fire charges for SWEP.BeamChargeTime seconds and then fires a shock beam for SWEP.BeamDamage damage; secondary fire heals the player in front of the owner, or the owner, by 12 to 18 health after SWEP.HealDelay seconds. Both are advanced in SWEP:Think with looping sounds and particle effects.

Summary

Methods

Spawns a short-lived vortigaunt ring sprite on the server.
Creates the charge and heal loop sounds if they do not exist yet.
Deploy()shared
Plays the draw animation at normal speed.
Attaches a particle effect to the view model muzzle, or to the owner's right claw when seen from outside.
Heals the player in front of the owner within 50 units, or the owner, by 12 to 18 health up to 100.
Cancels any charge or heal in progress.
Plays the zap impact effect and blast rings at a trace hit, and makes hit ragdolls dance on the server.
Resets the charge and heal state, sets the shotgun hold type and creates the looping sounds on the server.
Cancels any charge or heal in progress.
Precaches the vortigaunt beam particles and the view model.
Starts charging the beam, which SWEP:Think fires after SWEP.BeamChargeTime seconds.
Reload()shared
Does nothing.
Starts a heal, which SWEP:Think applies after SWEP.HealDelay seconds.
Fires the vortigaunt beam along the owner's aim, up to SWEP.Range units.
Draws a particle tracer from the muzzle, or the owner's right claw when seen from outside, to a position.
Cancels charging and healing, stops their loop sounds and clears the last owner's particles.
Think()shared
Advances a charge or heal started by an attack and fires the beam or heals once it completes.

Methods

Spawns a short-lived vortigaunt ring sprite on the server.

Parameters

  • scale Number Sprite scale
  • pos Vector Where to place the sprite

Creates the charge and heal loop sounds if they do not exist yet.

Plays the draw animation at normal speed.

Returns

  • Boolean Always true to allow the deploy

Attaches a particle effect to the view model muzzle, or to the owner's right claw when seen from outside.

Parameters

  • EFFECTSTR String Name of the particle system

Heals the player in front of the owner within 50 units, or the owner, by 12 to 18 health up to 100.

Runs only on the server; does nothing when the target is already at the health limit.

Cancels any charge or heal in progress.

Parameters

  • wep

Returns

  • Boolean Always true to allow the holster

Plays the zap impact effect and blast rings at a trace hit, and makes hit ragdolls dance on the server.

Parameters

  • traceHit Map Trace result of the beam

Resets the charge and heal state, sets the shotgun hold type and creates the looping sounds on the server.

Cancels any charge or heal in progress.

Precaches the vortigaunt beam particles and the view model.

Starts charging the beam, which SWEP:Think fires after SWEP.BeamChargeTime seconds.

Does nothing.

Starts a heal, which SWEP:Think applies after SWEP.HealDelay seconds.

Only starts when the player in front of the owner or the owner is below the health limit.

Fires the vortigaunt beam along the owner's aim, up to SWEP.Range units.

On the server, the entity hit takes shock damage with a strong push. The beam tracer, attack sound and impact effects play in both realms.

Parameters

  • dmg Number optional, defaults to nil Damage to deal; defaults to SWEP.BeamDamage
  • effect String optional, defaults to nil Tracer particle system; defaults to vortigaunt_beam

SWEP:ShootEffect(EFFECTSTR, startpos, endpos)

shared gamemodes/cwhl2rp/schema/entities/weapons/weapon_vort/shared.lua:119

Draws a particle tracer from the muzzle, or the owner's right claw when seen from outside, to a position.

Parameters

  • EFFECTSTR String Name of the particle system
  • startpos Vector Start of the tracer when the weapon has no muzzle attachment
  • endpos Vector End of the tracer

Cancels charging and healing, stops their loop sounds and clears the last owner's particles.

Advances a charge or heal started by an attack and fires the beam or heals once it completes.

Also records the current owner for SWEP:StopEveryThing. Without enough ammo the charge or heal is cancelled with a deny sound.

Defined in