Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
breathvapourmdfr.c
Go to the documentation of this file.
2
3class BreathVapourMdfr extends ModifierBase
4{
5 override void Init()
6 {
8 m_ID = eModifiers.MDF_BREATH_VAPOUR;
12
13 }
14
15 override bool ActivateCondition(PlayerBase player)
16 {
17 return true;
18 }
19
20 override bool DeactivateCondition(PlayerBase player)
21 {
22 return false;
23 }
24
25 override void OnReconnect(PlayerBase player)
26 {
27
28 }
29
30 override string GetDebugText()
31 {
32 //return m_Player.GetStatHeatComfort().Get().ToString();
33 }
34
35 override string GetDebugTextSimple()
36 {
37 //return m_Player.GetStatHeatComfort().Get().ToString();
38 }
39
40
41 override void OnTick(PlayerBase player, float deltaT)
42 {
43 if( !player.m_Environment.IsTemperatureSet() )
44 return;
45 float air_temperature = player.m_Environment.GetTemperature();
46 int level = 0;//default
47 if( MiscGameplayFunctions.IsValueInRange( air_temperature, PlayerConstants.BREATH_VAPOUR_THRESHOLD_HIGH, PlayerConstants.BREATH_VAPOUR_THRESHOLD_LOW) )
48 {
49 float value = Math.InverseLerp( PlayerConstants.BREATH_VAPOUR_THRESHOLD_LOW, PlayerConstants.BREATH_VAPOUR_THRESHOLD_HIGH,air_temperature);
50 value = Math.Clamp(value,0,1);
51 level = Math.Round(Math.Lerp(1,BREATH_VAPOUR_LEVEL_MAX,value));
52 }
53 else if(air_temperature < PlayerConstants.BREATH_VAPOUR_THRESHOLD_HIGH)
54 {
56 }
57 if( level != player.m_BreathVapour )
58 {
59 player.m_BreathVapour = level;
60 player.SetSynchDirty();
61 }
62 }
63};
const int BREATH_VAPOUR_LEVEL_MAX
Definition enmath.c:7
override Widget Init()
Definition dayzgame.c:127
int m_ID
ID of effect, given by SEffectManager when registered (automatically done when playing through it)
Definition effect.c:51
eModifiers
Definition emodifiers.c:2
bool m_TrackActivatedTime
overall time this modifier was active
void DisableDeactivateCheck()
bool ActivateCondition(PlayerBase player)
string GetDebugText()
bool DeactivateCondition(PlayerBase player)
float m_TickIntervalActive
float m_TickIntervalInactive
void OnReconnect(PlayerBase player)
is called when a modifier is being re-activated upon player server connection, use to activate system...
string GetDebugTextSimple()
const int DEFAULT_TICK_TIME_INACTIVE