Nuclide
Software Development Kit for id Technology (BETA)
ncProjectile Class Reference

About this class

This entity class represents an interactive projectile.

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

Inheritance diagram for ncProjectile:
ncAttack

Public Member Functions

void ncProjectile (void)
 
virtual void ReceiveEntity (float, float)
 Client: Handles network updates from the server for the associated entity. More...
 
virtual float predraw (void)
 
virtual void postdraw (void)
 Client: Run after the rendering of 3D world is complete. More...
 
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 Pain (entity, entity, int, vector, vector, int)
 Called whenever the entity receives damage. More...
 
virtual void Death (entity, entity, int, vector, vector, int)
 Called when the health is equal or below 0. 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 ncIO::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 (entity)
 
virtual void _LaunchHitscan (vector, vector, float)
 
virtual void Launch (vector, vector, float, float, float)
 
nonvirtual void SetLightColor (vector)
 
nonvirtual void SetLightRadius (float)
 
nonvirtual void SetWeaponOwner (ncWeapon)
 
nonvirtual ncWeapon GetWeaponOwner (void)
 
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)
 

Constructor & Destructor Documentation

◆ ncProjectile()

void ncProjectile::ncProjectile ( void  )

Member Function Documentation

◆ _Explode()

void ncProjectile::_Explode ( entity  explodedOn)

◆ _FuseEnded()

void ncProjectile::_FuseEnded ( void  )

◆ _LaunchHitscan()

void ncProjectile::_LaunchHitscan ( vector  startPos,
vector  launchDir,
float  dmgMultiplier 
)
virtual

◆ Animate()

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

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

◆ AnimateOnce()

void ncProjectile::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 ncProjectile::Death ( entity  inflictor,
entity  attacker,
int  damage,
vector  dir,
vector  absImpactPos,
int  hitBody 
)
virtual

Called when the health is equal or below 0.

Reimplemented from ncSurfacePropEntity.

◆ EnableDetonateOnActor()

void ncProjectile::EnableDetonateOnActor ( bool  enabled)

◆ EnableDetonateOnDeath()

void ncProjectile::EnableDetonateOnDeath ( bool  enabled)

◆ EnableDetonateOnFuse()

void ncProjectile::EnableDetonateOnFuse ( bool  enabled)

◆ EnableDetonateOnWorld()

void ncProjectile::EnableDetonateOnWorld ( bool  enabled)

◆ EnableInheritVelocity()

void ncProjectile::EnableInheritVelocity ( bool  enabled)

◆ EnableStickToActor()

void ncProjectile::EnableStickToActor ( bool  enabled)

◆ EnableStickToWorld()

void ncProjectile::EnableStickToWorld ( bool  enabled)

◆ EnableThrustHoming()

void ncProjectile::EnableThrustHoming ( bool  enabled)

◆ EvaluateEntity()

void ncProjectile::EvaluateEntity ( void  )
virtual

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

Reimplemented from ncSurfacePropEntity.

◆ GetWeaponOwner()

ncWeapon ncProjectile::GetWeaponOwner ( void  )

◆ Launch()

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

Reimplemented from ncAttack.

◆ Pain()

void ncProjectile::Pain ( entity  inflictor,
entity  attacker,
int  damage,
vector  dir,
vector  absImpactPos,
int  hitBody 
)
virtual

Called whenever the entity receives damage.

Reimplemented from ncSurfacePropEntity.

◆ postdraw()

void ncProjectile::postdraw ( void  )
virtual

Client: Run after the rendering of 3D world is complete.

2D calls can happen here.

Reimplemented from ncRenderableEntity.

◆ predraw()

float ncProjectile::predraw ( void  )
virtual

Reimplemented from ncSurfacePropEntity.

◆ ReceiveEntity()

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

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

Reimplemented from ncSurfacePropEntity.

◆ Restore()

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

Similar to ncIO::SpawnKey() but for save-game fields.

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

Reimplemented from ncAttack.

◆ Save()

void ncProjectile::Save ( float  handle)
virtual

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

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

Reimplemented from ncAttack.

◆ SendEntity()

float ncProjectile::SendEntity ( entity  ,
float   
)
virtual

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

Reimplemented from ncSurfacePropEntity.

◆ SetImpact()

void ncProjectile::SetImpact ( void(entity, entity)  )

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

◆ SetLightColor()

void ncProjectile::SetLightColor ( vector  newColor)

◆ SetLightRadius()

void ncProjectile::SetLightRadius ( float  newRadius)

◆ SetWeaponOwner()

void ncProjectile::SetWeaponOwner ( ncWeapon  weaponOwner)

◆ Spawned()

void ncProjectile::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 ncAttack.

◆ SpawnKey()

void ncProjectile::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 ncIO.

Reimplemented from ncAttack.

◆ Touch()

void ncProjectile::Touch ( entity  eToucher)
virtual

Called upon the projectile touching another object.

Reimplemented from ncTrigger.

◆ Trigger()

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

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

Reimplemented from ncTrigger.


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