Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
healthnotfr.c
Go to the documentation of this file.
2 {
3  /*
4  private const float HEALTHY_BLOOD_TRESHOLD = 5000;
5  private const float HEALTHY_TRESHOLD = 5000;
6  private const float HEALING_ENERGY_TRESHOLD = 4000;
7  private const float HEALING_WATER_TRESHOLD = 2500;
8  private const float HEALING_BLOOD_TRESHOLD = 5000;
9  */
10  private const float DEC_TRESHOLD_LOW = 0;
11  private const float DEC_TRESHOLD_MED = -0.7;
12  private const float DEC_TRESHOLD_HIGH = -1.3;
13  private const float INC_TRESHOLD_LOW = 0;
14  private const float INC_TRESHOLD_MED = 0.7;
15  private const float INC_TRESHOLD_HIGH = 1.3;
16 
17 
18  void HealthNotfr(NotifiersManager manager)
19  {
20  m_TickInterval = 3000;
21  m_TendencyBufferSize = 6;
22  }
23 
24  override int GetNotifierType()
25  {
26  return eNotifiers.NTF_HEALTHY;
27  }
28 
29  override void DisplayBadge()
30  {
31  }
32 
33  override void DisplayTendency(float delta)
34  {
35  int tendency = CalculateTendency(delta, INC_TRESHOLD_LOW, INC_TRESHOLD_MED, INC_TRESHOLD_HIGH, DEC_TRESHOLD_LOW, DEC_TRESHOLD_MED, DEC_TRESHOLD_HIGH);
36  //PrintString("tendency:" + tendency);
37  //GetVirtualHud().SetStatus(eDisplayElements.DELM_TDCY_HEALTH,tendency);
38 
39  //DSLevels level = DetermineLevel( GetObservedValue(), PlayerConstants.THRESHOLD_HEALTH_WARNING, PlayerConstants.THRESHOLD_HEALTH_CRITICAL, PlayerConstants.THRESHOLD_HEALTH_BLINKING, PlayerConstants.THRESHOLD_HEALTH_EXTRA);
40 
41  EStatLevels health_level = m_Player.GetStatLevelHealth();
42  DisplayElementTendency dis_elm = DisplayElementTendency.Cast(GetVirtualHud().GetElement(eDisplayElements.DELM_TDCY_HEALTH));
43 
44  if( dis_elm )
45  {
46  dis_elm.SetSeriousnessLevel(health_level);
47  dis_elm.SetTendency(tendency);
48  }
49  }
50 
51  override void HideBadge()
52  {
53 
55  }
56 
57  override protected float GetObservedValue()
58  {
59  float health = m_Player.GetHealth("","Health");
60  //PrintString("health:" + health);
61  return health;
62  }
63 
64 
65 };
GetElement
DisplayElementBase GetElement(eDisplayElements element_id)
Definition: displaystatus.c:95
DisplayElementTendency
Definition: tendencybacteria.c:1
GetVirtualHud
VirtualHud GetVirtualHud()
Definition: notifiersmanager.c:77
NotifiersManager
void NotifiersManager(PlayerBase player)
Definition: notifiersmanager.c:36
HealthNotfr
Definition: healthnotfr.c:1
m_Player
DayZPlayer m_Player
Definition: hand_events.c:42
NotifierBase
Definition: notifierbase.c:1
eNotifiers
eNotifiers
Definition: notifiersmanager.c:1
EStatLevels
EStatLevels
Definition: estatlevels.c:1