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 NSActor NSMoverEntity 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 NSIO::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...
 
virtual void Damage (entity, entity, NSDict, float, vector, vector)
 Applies damage to the entity. More...
 
virtual void DamageFeedback (entity, entity, int)
 Called when a different entity gets damaged by this entity. More...
 
virtual void Pain (entity, entity, int, vector, int)
 Called whenever the entity receives damage. More...
 
virtual void Death (entity, entity, int, vector, int)
 Called when the health is equal or below 0. More...
 
virtual void BreakModel (int, vector, int)
 Called when the health is equal or below 0. More...
 
virtual bool IsAlive (void)
 Returns whether or not the entity is alive. 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...
 
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)
 Marks the entity as capable of bleeding. More...
 
nonvirtual void DisableBleeding (void)
 Marks the entity as incapable of bleeding. More...
 
nonvirtual void EnableAimAssist (void)
 Makes the entity visible to other entity their aim-assists. More...
 
nonvirtual void DisableAimAssist (void)
 Makes the entity invisible to other entity their aim-assists. 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...
 
nonvirtual bool CanBeDamaged (vector, vector)
 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...
 

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

◆ BreakModel()

void NSSurfacePropEntity::BreakModel ( int  damage,
vector  dir,
int  location 
)
virtual

Called when the health is equal or below 0.

◆ CanBeDamaged()

bool NSSurfacePropEntity::CanBeDamaged ( vector  damageOrigin,
vector  hitLocation 
)

Returns whether this entity reacts to damage being inflicted.

◆ CanBleed()

bool NSSurfacePropEntity::CanBleed ( void  )

Returns whether the entity can bleed.

◆ Damage()

void NSSurfacePropEntity::Damage ( entity  inflictor,
entity  attacker,
NSDict  damageDecl,
float  damageScale,
vector  dmgDir,
vector  hitLocation 
)
virtual

Applies damage to the entity.

Reimplemented in NSClientPlayer.

◆ DamageFeedback()

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

Called when a different entity gets damaged by this entity.

◆ Death()

void NSSurfacePropEntity::Death ( entity  inflictor,
entity  attacker,
int  damage,
vector  dir,
int  location 
)
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 invisible to other entity their aim-assists.

◆ DisableBleeding()

void NSSurfacePropEntity::DisableBleeding ( void  )

Marks the entity as incapable of bleeding.

◆ EnableAimAssist()

void NSSurfacePropEntity::EnableAimAssist ( void  )

Makes the entity visible to other entity their aim-assists.

◆ EnableBleeding()

void NSSurfacePropEntity::EnableBleeding ( void  )

Marks the entity as capable of bleeding.

◆ 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.

◆ 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.

◆ 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.

That is different from having health, as the entity may be a corpse that can be destroyed further.

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 ( entity  inflictor,
entity  attacker,
int  damage,
vector  dir,
int  location 
)
virtual

Called whenever the entity receives damage.

Reimplemented in NSBot, 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

◆ Save()

void NSSurfacePropEntity::Save ( float  handle)
virtual

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

Within you want to use the NSIO::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, NSActor, 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.

◆ 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.

◆ 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, monster_furniture, prop_dynamic, prop_physics, ambient_generic, 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: