Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
thirstnotfr.c
Go to the documentation of this file.
2 {
3  private const float HYDRATED_TRESHOLD = 3500;
4  private const float THIRSTY_TRESHOLD = 2500;
5  private const float VERY_THIRSTY_TRESHOLD = 1500;
6  private const float FATALLY_THIRSTY_TRESHOLD = 0;
7  private const float DEC_TRESHOLD_LOW = 0;
8  private const float DEC_TRESHOLD_MED = -0.2;
9  private const float DEC_TRESHOLD_HIGH = -0.85;
10  private const float INC_TRESHOLD_LOW = 0;
11  private const float INC_TRESHOLD_MED = 0.2;
12  private const float INC_TRESHOLD_HIGH = 0.85;
13 
14  void ThirstNotfr(NotifiersManager manager)
15  {
16  }
17 
18  override int GetNotifierType()
19  {
20  return eNotifiers.NTF_THIRSTY;
21  }
22 
23 
24  override void DisplayTendency(float delta)
25  {
26  //PrintString(delta.ToString());
27  int tendency = CalculateTendency(delta, INC_TRESHOLD_LOW, INC_TRESHOLD_MED, INC_TRESHOLD_HIGH, DEC_TRESHOLD_LOW, DEC_TRESHOLD_MED, DEC_TRESHOLD_HIGH);
28  //GetVirtualHud().SetStatus(eDisplayElements.DELM_TDCY_WATER,tendency);
29 
30  //DSLevels level = DetermineLevel( GetObservedValue(), PlayerConstants.THRESHOLD_WATER_WARNING, PlayerConstants.THRESHOLD_WATER_CRITICAL, PlayerConstants.THRESHOLD_WATER_BLINKING, PlayerConstants.THRESHOLD_WATER_EXTRA);
31  EStatLevels water_level = m_Player.GetStatLevelWater();
32  DisplayElementTendency dis_elm = DisplayElementTendency.Cast(GetVirtualHud().GetElement(eDisplayElements.DELM_TDCY_WATER));
33 
34  if( dis_elm )
35  {
36  dis_elm.SetTendency(tendency);
37  dis_elm.SetSeriousnessLevel(water_level);
38 
39  }
40  }
41 
42  override void DisplayBadge()
43  {
44  float water = m_Player.GetStatWater().Get();
45  if (water >= HYDRATED_TRESHOLD)
46  {
47  //GetVirtualHud().SetStatus(eDisplayElements.DELM_NTFR_THIRST,DELM_LVL_1);
48  }
49  else if (water <= THIRSTY_TRESHOLD)
50  {
51  //GetVirtualHud().SetStatus(eDisplayElements.DELM_NTFR_THIRST,DELM_LVL_2);
52  }
53  else if (water <= VERY_THIRSTY_TRESHOLD)
54  {
55  //GetVirtualHud().SetStatus(eDisplayElements.DELM_NTFR_THIRST,DELM_LVL_3);
56  }
57  else if (water <= FATALLY_THIRSTY_TRESHOLD)
58  {
59  //GetVirtualHud().SetStatus(eDisplayElements.DELM_NTFR_THIRST,DELM_LVL_4);
60  }
61  }
62 
63  override void HideBadge()
64  {
65 
66  //GetVirtualHud().SetStatus(eDisplayElements.DELM_NTFR_THIRST,DELM_LVL_0);
67  }
68 
69  override protected float GetObservedValue()
70  {
71  return m_Player.GetStatWater().Get();
72  }
73 };
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
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
ThirstNotfr
Definition: thirstnotfr.c:1