Loading...
Searching...
No Matches
AdventureCore.DamageEffect Class Reference

Detailed Description

effect that repeatedly damages the character while active

https://adventure.softleitner.com/manual/effect

Inheritance diagram for AdventureCore.DamageEffect:
AdventureCore.GenericEffect AdventureCore.IDamageSender AdventureCore.EffectBase AdventureCore.ICharacterAssociator AdventureCore.ICharacterAssociator

Public Member Functions

virtual Vector3 GetPosition ()
 position of the receiver, may be used to determine damage direction
 
virtual Vector3 GetDirection (IDamageReceiver receiver)
 calculates direction of damage between this sender and a receiver
 
bool PreDamage (IDamageReceiver receiver)
 called before any real damage handling to check if the handling is valid and should continue
for example if a character is currently dodging damage handling can be cancelled here
 
void OnDamage (DamageEvent e)
 this is where the main damage handling should take place and damage vectors are assigned
OnDamage is called in the order Sender > Receiver > Damage
for example if a character is wearing protective gear it may reduce the damage value here
this method is called for every damage parameter see DamageEvent for more details
 
void PostDamage (IDamageReceiver receiver, List< DamageEvent > events)
 called after alle the damages have been applied
this is a good spot to react to the change of state that has been done by the damages
for example death or destruction if health was reduced to 0 by the damages
 
override string GetValue ()
 
override void SetValue (string data)
 
- Public Member Functions inherited from AdventureCore.EffectBase
void Terminate ()
 
virtual void Add (EffectBase prefab)
 
override string ToString ()
 

Public Attributes

float Interval
 
DamageParameter[] Damages
 
- Public Attributes inherited from AdventureCore.GenericEffect
CharacterInstructionBase[] Instructions
 
- Public Attributes inherited from AdventureCore.EffectBase
EffectType Type
 

Additional Inherited Members

- Protected Member Functions inherited from AdventureCore.GenericEffect
virtual void Start ()
 
virtual void OnDestroy ()
 
- Properties inherited from AdventureCore.EffectBase
EffectPool Pool [get, set]
 
bool IsExternal [get, set]
 
CharacterBase AssociatedCharacter [get]
 character that owns or is otherwise associted with the object
 
- Properties inherited from AdventureCore.ICharacterAssociator
- Properties inherited from AdventureCore.IDamageSender

Member Function Documentation

◆ GetDirection()

virtual Vector3 AdventureCore.DamageEffect.GetDirection ( IDamageReceiver receiver)
virtual

calculates direction of damage between this sender and a receiver

Parameters
receiver
Returns

Implements AdventureCore.IDamageSender.

◆ GetPosition()

virtual Vector3 AdventureCore.DamageEffect.GetPosition ( )
virtual

position of the receiver, may be used to determine damage direction

Returns
position of the receiver, or the character associated with it

Implements AdventureCore.IDamageSender.

◆ GetValue()

override string AdventureCore.DamageEffect.GetValue ( )
virtual

Reimplemented from AdventureCore.EffectBase.

◆ OnDamage()

void AdventureCore.DamageEffect.OnDamage ( DamageEvent e)
inline

this is where the main damage handling should take place and damage vectors are assigned
OnDamage is called in the order Sender > Receiver > Damage
for example if a character is wearing protective gear it may reduce the damage value here
this method is called for every damage parameter see DamageEvent for more details

Parameters
e

Implements AdventureCore.IDamageSender.

◆ PostDamage()

void AdventureCore.DamageEffect.PostDamage ( IDamageReceiver receiver,
List< DamageEvent > events )
inline

called after alle the damages have been applied
this is a good spot to react to the change of state that has been done by the damages
for example death or destruction if health was reduced to 0 by the damages

Parameters
sender
events

Implements AdventureCore.IDamageSender.

◆ PreDamage()

bool AdventureCore.DamageEffect.PreDamage ( IDamageReceiver receiver)

called before any real damage handling to check if the handling is valid and should continue
for example if a character is currently dodging damage handling can be cancelled here

Parameters
receiver
Returns
whether the damage handling should continue

Implements AdventureCore.IDamageSender.

◆ SetValue()

override void AdventureCore.DamageEffect.SetValue ( string data)
virtual

Reimplemented from AdventureCore.EffectBase.