Nuclide
Software Development Kit for id Tech
NSSurfacePropEntity Class Reference

This entity represents an NSRenderableEntity with interactive surface properties. More...

#include <NSSurfacePropEntity.h>

Inheritance diagram for NSSurfacePropEntity:
NSRenderableEntity NSMoverEntity NSNavAI NSPhysicsEntity NSProjectile NSVehicle button_target cycler func_breakable func_guntarget func_rot_button prop_dynamic

Public Member Functions

void NSSurfacePropEntity (void)
 
virtual void Spawned (void)
 Called when the entity is fulled initialized. More...
 
virtual void SetModel (string)
 Sets the 3D model representation of the entity from a file path and name. 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 Respawn (void)
 Server: Called when the entity first spawns or when game-logic requests the entity to return to its original spawn state. More...
 
virtual void Input (entity, string, string)
 Called when we are being prompted by another object/function with an input message. More...
 
virtual void SpawnKey (string, string)
 This method handles entity key/value pairs on map load. More...
 
virtual void ParentUpdate (void)
 Called when we need to re-align the entity to our parent entity. 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 float predraw (void)
 
virtual void ReceiveEntity (float, float)
 Client: Handles network updates from the server for the associated entity. More...
 
nonvirtual bool IsOnFire (void)
 Returns whether or not this entity is on fire. More...
 
nonvirtual void Ignite (entity, float, int)
 Sets the entity on fire. More...
 
nonvirtual void Extinguish (void)
 If the entity is on fire, it'll have it extinguished. More...
 
virtual void Pain (void)
 Called whenever the entity receives damage. More...
 
virtual void Death (void)
 Called when the health is equal or below 0. More...
 
virtual bool IsAlive (void)
 Returns whether or not the entity is alive. More...
 
nonvirtual bool CanBleed (void)
 Returns whether the entity can bleed. More...
 
nonvirtual bool IsVulnerable (void)
 Returns whether the entity can be damaged. More...
 
nonvirtual void EnableBleeding (void)
 Makes the entity vulnerable if it wasn't already. More...
 
nonvirtual void DisableBleeding (void)
 Makes the entity invulnerable if it wasn't already. More...
 
nonvirtual void EnableAimAssist (void)
 Makes the entity vulnerable if it wasn't already. More...
 
nonvirtual void DisableAimAssist (void)
 Makes the entity invulnerable if it wasn't already. More...
 
nonvirtual void MakeVulnerable (void)
 Makes the entity vulnerable if it wasn't already. More...
 
nonvirtual void MakeInvulnerable (void)
 Makes the entity invulnerable if it wasn't already. More...
 
nonvirtual void SetTakedamage (float)
 Deprecated: Sets whether the entity can take damage. More...
 
nonvirtual void SetHealth (float)
 Sets the current health of the entity. More...
 
nonvirtual void SetMaxHealth (float)
 Sets the maximum amount of health the entity can have. More...
 
nonvirtual float GetHealth (void)
 Returns the current health of the entity. More...
 
nonvirtual float GetMaxHealth (void)
 Returns the maximum health the entity can have. More...
 
nonvirtual void SetArmor (float)
 Sets the current armor of the entity. More...
 
nonvirtual float GetArmor (void)
 Returns the current armor of the entity. More...
 
nonvirtual float GetSpawnHealth (void)
 Returns the health the entity spawned with at map load. More...
 
nonvirtual bool HasPropData (void)
 Returns if the entity has prop data information set. More...
 
nonvirtual __variant GetPropData (int)
 Returns a variable type of information about the entity's prop data. More...
 
nonvirtual bool HasSurfaceData (void)
 Returns if the entity has surface data information set. More...
 
nonvirtual __variant GetSurfaceData (int)
 Returns a variable type of information about the entity's surface data. More...
 
nonvirtual void SetSurfaceData (string)
 Assigns the surface data of a given description onto this entity. More...
 
