DayZ 1.24
Loading...
Searching...
No Matches
HeatComfortAnimHandler Class Reference
Collaboration diagram for HeatComfortAnimHandler:
[legend]

Protected Member Functions

void HeatComfortAnimHandler (PlayerBase player)
 
void Update (float delta_time, HumanMovementState hms)
 
float GetEventTime (float hc_value, float threshold_low, float threshold_high, float low_min, float high_min, float low_max, float high_max)
 
void Process (float delta_time)
 

Protected Attributes

ref HumanMovementState m_MovementState = new HumanMovementState()
 
const float TIME_INTERVAL_HC_MINUS_LOW_MIN = 5
 
const float TIME_INTERVAL_HC_MINUS_LOW_MAX = 12
 
const float TIME_INTERVAL_HC_MINUS_HIGH_MIN = 15
 
const float TIME_INTERVAL_HC_MINUS_HIGH_MAX = 25
 
const float TIME_INTERVAL_HC_PLUS_LOW_MIN = 5
 
const float TIME_INTERVAL_HC_PLUS_LOW_MAX = 12
 
const float TIME_INTERVAL_HC_PLUS_HIGH_MIN = 15
 
const float TIME_INTERVAL_HC_PLUS_HIGH_MAX = 25
 

Private Attributes

const float TICK_INTERVAL = 2
 
float m_TimeSinceLastTick
 
float m_ProcessTimeAccuFreeze
 
float m_ProcessTimeAccuHot
 
PlayerBase m_Player
 
float m_EventTimeFreeze = -1
 
float m_EventTimeHot = -1
 

Detailed Description

Definition at line 1 of file HeatComfortAnimHandler.c.

Constructor & Destructor Documentation

◆ HeatComfortAnimHandler()

void HeatComfortAnimHandler::HeatComfortAnimHandler ( PlayerBase player)
inlineprotected

Definition at line 19 of file HeatComfortAnimHandler.c.

20 {
22 }

References m_Player.

Member Function Documentation

◆ GetEventTime()

float HeatComfortAnimHandler::GetEventTime ( float hc_value,
float threshold_low,
float threshold_high,
float low_min,
float high_min,
float low_max,
float high_max )
inlineprotected

Definition at line 35 of file HeatComfortAnimHandler.c.

36 {
40
42 }
Definition EnMath.c:7
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].
Definition 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,...

References Math::InverseLerp(), Math::Lerp(), and Math::RandomFloatInclusive().

Referenced by Process().

◆ Process()

void HeatComfortAnimHandler::Process ( float delta_time)
inlineprotected

Definition at line 45 of file HeatComfortAnimHandler.c.

46 {
47 if (GetGame().IsServer())
48 {
49
50 float hc = m_Player.GetStatHeatComfort().Get();
51 float inv_value;
52 float value_min;
53 float value_max;
54 float offset_time;
55
57 {
59
60 if (m_EventTimeFreeze < 0) //if not set
62
64 {
67 m_Player.GetSymptomManager().QueueUpPrimarySymptom(SymptomIDs.SYMPTOM_FREEZE);
68 /*
69 Print("-----======== freezing ========-------");
70 Print(inv_value);
71 Print(value_min);
72 Print(value_max);
73 Print(offset_time);
74 Print("-----======== freezing ========-------");
75 */
76 }
77 }
79 {
81
82 if (m_EventTimeHot < 0) //if not set
84
86 {
88 m_EventTimeHot = -1;
89 m_Player.GetSymptomManager().QueueUpPrimarySymptom(SymptomIDs.SYMPTOM_HOT);
90
91 //Print("-----======== freezing ========-------");
92 //Print(inv_value);
93 //Print(value_min);
94 //Print(value_max);
95 //Print(offset_time);
96 //Print("-----======== freezing ========-------");
97
98 }
99 }
100 }
101 }
float GetEventTime(float hc_value, float threshold_low, float threshold_high, float low_min, float high_min, float low_max, float high_max)
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_EMPTY
proto native CGame GetGame()

References GetEventTime(), GetGame(), m_EventTimeFreeze, m_EventTimeHot, m_Player, m_ProcessTimeAccuFreeze, m_ProcessTimeAccuHot, PlayerConstants::THRESHOLD_HEAT_COMFORT_MINUS_EMPTY, PlayerConstants::THRESHOLD_HEAT_COMFORT_MINUS_WARNING, PlayerConstants::THRESHOLD_HEAT_COMFORT_PLUS_EMPTY, PlayerConstants::THRESHOLD_HEAT_COMFORT_PLUS_WARNING, TIME_INTERVAL_HC_MINUS_HIGH_MAX, TIME_INTERVAL_HC_MINUS_HIGH_MIN, TIME_INTERVAL_HC_MINUS_LOW_MAX, TIME_INTERVAL_HC_MINUS_LOW_MIN, TIME_INTERVAL_HC_PLUS_HIGH_MAX, TIME_INTERVAL_HC_PLUS_LOW_MAX, and TIME_INTERVAL_HC_PLUS_LOW_MIN.

