Nuclide
Software Development Kit for id Tech
NSProjectile Class Reference

This entity class represents an interactive projectile. More...

#include <NSProjectile.h>

Inheritance diagram for NSProjectile:
NSSurfacePropEntity

Public Member Functions

void NSProjectile (void)
 
virtual void ReceiveEntity (float, float)
 Client: Handles network updates from the server for the associated entity. More...
 
virtual float predraw (void)
 
nonvirtual void SetImpact (void(entity, entity))
 Sets the function that'll be called upon impact of the projectile onto a surface. More...
 
nonvirtual void Animate (int, int, float)
 When called, will animated between two frame positions at a specified framerate on loop. More...
 
nonvirtual void AnimateOnce (int, int, float)
 When called, will animated between two frame positions at a specified framerate and remove itself when it has finished playing the sequence. More...
 
virtual void Touch (entity)
 Called upon the projectile touching another object. More...
 
virtual void Spawned (void)
 Called when the entity is fulled initialized. More...
 
virtual void Death (void)
 Called when the health is equal or below 0. More...
 
virtual void Pain (void)
 Called whenever the entity receives damage. More...
 
virtual void SpawnKey (string, string)
 This method handles entity key/value pairs on map load. More...
 
virtual void EvaluateEntity (void)
 Run each tic after physics are run to determine if we need to send updates over the network. More...
 
virtual float SendEntity (entity, float)
 Called by the engine whenever we need to send a client an update about this entity. More...
 
virtual void Save (float)
 Handles saving a copy of this entity to a given filehandle. More...
 
virtual void Restore (string, string)
 Similar to ::SpawnKey but for save-game fields. More...
 
virtual void Trigger (entity, triggermode_t)
 Called whenever we're legacy triggered by another object or function. More...
 
nonvirtual void _FuseEnded (void)
 
nonvirtual void _Explode (void)
 
nonvirtual void _LaunchHitscan (vector, vector, float)
 
nonvirtual void Launch (vector, vector, float, float, float)
 
nonvirtual void SetLightColor (vector)
 
nonvirtual void SetLightRadius (float)
 
nonvirtual void EnableDetonateOnFuse (bool)
 
nonvirtual void EnableDetonateOnDeath (bool)
 
nonvirtual void EnableDetonateOnWorld (bool)
 
nonvirtual void EnableDetonateOnActor (bool)
 
nonvirtual void EnableStickToWorld (bool)
 
nonvirtual void EnableStickToActor (bool)
 
nonvirtual void EnableThrustHoming (bool)
 
nonvirtual void EnableInheritVelocity (bool)
 

Detailed Description

This entity class represents an interactive projectile.

Objects such as rockets, grenades, bolts etc. should ideally be this.

Constructor & Destructor Documentation

◆ NSProjectile()

void NSProjectile::NSProjectile ( void  )

Member Function Documentation

◆ _Explode()

void NSProjectile::_Explode ( void  )

◆ _FuseEnded()

void NSProjectile::_FuseEnded ( void  )

◆ _LaunchHitscan()

void NSProjectile::_LaunchHitscan ( vector  startPos,
vector  launchDir,
float  dmgMultiplier 
)

◆ Animate()

void NSProjectile::Animate ( int  startframe,
int  endframe,
float  framerate 
)

When called, will animated between two frame positions at a specified framerate on loop.

◆ AnimateOnce()

void NSProjectile::AnimateOnce ( int  startframe,
int  endframe,
float  framerate 
)

When called, will animated between two frame positions at a specified framerate and remove itself when it has finished playing the sequence.

◆ Death()

void NSProjectile::Death ( void  )
virtual

Called when the health is equal or below 0.

Reimplemented from NSSurfacePropEntity.

◆ EnableDetonateOnActor()

void NSProjectile::EnableDetonateOnActor ( bool  enabled)

◆ EnableDetonateOnDeath()

void NSProjectile::EnableDetonateOnDeath ( bool  enabled)

◆ EnableDetonateOnFuse()

void NSProjectile::EnableDetonateOnFuse ( bool  enabled)

◆ EnableDetonateOnWorld()

void NSProjectile::EnableDetonateOnWorld ( bool  enabled)

◆ EnableInheritVelocity()

void NSProjectile::EnableInheritVelocity ( bool  enabled)

◆ EnableStickToActor()

void NSProjectile::EnableStickToActor ( bool  enabled)

◆ EnableStickToWorld()

void NSProjectile::EnableStickToWorld ( bool  enabled)

◆ EnableThrustHoming()

void NSProjectile::EnableThrustHoming ( bool  enabled)

◆ EvaluateEntity()

void NSProjectile::EvaluateEntity ( void  )
virtual

Run each tic after physics are run to determine if we need to send updates over the network.

Reimplemented from NSSurfacePropEntity.

◆ Launch()

void NSProjectile::Launch ( vector  startPos,
vector  launchDir,
float  fuseOffset,
float  powerMultiplier,
float  dmgMultiplier 
)

◆ Pain()

void NSProjectile::Pain ( void  )
virtual

Called whenever the entity receives damage.

Reimplemented from NSSurfacePropEntity.

◆ predraw()

float NSProjectile::predraw ( void  )
virtual

Reimplemented from NSSurfacePropEntity.

◆ ReceiveEntity()

void NSProjectile::ReceiveEntity ( float  flNew,
float  flChanged 
)
virtual

Client: Handles network updates from the server for the associated entity.

Reimplemented from NSSurfacePropEntity.

◆ Restore()

void NSProjectile::Restore ( string  strKey,
string  strValue 
)
virtual

Similar to ::SpawnKey but for save-game fields.

Whatever you write into file handles within your ::Save() method needs to be read back in here.

Reimplemented from NSSurfacePropEntity.

◆ Save()

void NSProjectile::Save ( float  handle)
virtual

Handles saving a copy of this entity to a given filehandle.

Within you want to use the ::SaveFloat() etc. methods to write the internal member attributes to the specified file handle.

Reimplemented from NSSurfacePropEntity.

◆ SendEntity()

float NSProjectile::SendEntity ( entity  ,
float   
)
virtual

Called by the engine whenever we need to send a client an update about this entity.

Reimplemented from NSSurfacePropEntity.

◆ SetImpact()

void NSProjectile::SetImpact ( void(entity, entity )

Sets the function that'll be called upon impact of the projectile onto a surface.

◆ SetLightColor()

void NSProjectile::SetLightColor ( vector  newColor)

◆ SetLightRadius()

void NSProjectile::SetLightRadius ( float  newRadius)

◆ Spawned()

void NSProjectile::Spawned ( void  )
virtual

Called when the entity is fulled initialized.

Any spawn key/value info pairs have already been dealt with. So now we can make full decisions on the entity. Always make sure to call super::Spawned(); inside your method when overriding.

Reimplemented from NSSurfacePropEntity.

◆ SpawnKey()

void NSProjectile::SpawnKey ( string  strKey,
string  strValue 
)
virtual

This method handles entity key/value pairs on map load.

You can easily convert the strValue parameter using the ReadFloat etc. methods that are part of NSIO.

Reimplemented from NSSurfacePropEntity.

◆ Touch()

void NSProjectile::Touch ( entity  eToucher)
virtual

Called upon the projectile touching another object.

Reimplemented from NSTrigger.

◆ Trigger()

void NSProjectile::Trigger ( entity  act,
triggermode_t  state 
)
virtual

Called whenever we're legacy triggered by another object or function.

Reimplemented from NSTrigger.


The documentation for this class was generated from the following files: