Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Loading...
Searching...
No Matches
health.c
Go to the documentation of this file.
2{
3 private float m_LastHealthLevel;
4 private float m_LastBloodLevel;
5
6
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};
override bool DeactivateCondition(PlayerBase player)
Definition health.c:22
float m_LastBloodLevel
Definition health.c:4
override void OnTick(PlayerBase player, float deltaT)
Definition health.c:27
override void Init()
Definition health.c:7
override bool ActivateCondition(PlayerBase player)
Definition health.c:16
float m_LastHealthLevel
Definition health.c:3
Definition enmath.c:7
int m_ID
ID of effect, given by SEffectManager when registered (automatically done when playing through it).
Definition effect.c:51
eModifiers
Definition emodifiers.c:2
static proto int AbsInt(int i)
Returns absolute value.
bool m_TrackActivatedTime
overall time this modifier was active
void DisableDeactivateCheck()
float m_TickIntervalActive
float m_TickIntervalInactive
const int DEFAULT_TICK_TIME_INACTIVE
enum eModifierSyncIDs DEFAULT_TICK_TIME_ACTIVE