Referenced by Update().

◆ Update()

void HeatComfortAnimHandler::Update ( float delta_time,
HumanMovementState hms )
inlineprotected

Member Data Documentation

◆ m_EventTimeFreeze

float HeatComfortAnimHandler::m_EventTimeFreeze = -1
private

Definition at line 9 of file HeatComfortAnimHandler.c.

Referenced by Process().

◆ m_EventTimeHot

float HeatComfortAnimHandler::m_EventTimeHot = -1
private

Definition at line 10 of file HeatComfortAnimHandler.c.

Referenced by Process().

◆ m_MovementState

ref HumanMovementState HeatComfortAnimHandler::m_MovementState = new HumanMovementState()
protected

Definition at line 11 of file HeatComfortAnimHandler.c.

◆ m_Player

PlayerBase HeatComfortAnimHandler::m_Player
private

Definition at line 8 of file HeatComfortAnimHandler.c.

Referenced by HeatComfortAnimHandler(), and Process().

◆ m_ProcessTimeAccuFreeze

float HeatComfortAnimHandler::m_ProcessTimeAccuFreeze
private

Definition at line 5 of file HeatComfortAnimHandler.c.

Referenced by Process().

◆ m_ProcessTimeAccuHot

float HeatComfortAnimHandler::m_ProcessTimeAccuHot
private

Definition at line 6 of file HeatComfortAnimHandler.c.

Referenced by Process().

◆ m_TimeSinceLastTick

float HeatComfortAnimHandler::m_TimeSinceLastTick
private

Definition at line 4 of file HeatComfortAnimHandler.c.

Referenced by Update().

◆ TICK_INTERVAL

const float HeatComfortAnimHandler::TICK_INTERVAL = 2
private

Definition at line 3 of file HeatComfortAnimHandler.c.

Referenced by Update().

◆ TIME_INTERVAL_HC_MINUS_HIGH_MAX

const float HeatComfortAnimHandler::TIME_INTERVAL_HC_MINUS_HIGH_MAX = 25
protected

Definition at line 14 of file HeatComfortAnimHandler.c.

Referenced by Process().

◆ TIME_INTERVAL_HC_MINUS_HIGH_MIN

const float HeatComfortAnimHandler::TIME_INTERVAL_HC_MINUS_HIGH_MIN = 15
protected

Definition at line 14 of file HeatComfortAnimHandler.c.

Referenced by Process().

◆ TIME_INTERVAL_HC_MINUS_LOW_MAX

const float HeatComfortAnimHandler::TIME_INTERVAL_HC_MINUS_LOW_MAX = 12
protected

Definition at line 13 of file HeatComfortAnimHandler.c.

Referenced by Process().

◆ TIME_INTERVAL_HC_MINUS_LOW_MIN

const float HeatComfortAnimHandler::TIME_INTERVAL_HC_MINUS_LOW_MIN = 5
protected

Definition at line 13 of file HeatComfortAnimHandler.c.

Referenced by Process().

◆ TIME_INTERVAL_HC_PLUS_HIGH_MAX

const float HeatComfortAnimHandler::TIME_INTERVAL_HC_PLUS_HIGH_MAX = 25
protected

Definition at line 17 of file HeatComfortAnimHandler.c.

Referenced by Process().

◆ TIME_INTERVAL_HC_PLUS_HIGH_MIN

const float HeatComfortAnimHandler::TIME_INTERVAL_HC_PLUS_HIGH_MIN = 15
protected

Definition at line 17 of file HeatComfortAnimHandler.c.

◆ TIME_INTERVAL_HC_PLUS_LOW_MAX

const float HeatComfortAnimHandler::TIME_INTERVAL_HC_PLUS_LOW_MAX = 12
protected

Definition at line 16 of file HeatComfortAnimHandler.c.

Referenced by Process().

◆ TIME_INTERVAL_HC_PLUS_LOW_MIN

const float HeatComfortAnimHandler::TIME_INTERVAL_HC_PLUS_LOW_MIN = 5
protected

Definition at line 16 of file HeatComfortAnimHandler.c.

Referenced by Process().


The documentation for this class was generated from the following file: