DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
Loading...
Searching...
No Matches
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
11 {
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 {
44
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};
DisplayElementBase GetElement(eDisplayElements element_id)
void NotifiersManager(PlayerBase player)
eNotifiers
protected int CalculateTendency(float delta, float inctresholdlow, float inctresholdmed, float inctresholdhigh, float dectresholdlow, float dectresholdmed, float dectresholdhigh)
PlayerBase m_Player
Definition NotifierBase.c:6
VirtualHud GetVirtualHud()
int m_TendencyBufferSize
Definition NotifierBase.c:9
static const float THRESHOLD_HEAT_COMFORT_MINUS_WARNING
static const float THRESHOLD_HEAT_COMFORT_PLUS_WARNING
static const float THRESHOLD_HEAT_COMFORT_PLUS_EMPTY
static const float THRESHOLD_HEAT_COMFORT_MINUS_CRITICAL
static const float THRESHOLD_HEAT_COMFORT_MINUS_EMPTY
static const float THRESHOLD_HEAT_COMFORT_PLUS_CRITICAL
private const float DEC_TRESHOLD_LOW
Definition WarmthNotfr.c:3
void WarmthNotfr(NotifiersManager manager)
Definition WarmthNotfr.c:10
private const float DEC_TRESHOLD_HIGH
Definition WarmthNotfr.c:5
override protected float GetObservedValue()
Definition WarmthNotfr.c:56
private const float INC_TRESHOLD_LOW
Definition WarmthNotfr.c:6
private const float INC_TRESHOLD_MED
Definition WarmthNotfr.c:7
override void DisplayTendency(float delta)
Definition WarmthNotfr.c:41
private const float INC_TRESHOLD_HIGH
Definition WarmthNotfr.c:8
private const float DEC_TRESHOLD_MED
Definition WarmthNotfr.c:4
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)
Definition WarmthNotfr.c:21
override int GetNotifierType()
Definition WarmthNotfr.c:15