Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
burning.c
Go to the documentation of this file.
2 {
3  private const float BURNING_TRESHOLD = 199;
4  private const float HEALTH_DECREMENT_PER_SEC = -5;
5 
6  override void Init()
7  {
8  m_TrackActivatedTime = false;
9  m_ID = eModifiers.MDF_BURNING;
12  }
13  override bool ActivateCondition(PlayerBase player)
14  {
15  float hc = player.GetStatHeatComfort().Get();
16  if ( hc > BURNING_TRESHOLD )
17  {
18  return true;
19  }
20  else
21  {
22  return false;
23  }
24  }
25 
26  override void OnActivate(PlayerBase player)
27  {
28  //Print("My face is melting!");
29  }
30 
31 
32  override bool DeactivateCondition(PlayerBase player)
33  {
34  if ( player.GetStatHeatComfort().Get() <= BURNING_TRESHOLD )
35  {
36  return true;
37  }
38  else
39  {
40  return false;
41  }
42  }
43 
44  override void OnTick(PlayerBase player, float deltaT)
45  {
46  float currenthealth = player.GetHealth("GlobalHealth", "Health");
47  player.SetHealth("GlobalHealth", "Health" , ( currenthealth + (HEALTH_DECREMENT_PER_SEC*deltaT) ) );
48  //player.GetStatTemperature().Set( player.GetStatTemperature().GetMax() );
49  }
50 };
m_TickIntervalActive
float m_TickIntervalActive
Definition: modifierbase.c:19
m_TrackActivatedTime
bool m_TrackActivatedTime
Definition: modifierbase.c:15
DEFAULT_TICK_TIME_ACTIVE
const int DEFAULT_TICK_TIME_ACTIVE
Definition: modifiersmanager.c:31
PlayerBase
Definition: playerbaseclient.c:1
BurningMdfr
Definition: burning.c:1
m_TickIntervalInactive
float m_TickIntervalInactive
Definition: modifierbase.c:18
eModifiers
eModifiers
Definition: emodifiers.c:1
ModifierBase
Definition: breathvapourmdfr.c:3
m_ID
protected int m_ID
ID of effect, given by SEffectManager when registered (automatically done when playing through it)
Definition: effect.c:49
DEFAULT_TICK_TIME_INACTIVE
const int DEFAULT_TICK_TIME_INACTIVE
Definition: modifiersmanager.c:33