Nuclide
Software Development Kit for id Technology (BETA)
Loading...
Searching...
No Matches
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 ncBreakableBrush ncMoverEntity ncPhysicsEntity ncRagdoll ncVehicle prop_dynamic

Public Member Functions

void ncSurfacePropEntity (void)
 
virtual void Spawned (void)
 Called when the entity is fulled initialized.
 
virtual void SetModel (string)
 Sets the 3D model representation of the entity from a file path and name.
 
virtual void Save (float)
 Handles saving a copy of this entity to a given filehandle.
 
virtual void Restore (string, string)
 Similar to ncIO::SpawnKey() but for save-game fields.
 
virtual void RestoreComplete (void)
 Called when the entity has been successfully restored from a savegame file.
 
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.
 
virtual void Input (entity, string, string)
 Called when we are being prompted by another object/function with an input message.
 
virtual void SpawnKey (string, string)
 This method handles entity key/value pairs on map load.
 
virtual void ParentUpdate (void)
 Called when we need to re-align the entity to our parent entity.
 
virtual void EvaluateEntity (void)
 Run each tic after physics are run to determine if we need to send updates over the network.
 
virtual float SendEntity (entity, float)
 Called by the engine whenever we need to send a client an update about this entity.
 
virtual float predraw (void)
 
virtual void ReceiveEntity (float, float)
 Client: Handles network updates from the server for the associated entity.
 
nonvirtual bool IsOnFire (void)
 Returns whether or not this entity is on fire.
 
virtual void Damage (entity, entity, ncDict, float, vector, vector)
 Applies damage to the entity.
 
virtual void DamageFeedback (entity, entity, int)
 Called when a different entity gets damaged by this entity.
 
virtual void Pain (entity, entity, int, vector, vector, int)
 Called whenever the entity receives damage.
 
virtual void Death (entity, entity, int, vector, vector, int)
 Called when the health is equal or below 0.
 
virtual void BreakModel (int, vector, int)
 Called when the health is equal or below 0.
 
virtual bool IsAlive (void)
 Returns whether or not the entity is alive.
 
nonvirtual void Ignite (entity, float, string)
 Sets the entity on fire.
 
nonvirtual void Extinguish (void)
 If the entity is on fire, it'll have it extinguished.
 
nonvirtual bool IsVulnerable (void)
 Returns whether the entity can be damaged.
 
nonvirtual void EnableAimAssist (void)
 Makes the entity visible to other entity their aim-assists.
 
nonvirtual void DisableAimAssist (void)
 Makes the entity invisible to other entity their aim-assists.
 
nonvirtual void MakeVulnerable (void)
 Makes the entity vulnerable if it wasn't already.
 
nonvirtual void MakeInvulnerable (void)
 Makes the entity invulnerable if it wasn't already.
 
nonvirtual void SetHealth (float)
 Sets the current health of the entity.
 
nonvirtual void SetMaxHealth (float)
 Sets the maximum amount of health the entity can have.
 
nonvirtual float GetHealth (void)
 Returns the current health of the entity.
 
nonvirtual float GetMaxHealth (void)
 Returns the maximum health the entity can have.
 
nonvirtual void AddBonusHealth (float)
 Adds bonus health to the entity.
 
nonvirtual float GetBonusHealth (void)
 Returns the bonus health of the entity.
 
nonvirtual void AddBonusArmor (float)
 Adds bonus armor to the entity.
 
nonvirtual float GetBonusArmor (void)
 Returns the bonus armor of the entity.
 
nonvirtual void SetArmor (float)
 Sets the current armor of the entity.
 
nonvirtual float GetArmor (void)
 Returns the current armor of the entity.
 
nonvirtual void SetMaxArmor (float)
 Sets the maximum amount of armor the entity can have.
 
nonvirtual float GetMaxArmor (void)
 Returns the maximum armor value the entity can have.
 
nonvirtual float TimeSinceDeath (void)
 Returns how many seconds have passed since we died.
 
nonvirtual bool CanBeDamaged (vector, vector)
 Returns whether this entity reacts to damage being inflicted.
 
nonvirtual void SetSurfaceData (string)
 Assigns the surface data of a given description onto this entity.
 
nonvirtual void SetPropData (string)
 Assigns the prop data of a given description onto this entity.
 
nonvirtual bool HasPropData (void)
 Returns if the entity has prop data information set.
 
nonvirtual __variant GetPropData (int)
 Returns a variable type of information about the entity's prop data.
 
nonvirtual bool HasSurfaceData (void)
 Returns if the entity has surface data information set.
 
nonvirtual __variant GetSurfaceData (int)
 Returns a variable type of information about the entity's surface data.
 
virtual void RenderFire (void)
 Called every frame to render a fire effect, but will only do so if the entity is burning.
 

Constructor & Destructor Documentation

◆ ncSurfacePropEntity()

void ncSurfacePropEntity::ncSurfacePropEntity ( void )

Member Function Documentation

◆ AddBonusArmor()

void ncSurfacePropEntity::AddBonusArmor ( float bonusArmor)

Adds bonus armor to the entity.

That's the amount of armor it's allowed to go over max_armor. It'll decrease over time by itself and affect max_armor in the meantime. Maximum is 100.

◆ AddBonusHealth()

void ncSurfacePropEntity::AddBonusHealth ( float bonusHealth)

Adds bonus health to the entity.

That's the amount of health it's allowed to go over max_health. It'll decrease over time by itself and affect max_health in the meantime. Maximum is 100.

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

◆ 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, ncActor, ncMonster, ncPhysicsEntity, ncPlayer, and ncProjectile.

◆ DisableAimAssist()

void ncSurfacePropEntity::DisableAimAssist ( void )

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

◆ EnableAimAssist()

void ncSurfacePropEntity::EnableAimAssist ( void )

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

◆ 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 ambient_generic, func_tankmortar, func_tracktrain, func_vehicle, ncItem, ncMonster, ncPhysicsEntity, ncPlayer, ncProjectile, ncRagdoll, ncSpectator, ncVehicle, ncWeapon, prop_vehicle_driveable, and speaker.

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

◆ GetBonusArmor()

float ncSurfacePropEntity::GetBonusArmor ( void )

Returns the bonus armor of the entity.

That is the amount of armor above max_armor.

◆ GetBonusHealth()

float ncSurfacePropEntity::GetBonusHealth ( void )

Returns the bonus health of the entity.

That is the amount of health above max_health.

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

◆ 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 burnTime,
string weaponDef )

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 ambient_generic, func_door, func_door_rotating, func_guntarget, func_plat, func_tracktrain, ncActor, ncItem, ncMonster, ncPlayer, ncProjectile, ncSquadMonster, and ncTalkMonster.

◆ 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 cycler, func_breakable, ncBot, ncBreakableBrush, 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 ambient_generic, func_tankmortar, func_tracktrain, func_vehicle, ncItem, ncMonster, ncPhysicsEntity, ncPlayer, ncProjectile, ncRagdoll, ncSpectator, ncTalkMonster, ncVehicle, ncWeapon, prop_vehicle_driveable, and speaker.

◆ 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()

◆ Restore()

void ncSurfacePropEntity::Restore ( string keyName,
string setValue )
virtual

◆ RestoreComplete()

void ncSurfacePropEntity::RestoreComplete ( void )
virtual

Called when the entity has been successfully restored from a savegame file.

Reimplemented from ncIO.

Reimplemented in ncActor, and ncWeapon.

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

◆ 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 ambient_generic, func_tankmortar, func_tracktrain, func_vehicle, ncItem, ncMonster, ncPhysicsEntity, ncPlayer, ncProjectile, ncRagdoll, ncSpectator, ncTalkMonster, ncVehicle, ncWeapon, prop_vehicle_driveable, and speaker.

◆ SetArmor()

void ncSurfacePropEntity::SetArmor ( float new_armor)

Sets the current armor of the 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 ambient_generic, func_breakable, func_button, func_door, func_door_rotating, func_guntarget, func_plat, func_pushable, func_tankmortar, func_trackchange, func_tracktrain, func_vehicle, ncActor, ncBreakableBrush, ncClient, ncItem, ncMonster, ncPhysicsEntity, ncPlayer, ncProjectile, ncSquadMonster, ncWeapon, prop_static, prop_vehicle_driveable, and speaker.

◆ SpawnKey()

void ncSurfacePropEntity::SpawnKey ( string keyName,
string setValue )
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: