Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
heartattack.c
Go to the documentation of this file.
2 {
3  private const float HEALTH_DECREMENT_PER_SEC = -0.2;
4  private const float SHOCK_DECREMENT_PER_SEC = -2;
5  private const float SHOCK_LIMIT = 0;
6 
7  override void Init()
8  {
9  m_TrackActivatedTime = false;
10  m_ID = eModifiers.MDF_HEART_ATTACK;
13  m_IsPersistent = true;
16  }
17  override bool ActivateCondition(PlayerBase player)
18  {
19  return false;
20  }
21 
22  override void OnActivate(PlayerBase player)
23  {
24  }
25 
26  override bool DeactivateCondition(PlayerBase player)
27  {
28  return false;
29  }
30 
31  override void OnTick(PlayerBase player, float deltaT)
32  {
33  if ( player.GetHealth("GlobalHealth","Shock") <= SHOCK_LIMIT )
34  {
35  float currenthealth = player.GetHealth("GlobalHealth", "Health");
36  player.AddHealth("GlobalHealth", "Health" , HEALTH_DECREMENT_PER_SEC * deltaT );
37  }
38  else
39  {
40  float currentshock = player.GetHealth("GlobalHealth", "Shock");
41  player.AddHealth("GlobalHealth", "Shock", SHOCK_DECREMENT_PER_SEC * deltaT);
42  }
43  }
44 };
m_TickIntervalActive
float m_TickIntervalActive
Definition: modifierbase.c:19
m_TrackActivatedTime
bool m_TrackActivatedTime
Definition: modifierbase.c:15
DisableDeactivateCheck
void DisableDeactivateCheck()
Definition: modifierbase.c:83
DEFAULT_TICK_TIME_ACTIVE
const int DEFAULT_TICK_TIME_ACTIVE
Definition: modifiersmanager.c:31
PlayerBase
Definition: playerbaseclient.c:1
HeartAttackMdfr
Definition: heartattack.c:1
m_TickIntervalInactive
float m_TickIntervalInactive
Definition: modifierbase.c:18
eModifiers
eModifiers
Definition: emodifiers.c:1
ModifierBase
Definition: breathvapourmdfr.c:3
m_IsPersistent
bool m_IsPersistent
Definition: modifierbase.c:16
DisableActivateCheck
void DisableActivateCheck()
Definition: modifierbase.c:78
m_ID
protected int m_ID
ID of effect, given by SEffectManager when registered (automatically done when playing through it)
Definition: effect.c:49
DEFAULT_TICK_TIME_INACTIVE
const int DEFAULT_TICK_TIME_INACTIVE
Definition: modifiersmanager.c:33