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

Go to the source code of this file.

Classes

class  AreaDamageOnce
 

Functions

override void SetDeferDuration (float time)
 
override void OnStayServerEvent (TriggerInsider insider, float deltaTime)
 
float CalculateDamageScale (TriggerInsider insider, float deltaTime)
 

Variables

AreaDamageOnce m_DeferDuration = 1.0
 Time the damage should be deferred in seconds.
 

Function Documentation

◆ CalculateDamageScale()

float CalculateDamageScale ( TriggerInsider insider,
float deltaTime )
protected

Definition at line 30 of file AreaDamageOnce.c.

31 {
32 if (m_DeferDuration > 0 && (insider.lastUpdated - insider.timeEntered) >= m_DeferDuration)
33 return super.CalculateDamageScale(insider, deltaTime);
34
35 return 0;
36 }
AreaDamageOnce m_DeferDuration
Time the damage should be deferred in seconds.
float lastUpdated
Last time the object was updated in seconds, is used for calculating deltaTime.
Definition Trigger.c:16
float timeEntered
Time the object was first seen in seconds.
Definition Trigger.c:13

References TriggerInsider::lastUpdated, m_DeferDuration, and TriggerInsider::timeEntered.

◆ OnStayServerEvent()

override void OnStayServerEvent ( TriggerInsider insider,
float deltaTime )

Definition at line 21 of file AreaDamageOnce.c.

22 {
23 super.OnStayServerEvent(insider, deltaTime);
24
26 if (CastTo(dInsider, insider) && dInsider.lastDamaged == 0)
27 OnEvaluateDamageEx(insider, 1);
28 }
bool OnEvaluateDamageEx(TriggerInsider insider, float deltaTime)
Extended TriggerInsider for AreaDamageTriggerBase.

References OnEvaluateDamageEx().

◆ SetDeferDuration()

override void SetDeferDuration ( float time)

Definition at line 16 of file AreaDamageOnce.c.

17 {
19 }

References m_DeferDuration.

Variable Documentation

◆ m_DeferDuration

AreaDamageOnce m_DeferDuration = 1.0

Time the damage should be deferred in seconds.

Referenced by CalculateDamageScale(), SetDeferDuration(), AreaDamageBase::SetDeferDuration(), and AreaDamageRegular::SetDeferDuration().