nonvirtual void SetPropData (string)
 Assigns the prop data of a given description onto this entity. More...
 
nonvirtual float TimeSinceDeath (void)
 Returns how many seconds have passed since we died. More...
 
virtual void DamageFeedback (NSSurfacePropEntity, NSSurfacePropEntity, int)
 Called when a different entity gets damaged by this entity. More...
 
nonvirtual void SetPainCallback (void(void))
 Sets which function to call upon taking pain. More...
 
nonvirtual void SetDeathCallback (void(void))
 Sets which function to call upon taking death. More...
 
nonvirtual bool CanBeDamaged (void)
 Returns whether this entity reacts to damage being inflicted. More...
 
nonvirtual void SetBloodColor (vector)
 Sets the colour of the blood of this entity. More...
 
nonvirtual vector GetBloodColor (void)
 Returns the blood color of this entity. More...
 
virtual void RenderFire (void)
 Called every frame to render a fire effect, but will only do so if the entity is burning. More...
 
nonvirtual vector GetEyePos (void)
 Returns the absolute world position of where the eyes are located. More...
 
nonvirtual void SetEyePos (vector)
 Sets the relative position of the eyes. More...
 
nonvirtual vector GetViewAngle (void)
 Returns an euler angle of where the entity is 'looking' at. More...
 

Detailed Description

This entity represents an NSRenderableEntity with interactive surface properties.

It can take damage and can handle variously different types of impact.

Constructor & Destructor Documentation

◆ NSSurfacePropEntity()

void NSSurfacePropEntity::NSSurfacePropEntity ( void  )

Member Function Documentation

◆ CanBeDamaged()

bool NSSurfacePropEntity::CanBeDamaged ( void  )

Returns whether this entity reacts to damage being inflicted.

◆ CanBleed()

bool NSSurfacePropEntity::CanBleed ( void  )

Returns whether the entity can bleed.

◆ DamageFeedback()

void NSSurfacePropEntity::DamageFeedback ( NSSurfacePropEntity  theVictim,
NSSurfacePropEntity  theInflictor,
int  desiredDamage 
)
virtual

Called when a different entity gets damaged by this entity.

◆ Death()

void NSSurfacePropEntity::Death ( void  )
virtual

Called when the health is equal or below 0.

Reimplemented in func_breakable, func_guntarget, func_rot_button, NSClientPlayer, NSMonster, NSPhysicsEntity, and NSProjectile.

◆ DisableAimAssist()

void NSSurfacePropEntity::DisableAimAssist ( void  )

Makes the entity invulnerable if it wasn't already.

◆ DisableBleeding()

void NSSurfacePropEntity::DisableBleeding ( void  )

Makes the entity invulnerable if it wasn't already.

◆ EnableAimAssist()

void NSSurfacePropEntity::EnableAimAssist ( void  )

Makes the entity vulnerable if it wasn't already.

◆ EnableBleeding()

void NSSurfacePropEntity::EnableBleeding ( void  )

Makes the entity vulnerable if it wasn't already.

◆ EvaluateEntity()

void NSSurfacePropEntity::EvaluateEntity ( void  )
virtual

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

Reimplemented from NSRenderableEntity.

Reimplemented in func_tracktrain, ambient_generic, speaker, NSClientPlayer, NSClientSpectator, NSMonster, NSPhysicsEntity, NSProjectile, and NSVehicle.

◆ Extinguish()

void NSSurfacePropEntity::Extinguish ( void  )

If the entity is on fire, it'll have it extinguished.

◆ GetArmor()

float NSSurfacePropEntity::GetArmor ( void  )

Returns the current armor of the entity.

◆ GetBloodColor()

vector NSSurfacePropEntity::GetBloodColor ( void  )

Returns the blood color of this entity.

◆ GetEyePos()

vector NSSurfacePropEntity::GetEyePos ( void  )

