Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
health.c
Go to the documentation of this file.
2 {
3  private float m_LastHealthLevel;
4  private float m_LastBloodLevel;
5 
6 
7  override void Init()
8  {
9  m_TrackActivatedTime = false;
10  m_ID = eModifiers.MDF_HEALTH;
14  }
15 
16  override bool ActivateCondition(PlayerBase player)
17  {
18  return true;
19  }
20 
21 
22  override bool DeactivateCondition(PlayerBase player)
23  {
24  return false;
25  }
26 
27  override void OnTick(PlayerBase player, float deltaT)
28  {
29 
30  float blood = player.GetHealth("GlobalHealth", "Blood");
31  float health = player.GetHealth("GlobalHealth", "Health");
32 
33  float healthdelta = Math.AbsInt(health - m_LastHealthLevel);
34  if (health < m_LastHealthLevel) healthdelta = -healthdelta;
35  //if( player.m_NotifiersManager ) player.m_NotifiersManager.FindNotifier(eNotifiers.NTF_LIVES).DisplayTendency(healthdelta);
36  m_LastHealthLevel = health;
37 
38  float blooddelta = Math.AbsInt(blood - m_LastBloodLevel);
39  if (blood < m_LastBloodLevel) blooddelta = -blooddelta;
40  //if( player.m_NotifiersManager ) player.m_NotifiersManager.FindNotifier(eNotifiers.NTF_BLOOD).DisplayTendency(blooddelta);
41  m_LastBloodLevel = blood;
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
m_TickIntervalInactive
float m_TickIntervalInactive
Definition: modifierbase.c:18
eModifiers
eModifiers
Definition: emodifiers.c:1
ModifierBase
Definition: breathvapourmdfr.c:3
Math
Definition: enmath.c:6
m_ID
protected int m_ID
ID of effect, given by SEffectManager when registered (automatically done when playing through it)
Definition: effect.c:49
HealthMdfr
Definition: health.c:1
DEFAULT_TICK_TIME_INACTIVE
const int DEFAULT_TICK_TIME_INACTIVE
Definition: modifiersmanager.c:33