Nuclide
Software Development Kit for id Technology (BETA)
All Classes Functions Variables Typedefs Enumerations Enumerator Modules Pages
ncSurfacePropEntity Class Reference

About this class

This entity represents an ncRenderableEntity with interactive surface properties.

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

Inheritance diagram for ncSurfacePropEntity:
ncRenderableEntity button_target cycler func_breakable func_guntarget func_rot_button ncActor ncAttack ncMoverEntity ncPhysicsEntity ncRagdoll ncVehicle prop_dynamic

Public Member Functions

void ncSurfacePropEntity (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 ncIO::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, ncDict, 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, 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 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 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 void SetMaxArmor (float)
 Sets the maximum amount of armor the entity can have. More...
 
nonvirtual float GetMaxArmor (void)
 Returns the maximum armor value the entity can have. More...
 
nonvirtual float GetSpawnHealth (void)
 Returns the health the entity spawned with at map load. 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...
 
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 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...
 
virtual void RenderFire (void)
 Called every frame to render a fire effect, but will only do so if the entity is burning. More...
 

Constructor & Destructor Documentation

◆ ncSurfacePropEntity()

void ncSurfacePropEntity::ncSurfacePropEntity ( void  )

Member Function Documentation

◆ BreakModel()

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

Called when the health is equal or below 0.

◆ CanBeDamaged()

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

Returns whether this entity reacts to damage being inflicted.

◆ CanBleed()

bool ncSurfacePropEntity::CanBleed ( void  )

Returns whether the entity can bleed.

◆ Damage()

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

Applies damage to the entity.

Reimplemented in ncPlayer.

◆ DamageFeedback()

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

Called when a different entity gets damaged by this entity.

◆ Death()

void ncSurfacePropEntity::Death ( entity  inflictor,
entity  attacker,
int  damage,
vector  dir,
vector  absImpactPos,
int  hitBody 
)
virtual

Called when the health is equal or below 0.

Reimplemented in func_breakable, func_guntarget, func_rot_button, ncPlayer, ncMonster, ncPhysicsEntity, and ncProjectile.

◆ DisableAimAssist()

void ncSurfacePropEntity::DisableAimAssist ( void  )

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

◆ DisableBleeding()

void ncSurfacePropEntity::DisableBleeding ( void  )

Marks the entity as incapable of bleeding.

◆ EnableAimAssist()

void ncSurfacePropEntity::EnableAimAssist ( void  )

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

◆ EnableBleeding()

void ncSurfacePropEntity::EnableBleeding ( void  )

Marks the entity as capable of bleeding.

◆ EvaluateEntity()

void ncSurfacePropEntity::EvaluateEntity ( void  )
virtual

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

Reimplemented from ncRenderableEntity.

Reimplemented in func_tracktrain, ambient_generic, func_tankmortar, func_vehicle, prop_vehicle_driveable, speaker, ncPlayer, ncSpectator, ncItem, ncMonster, ncPhysicsEntity, ncProjectile, ncRagdoll, ncVehicle, and ncWeapon.

◆ Extinguish()

void ncSurfacePropEntity::Extinguish ( void  )

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

◆ GetArmor()

float ncSurfacePropEntity::GetArmor ( void  )

Returns the current armor of the entity.

◆ GetBloodColor()

vector ncSurfacePropEntity::GetBloodColor ( void  )

Returns the blood color of this entity.

◆ GetHealth()

float ncSurfacePropEntity::GetHealth ( void  )

Returns the current health of the entity.

◆ GetMaxArmor()

float ncSurfacePropEntity::GetMaxArmor ( void  )

Returns the maximum armor value the entity can have.

◆ GetMaxHealth()

float ncSurfacePropEntity::GetMaxHealth ( void  )

Returns the maximum health the entity can have.

◆ GetPropData()

__variant ncSurfacePropEntity::GetPropData ( int  type)

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

◆ GetSpawnHealth()

float ncSurfacePropEntity::GetSpawnHealth ( void  )

Returns the health the entity spawned with at map load.

◆ GetSurfaceData()

__variant ncSurfacePropEntity::GetSurfaceData ( int  type)

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

◆ HasPropData()

bool ncSurfacePropEntity::HasPropData ( void  )

Returns if the entity has prop data information set.

◆ HasSurfaceData()

bool ncSurfacePropEntity::HasSurfaceData ( void  )

Returns if the entity has surface data information set.

◆ Ignite()

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

Sets the entity on fire.

◆ Input()

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

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

Reimplemented from ncRenderableEntity.

Reimplemented in func_door, func_door_rotating, func_guntarget, func_plat, func_tracktrain, ambient_generic, ncPlayer, ncItem, ncMonster, and ncActor.

◆ IsAlive()

bool ncSurfacePropEntity::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 ncMonster.

◆ IsOnFire()

bool ncSurfacePropEntity::IsOnFire ( void  )

Returns whether or not this entity is on fire.

◆ IsVulnerable()

bool ncSurfacePropEntity::IsVulnerable ( void  )

Returns whether the entity can be damaged.

◆ MakeInvulnerable()

void ncSurfacePropEntity::MakeInvulnerable ( void  )

Makes the entity invulnerable if it wasn't already.

◆ MakeVulnerable()

void ncSurfacePropEntity::MakeVulnerable ( void  )

Makes the entity vulnerable if it wasn't already.

◆ Pain()

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

Called whenever the entity receives damage.

Reimplemented in ncBot, cycler, func_breakable, ncMonster, ncPhysicsEntity, and ncProjectile.

◆ ParentUpdate()

void ncSurfacePropEntity::ParentUpdate ( void  )
virtual

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

Reimplemented from ncEntity.

◆ predraw()

virtual float ncSurfacePropEntity::predraw ( void  )
virtual

◆ ReceiveEntity()

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

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

Reimplemented from ncRenderableEntity.

Reimplemented in func_tracktrain, ambient_generic, func_tankmortar, func_vehicle, prop_vehicle_driveable, speaker, ncPlayer, ncSpectator, ncItem, ncMonster, ncPhysicsEntity, ncProjectile, ncRagdoll, ncTalkMonster, ncVehicle, and ncWeapon.

◆ RenderFire()

virtual void ncSurfacePropEntity::RenderFire ( void  )
virtual

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

◆ Respawn()

void ncSurfacePropEntity::Respawn ( void  )
virtual

◆ Restore()

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

◆ Save()

void ncSurfacePropEntity::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 ncRenderableEntity.

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, func_vehicle, speaker, ncAttack, ncClient, ncPlayer, ncSpectator, ncItem, ncMonster, ncMoverEntity, ncActor, ncPhysicsEntity, ncProjectile, ncSquadMonster, ncTalkMonster, ncVehicle, and ncWeapon.

◆ SendEntity()

float ncSurfacePropEntity::SendEntity ( entity  ,
float   
)
virtual

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

Reimplemented from ncRenderableEntity.

Reimplemented in func_tracktrain, ambient_generic, func_tankmortar, func_vehicle, prop_vehicle_driveable, speaker, ncPlayer, ncSpectator, ncItem, ncMonster, ncPhysicsEntity, ncProjectile, ncRagdoll, ncTalkMonster, ncVehicle, and ncWeapon.

◆ SetArmor()

void ncSurfacePropEntity::SetArmor ( float  new_armor)

Sets the current armor of the entity.

◆ SetBloodColor()

void ncSurfacePropEntity::SetBloodColor ( vector  newColor)

Sets the colour of the blood of this entity.

◆ SetHealth()

void ncSurfacePropEntity::SetHealth ( float  new_health)

Sets the current health of the entity.

◆ SetMaxArmor()

void ncSurfacePropEntity::SetMaxArmor ( float  new_armor)

Sets the maximum amount of armor the entity can have.

◆ SetMaxHealth()

void ncSurfacePropEntity::SetMaxHealth ( float  new_health)

Sets the maximum amount of health the entity can have.

◆ SetModel()

void ncSurfacePropEntity::SetModel ( string  newModel)
virtual

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

Reimplemented from ncEntity.

Reimplemented in ncPhysicsEntity.

◆ SetPropData()

void ncSurfacePropEntity::SetPropData ( string  type)

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

◆ SetSurfaceData()

void ncSurfacePropEntity::SetSurfaceData ( string  type)

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

◆ Spawned()

void ncSurfacePropEntity::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 ncEntity.

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, func_vehicle, prop_vehicle_driveable, speaker, ncAttack, ncPlayer, ncItem, ncMonster, ncActor, ncPhysicsEntity, ncProjectile, ncSquadMonster, and ncWeapon.

◆ SpawnKey()

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

◆ TimeSinceDeath()

float ncSurfacePropEntity::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: