iPcDamage Struct Reference
This is a property class for damage emitting. More...
#include <propclass/damage.h>

Public Member Functions | |
| virtual void | AreaDamage (float radius)=0 |
| Do area damage. | |
| virtual void | BeamDamage (const csVector3 &direction, float maxdist)=0 |
| Do beam damage. | |
| virtual float | GetDamage () const =0 |
| Get the amount of damage. | |
| virtual const csVector3 & | GetDamagePosition () const =0 |
| Get the source position for the damage (only if explicitly set). | |
| virtual const char * | GetDamageSector () const =0 |
| Get the source sector for the damage (only if explicitly set). | |
| virtual const char * | GetDamageSource () const =0 |
| Get the source name for the damage. | |
| virtual const char * | GetDamageType () const =0 |
| Get the type of damage. | |
| virtual const char * | GetFallOff () const =0 |
| Get the damage falloff. | |
| virtual void | SetDamage (float amount)=0 |
| Set the amount of damage. | |
| virtual void | SetDamageLocation (const char *sectorname, const csVector3 &pos)=0 |
| Set the source location for the damage. | |
| virtual void | SetDamageSource (const char *source)=0 |
| Set the source name for the damage. | |
| virtual void | SetDamageType (const char *type)=0 |
| Set the type of damage. | |
| virtual void | SetFallOff (const char *f)=0 |
| Set the damage falloff ('constant', 'normal', or 'linear'). | |
| virtual void | SingleDamage (const char *target)=0 |
| Do single damage. | |
Detailed Description
This is a property class for damage emitting.
Attach this property class to entities that can cause damage to other entities. Causing damage is basically a matter of sending a message to the affected entities. The affecting entity will have to handle the damage in whatever way is appropriate.
This property class can send out the following messages:
- 'cel.damage.hurt' (old 'pcdamage_hurt'): damage has been done. Parameters: amount (float: amount of damage), source (string: name of source entity), sector (string: name of source sector), position (vector3: origin of damage), type (string: type of damage, application dependend).
This property class supports the following actions (add prefix 'cel.damage.action.' if you want to access this action through a message):
- AreaDamage: 'radius' (float: default very large). In case of 'normal' falloff this is actually ignored.
- BeamDamage: 'direction' (vector3), 'maxdist' (float: default very large). In case of 'normal' falloff the maxdist is ignored.
- SingleDamage: 'target' (string: name of target entity).
This property class supports the following properties:
- amount (float, read/write): amount of damage to do.
- type (string, read/write): application dependend type of damage to do.
- sector (string, read/write): optional sector where the damage originates. If not given this will be obtained from the optionally attached pcmesh.
- position (vector3, read/write): optional vector where the damage originates. If not given this will be obtained from the optionally attached pcmesh.
- falloff (string, read/write): one of 'constant', 'normal', 'linear'.
Definition at line 59 of file damage.h.
Member Function Documentation
| virtual void iPcDamage::AreaDamage | ( | float | radius | ) | [pure virtual] |
Do area damage.
| virtual void iPcDamage::BeamDamage | ( | const csVector3 & | direction, | |
| float | maxdist | |||
| ) | [pure virtual] |
Do beam damage.
| virtual float iPcDamage::GetDamage | ( | ) | const [pure virtual] |
Get the amount of damage.
| virtual const csVector3& iPcDamage::GetDamagePosition | ( | ) | const [pure virtual] |
Get the source position for the damage (only if explicitly set).
| virtual const char* iPcDamage::GetDamageSector | ( | ) | const [pure virtual] |
Get the source sector for the damage (only if explicitly set).
| virtual const char* iPcDamage::GetDamageSource | ( | ) | const [pure virtual] |
Get the source name for the damage.
| virtual const char* iPcDamage::GetDamageType | ( | ) | const [pure virtual] |
Get the type of damage.
| virtual const char* iPcDamage::GetFallOff | ( | ) | const [pure virtual] |
Get the damage falloff.
| virtual void iPcDamage::SetDamage | ( | float | amount | ) | [pure virtual] |
Set the amount of damage.
| virtual void iPcDamage::SetDamageLocation | ( | const char * | sectorname, | |
| const csVector3 & | pos | |||
| ) | [pure virtual] |
Set the source location for the damage.
If this is not given then this property class will try to find the attached pcmesh.
| virtual void iPcDamage::SetDamageSource | ( | const char * | source | ) | [pure virtual] |
Set the source name for the damage.
If not set it is sent as the name of the entity setting the damage.
| virtual void iPcDamage::SetDamageType | ( | const char * | type | ) | [pure virtual] |
Set the type of damage.
| virtual void iPcDamage::SetFallOff | ( | const char * | f | ) | [pure virtual] |
Set the damage falloff ('constant', 'normal', or 'linear').
'normal' is default.
| virtual void iPcDamage::SingleDamage | ( | const char * | target | ) | [pure virtual] |
Do single damage.
The documentation for this struct was generated from the following file:
- propclass/damage.h
Generated for CEL: Crystal Entity Layer 2.0 by doxygen 1.6.1
