Vorti-Beam weapon
Weapon defined in entities/weapons/weapon_vort
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
SWEP:Think fires after SWEP.BeamChargeTime seconds.SWEP:Think applies after SWEP.HealDelay seconds.SWEP.Range units.Methods
SWEP:CreateBlast(scale, pos)
shared gamemodes/cwhl2rp/schema/entities/weapons/weapon_vort/shared.lua:176Spawns 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
trueto allow the deploy
SWEP:DispatchEffect(EFFECTSTR)
shared gamemodes/cwhl2rp/schema/entities/weapons/weapon_vort/shared.lua:95Attaches 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
trueto allow the holster
SWEP:ImpactEffect(traceHit)
shared gamemodes/cwhl2rp/schema/entities/weapons/weapon_vort/shared.lua:155Plays 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
nilDamage to deal; defaults toSWEP.BeamDamage - effect String optional, defaults to
nilTracer particle system; defaults tovortigaunt_beam
SWEP:ShootEffect(EFFECTSTR, startpos, endpos)
shared gamemodes/cwhl2rp/schema/entities/weapons/weapon_vort/shared.lua:119Draws 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.