DayZ 1.28
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
HeatComfortAnimHandler.c
См. документацию.
2{
3 const float TICK_INTERVAL = 2;
8
12 float m_EventTimeHot = -1;
14
17
20
22 {
23 m_Player = player;
24 }
25
26 void Update(float delta_time, HumanMovementState hms)
27 {
28 m_TimeSinceLastTick += delta_time;
29
31 {
34 }
35 }
36
37 float GetEventTime(float hc_value, float threshold_low, float threshold_high, float low_min, float high_min, float low_max, float high_max)
38 {
39 float inv_value = Math.InverseLerp(threshold_low, threshold_high, hc_value);
40 float value_min = Math.Lerp(low_min, high_min, inv_value);
41 float value_max = Math.Lerp(low_max, high_max, inv_value);
42
43 return Math.RandomFloatInclusive(value_min, value_max);
44 }
45
46
47 void Process(float delta_time)
48 {
49 if( GetGame().IsServer() )
50 {
51 float hc = m_Player.GetStatHeatComfort().Get();
52
53 if ( hc <= PlayerConstants.THRESHOLD_HEAT_COMFORT_MINUS_CRITICAL ) // Deep blue zone, rattling sounds are layerd on top of freezing sounds
54 {
56
59
61 {
64 m_Player.GetSymptomManager().QueueUpPrimarySymptom(SymptomIDs.SYMPTOM_FREEZE_RATTLE);
65 }
66 }
67
68 if ( hc <= PlayerConstants.THRESHOLD_HEAT_COMFORT_MINUS_WARNING ) // Light blue zone
69 {
71
72 if(m_EventTimeFreeze < 0) //if not set
73 {
75 }
76
78 {
81 m_Player.GetSymptomManager().QueueUpPrimarySymptom(SymptomIDs.SYMPTOM_FREEZE);
82 }
83 }
84 else if ( hc >= PlayerConstants.THRESHOLD_HEAT_COMFORT_PLUS_WARNING ) // Yellow zone
85 {
87
88 if(m_EventTimeHot < 0) //if not set
89 {
91 }
92
94 {
96 m_EventTimeHot = -1;
97 m_Player.GetSymptomManager().QueueUpPrimarySymptom(SymptomIDs.SYMPTOM_HOT);
98 }
99 }
100 }
101 }
102}
void Process()
Определения EffectManager.c:743
float m_ProcessTimeAccuHot
Определения HeatComfortAnimHandler.c:7
void Update(float delta_time, HumanMovementState hms)
Определения HeatComfortAnimHandler.c:26
ref HumanMovementState m_MovementState
Определения HeatComfortAnimHandler.c:13
float m_ProcessTimeAccuFreeze
Определения HeatComfortAnimHandler.c:5
float m_ProcessTimeAccuFreezeRattle
Определения HeatComfortAnimHandler.c:6
float m_EventTimeFreeze
Определения HeatComfortAnimHandler.c:10
void Process(float delta_time)
Определения HeatComfortAnimHandler.c:47
const float TIME_INTERVAL_HC_MINUS_HIGH_MAX
Определения HeatComfortAnimHandler.c:16
float m_TimeSinceLastTick
Определения HeatComfortAnimHandler.c:4
const float TIME_INTERVAL_HC_PLUS_HIGH_MIN
Определения HeatComfortAnimHandler.c:19
const float TIME_INTERVAL_HC_MINUS_LOW_MIN
Определения HeatComfortAnimHandler.c:15
const float TIME_INTERVAL_HC_PLUS_LOW_MAX
Определения HeatComfortAnimHandler.c:18
float GetEventTime(float hc_value, float threshold_low, float threshold_high, float low_min, float high_min, float low_max, float high_max)
Определения HeatComfortAnimHandler.c:37
const float TIME_INTERVAL_HC_PLUS_LOW_MIN
Определения HeatComfortAnimHandler.c:18
const float TIME_INTERVAL_HC_MINUS_HIGH_MIN
Определения HeatComfortAnimHandler.c:16
const float TIME_INTERVAL_HC_MINUS_LOW_MAX
Определения HeatComfortAnimHandler.c:15
void HeatComfortAnimHandler(PlayerBase player)
Определения HeatComfortAnimHandler.c:21
const float TIME_INTERVAL_HC_PLUS_HIGH_MAX
Определения HeatComfortAnimHandler.c:19
const float TICK_INTERVAL
Определения HeatComfortAnimHandler.c:3
PlayerBase m_Player
Определения HeatComfortAnimHandler.c:9
float m_EventTimeFreezeRattle
Определения HeatComfortAnimHandler.c:11
Определения human.c:1152
Определения EnMath.c:7
Определения PlayerBaseClient.c:2
static const float THRESHOLD_HEAT_COMFORT_MINUS_WARNING
Определения PlayerConstants.c:92
static const float THRESHOLD_HEAT_COMFORT_PLUS_WARNING
Определения PlayerConstants.c:88
static const float THRESHOLD_HEAT_COMFORT_MINUS_CRITICAL
Определения PlayerConstants.c:93
static const float THRESHOLD_HEAT_COMFORT_PLUS_EMPTY
Определения PlayerConstants.c:90
static const float THRESHOLD_HEAT_COMFORT_MINUS_EMPTY
Определения PlayerConstants.c:94
Определения PlayerConstants.c:2
proto native CGame GetGame()
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.
static float RandomFloatInclusive(float min, float max)
Returns a random float number between and min [inclusive] and max [inclusive].
Определения EnMath.c:106
static proto float InverseLerp(float a, float b, float value)
Calculates the linear value that produces the interpolant value within the range [a,...