Returns the absolute world position of where the eyes are located.

◆ GetHealth()

float NSSurfacePropEntity::GetHealth ( void  )

Returns the current health of the entity.

◆ GetMaxHealth()

float NSSurfacePropEntity::GetMaxHealth ( void  )

Returns the maximum health the entity can have.

◆ GetPropData()

__variant NSSurfacePropEntity::GetPropData ( int  type)

Returns a variable type of information about the entity's prop data.

◆ GetSpawnHealth()

float NSSurfacePropEntity::GetSpawnHealth ( void  )

Returns the health the entity spawned with at map load.

◆ GetSurfaceData()

__variant NSSurfacePropEntity::GetSurfaceData ( int  type)

Returns a variable type of information about the entity's surface data.

◆ GetViewAngle()

vector NSSurfacePropEntity::GetViewAngle ( void  )

Returns an euler angle of where the entity is 'looking' at.

These are not necessarily eye values.

◆ HasPropData()

bool NSSurfacePropEntity::HasPropData ( void  )

Returns if the entity has prop data information set.

◆ HasSurfaceData()

bool NSSurfacePropEntity::HasSurfaceData ( void  )

Returns if the entity has surface data information set.

◆ Ignite()

void NSSurfacePropEntity::Ignite ( entity  attacker,
float  flLifetime,
int  iWeapon 
)

Sets the entity on fire.

◆ Input()

void NSSurfacePropEntity::Input ( entity  eAct,
string  strInput,
string  strData 
)
virtual

Called when we are being prompted by another object/function with an input message.

Reimplemented from NSRenderableEntity.

Reimplemented in func_door, func_guntarget, func_plat, ambient_generic, and NSMonster.

◆ IsAlive()

bool NSSurfacePropEntity::IsAlive ( void  )
virtual

Returns whether or not the entity is alive.

Reimplemented in NSMonster.

◆ IsOnFire()

bool NSSurfacePropEntity::IsOnFire ( void  )

Returns whether or not this entity is on fire.

◆ IsVulnerable()

bool NSSurfacePropEntity::IsVulnerable ( void  )

Returns whether the entity can be damaged.

◆ MakeInvulnerable()

void NSSurfacePropEntity::MakeInvulnerable ( void  )

Makes the entity invulnerable if it wasn't already.

◆ MakeVulnerable()

void NSSurfacePropEntity::MakeVulnerable ( void  )

Makes the entity vulnerable if it wasn't already.

◆ Pain()

void NSSurfacePropEntity::Pain ( void  )
virtual

Called whenever the entity receives damage.

Reimplemented in cycler, func_breakable, NSMonster, NSPhysicsEntity, and NSProjectile.

◆ ParentUpdate()

void NSSurfacePropEntity::ParentUpdate ( void  )
virtual

Called when we need to re-align the entity to our parent entity.

Reimplemented from NSEntity.

◆ predraw()

virtual float NSSurfacePropEntity::predraw ( void  )
virtual

◆ ReceiveEntity()

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

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

Reimplemented from NSRenderableEntity.

Reimplemented in func_tracktrain, func_tankmortar, prop_vehicle_driveable, speaker, NSClientPlayer, NSClientSpectator, NSMonster, NSPhysicsEntity, NSProjectile, NSTalkMonster, and NSVehicle.

◆ RenderFire()

virtual void NSSurfacePropEntity::RenderFire ( void  )
virtual

Called every frame to render a fire effect, but will only do so if the entity is burning.

◆ Respawn()

void NSSurfacePropEntity::Respawn ( void  )
virtual

◆ Restore()

void NSSurfacePropEntity::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 NSRenderableEntity.

Reimplemented in func_breakable, func_button, func_door, func_door_rotating, func_guntarget, func_plat, func_platrot, func_pushable, func_rot_button, func_tank, func_trackchange, func_tracktrain, ambient_generic, speaker, NSClient, NSClientPlayer, NSClientSpectator, NSMonster, NSMoverEntity, NSNavAI, NSPhysicsEntity, NSProjectile, NSSquadMonster, NSTalkMonster, and NSVehicle.

