Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
warmthnotfr.c
Go to the documentation of this file.
2 {
3  private const float DEC_TRESHOLD_LOW = 0;
4  private const float DEC_TRESHOLD_MED = -0.2;
5  private const float DEC_TRESHOLD_HIGH = -0.3;
6  private const float INC_TRESHOLD_LOW = 0;
7  private const float INC_TRESHOLD_MED = 0.2;
8  private const float INC_TRESHOLD_HIGH = 0.3;
9 
10  void WarmthNotfr(NotifiersManager manager)
11  {
12  m_TendencyBufferSize = 6;
13  }
14 
15  override int GetNotifierType()
16  {
17  return eNotifiers.NTF_WARMTH;
18  }
19 
20 
21  protected DSLevelsTemp DetermineLevel(float value, float m_warning_treshold, float m_critical_treshold, float m_empty_treshold, float p_warning_treshold, float p_critical_treshold, float p_empty_treshold )
22  {
23  DSLevelsTemp level = DSLevelsTemp.NORMAL;
24 
25  if(value < 0)
26  {
27  if(value < m_warning_treshold) level = DSLevelsTemp.WARNING_MINUS;
28  if(value < m_critical_treshold) level = DSLevelsTemp.CRITICAL_MINUS;
29  if(value <= m_empty_treshold) level = DSLevelsTemp.BLINKING_MINUS;
30  }
31  else
32  {
33  if(value > p_warning_treshold) level = DSLevelsTemp.WARNING_PLUS;
34  if(value > p_critical_treshold) level = DSLevelsTemp.CRITICAL_PLUS;
35  if(value >= p_empty_treshold) level = DSLevelsTemp.BLINKING_PLUS;
36  }
37 
38  return level;
39  }
40 
41  override void DisplayTendency(float delta)
42  {
43  int tendency = CalculateTendency(delta, INC_TRESHOLD_LOW, INC_TRESHOLD_MED, INC_TRESHOLD_HIGH, DEC_TRESHOLD_LOW, DEC_TRESHOLD_MED, DEC_TRESHOLD_HIGH);
44 
45  DSLevelsTemp level = DetermineLevel( GetObservedValue(), PlayerConstants.THRESHOLD_HEAT_COMFORT_MINUS_WARNING, PlayerConstants.THRESHOLD_HEAT_COMFORT_MINUS_CRITICAL, PlayerConstants.THRESHOLD_HEAT_COMFORT_MINUS_EMPTY, PlayerConstants.THRESHOLD_HEAT_COMFORT_PLUS_WARNING, PlayerConstants.THRESHOLD_HEAT_COMFORT_PLUS_CRITICAL, PlayerConstants.THRESHOLD_HEAT_COMFORT_PLUS_EMPTY );
46 
47  DisplayElementTendency dis_elm = DisplayElementTendency.Cast(GetVirtualHud().GetElement(eDisplayElements.DELM_TDCY_TEMPERATURE));
48 
49  if( dis_elm )
50  {
51  dis_elm.SetTendency(tendency);
52  dis_elm.SetSeriousnessLevel(level);
53  }
54  }
55 
56  override protected float GetObservedValue()
57  {
58  return m_Player.GetStatHeatComfort().Get();
59  }
60 };
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
PlayerConstants
Definition: playerconstants.c:1
m_Player
DayZPlayer m_Player
Definition: hand_events.c:42
NotifierBase
Definition: notifierbase.c:1
WarmthNotfr
Definition: warmthnotfr.c:1
eNotifiers
eNotifiers
Definition: notifiersmanager.c:1