DayZ 1.24
Loading...
Searching...
No Matches
AreaDamageComponent.c File Reference

Go to the source code of this file.

Classes

class  AreaDamageComponentData
 

Functions

ref array< typename > m_DamageableTypes void AreaDamageComponent (AreaDamageManager parent)
 
override bool OnEvaluateDamage (TriggerInsider insider, float damageCoef)
 
override void PreDamageActions ()
 
override void PostDamageActions ()
 
bool ShouldDamage (Object object)
 
AreaDamageComponentData GetAreaDamageComponentData (Object object)
 
bool EvaluateDamageInternal (TriggerInsider insider, float damageCoef)
 

Variables

class AreaDamageComponentData m_Parent
 
int m_DamageType
 
string m_AmmoName
 

Function Documentation

◆ AreaDamageComponent()

ref array< typename > m_DamageableTypes void AreaDamageComponent ( AreaDamageManager parent)

Definition at line 16 of file AreaDamageComponent.c.

17 {
18 m_Parent = parent;
19
21 m_AmmoName = "MeleeDamage";
22
25 }
string m_AmmoName
int m_DamageType
class AreaDamageComponentData m_Parent

References m_AmmoName, m_DamageType, and m_Parent.

Referenced by AreaDamageManager(), and SetDamageComponentType().

◆ EvaluateDamageInternal()

bool EvaluateDamageInternal ( TriggerInsider insider,
float damageCoef )
private

Definition at line 56 of file AreaDamageComponent.c.

57 {
59
61 if (CastTo(dInsider, insider))
62 dInsider.lastDamaged = g_Game.GetTickTime();
63
64 Object object = insider.GetObject();
65
67 object.ProcessDirectDamage(m_DamageType, m_Parent.GetParentObject(), data.Hitzone, m_AmmoName, data.Modelpos, damageCoef);
68
70
71 return true;
72 }
AreaDamageComponentData GetAreaDamageComponentData(Object object)
override void PostDamageActions()
override void PreDamageActions()
DayZGame g_Game
Definition DayZGame.c:3528
Extended TriggerInsider for AreaDamageTriggerBase.
Object GetObject()
Definition Trigger.c:28

References g_Game, GetAreaDamageComponentData(), TriggerInsider::GetObject(), m_AmmoName, m_DamageType, m_Parent, PostDamageActions(), and PreDamageActions().

Referenced by OnEvaluateDamage().

◆ GetAreaDamageComponentData()

AreaDamageComponentData GetAreaDamageComponentData ( Object object)
protected

Definition at line 51 of file AreaDamageComponent.c.

52 {
53 return new AreaDamageComponentData;
54 }

Referenced by EvaluateDamageInternal().

◆ OnEvaluateDamage()

override bool OnEvaluateDamage ( TriggerInsider insider,
float damageCoef )

Definition at line 27 of file AreaDamageComponent.c.

28 {
29 // No need to damage if the coef is 0!
30 if (ShouldDamage(insider.GetObject()) && damageCoef > 0)
31 return EvaluateDamageInternal(insider, damageCoef);
32
33 return false;
34 }
bool ShouldDamage(Object object)
bool EvaluateDamageInternal(TriggerInsider insider, float damageCoef)

References EvaluateDamageInternal(), TriggerInsider::GetObject(), and ShouldDamage().

◆ PostDamageActions()

override void PostDamageActions ( )

Definition at line 41 of file AreaDamageComponent.c.

42 {
43 m_Parent.PostDamageActions();
44 }

References m_Parent.

◆ PreDamageActions()

override void PreDamageActions ( )

Definition at line 36 of file AreaDamageComponent.c.

37 {
38 m_Parent.PreDamageActions();
39 }

References m_Parent.

◆ ShouldDamage()

bool ShouldDamage ( Object object)
protected

Definition at line 46 of file AreaDamageComponent.c.

47 {
48 return object && object.IsAlive() && object.IsAnyInherited(m_DamageableTypes);
49 }

Referenced by OnEvaluateDamage().

Variable Documentation

◆ m_AmmoName

string m_AmmoName

Definition at line 12 of file AreaDamageComponent.c.

Referenced by AreaDamageComponent(), and EvaluateDamageInternal().

◆ m_DamageType

int m_DamageType

Definition at line 11 of file AreaDamageComponent.c.

Referenced by AreaDamageComponent(), and EvaluateDamageInternal().

◆ m_Parent