◆ Save()

void NSSurfacePropEntity::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 NSRenderableEntity.

Reimplemented in func_breakable, func_button, func_door, func_door_rotating, func_guntarget, func_plat, func_platrot, func_pushable, func_rot_button, func_tank, func_trackchange, func_tracktrain, ambient_generic, speaker, NSClient, NSClientPlayer, NSClientSpectator, NSMonster, NSMoverEntity, NSNavAI, NSPhysicsEntity, NSProjectile, NSSquadMonster, NSTalkMonster, and NSVehicle.

◆ SendEntity()

float NSSurfacePropEntity::SendEntity ( entity  ,
float   
)
virtual

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

Reimplemented from NSRenderableEntity.

Reimplemented in func_tracktrain, ambient_generic, speaker, NSClientPlayer, NSClientSpectator, NSMonster, NSPhysicsEntity, NSProjectile, NSTalkMonster, and NSVehicle.

◆ SetArmor()

void NSSurfacePropEntity::SetArmor ( float  new_armor)

Sets the current armor of the entity.

◆ SetBloodColor()

void NSSurfacePropEntity::SetBloodColor ( vector  newColor)

Sets the colour of the blood of this entity.

◆ SetDeathCallback()

void NSSurfacePropEntity::SetDeathCallback ( void(void deathFunc)

Sets which function to call upon taking death.

◆ SetEyePos()

void NSSurfacePropEntity::SetEyePos ( vector  value)

Sets the relative position of the eyes.

◆ SetHealth()

void NSSurfacePropEntity::SetHealth ( float  new_health)

Sets the current health of the entity.

◆ SetMaxHealth()

void NSSurfacePropEntity::SetMaxHealth ( float  new_health)

Sets the maximum amount of health the entity can have.

◆ SetModel()

void NSSurfacePropEntity::SetModel ( string  newModel)
virtual

Sets the 3D model representation of the entity from a file path and name.

Reimplemented from NSEntity.

◆ SetPainCallback()

void NSSurfacePropEntity::SetPainCallback ( void(void painFunc)

Sets which function to call upon taking pain.

◆ SetPropData()

void NSSurfacePropEntity::SetPropData ( string  type)

Assigns the prop data of a given description onto this entity.

◆ SetSurfaceData()

void NSSurfacePropEntity::SetSurfaceData ( string  type)

Assigns the surface data of a given description onto this entity.

◆ SetTakedamage()

void NSSurfacePropEntity::SetTakedamage ( float  type)

Deprecated: Sets whether the entity can take damage.

◆ Spawned()

void NSSurfacePropEntity::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 NSEntity.

Reimplemented in prop_static, func_breakable, func_button, func_door, func_door_rotating, func_guntarget, func_plat, func_pushable, func_tank, func_trackchange, func_tracktrain, ambient_generic, func_tankmortar, prop_vehicle_driveable, speaker, NSMonster, NSPhysicsEntity, NSProjectile, and NSSquadMonster.

◆ SpawnKey()

void NSSurfacePropEntity::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 NSRenderableEntity.

Reimplemented in prop_static, func_breakable, func_button, func_door, func_door_rotating, func_guntarget, func_physbox, func_plat, func_platrot, func_pushable, func_rot_button, func_tank, func_trackchange, func_tracktrain, prop_dynamic, prop_physics, ambient_generic, prop_physics_multiplayer, speaker, NSMonster, NSMoverEntity, NSPhysicsEntity, NSProjectile, NSSquadMonster, and NSTalkMonster.

◆ TimeSinceDeath()

float NSSurfacePropEntity::TimeSinceDeath ( void  )

Returns how many seconds have passed since we died.

Will return -1 if not applicable.


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