Dayz Explorer 1.28.160049
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
7 override void Init()
8 {
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};
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
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