Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
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 {
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};
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
float m_TickIntervalActive
float m_TickIntervalInactive
const int DEFAULT_TICK_TIME_INACTIVE
enum eModifierSyncIDs DEFAULT_TICK_TIME_ACTIVE
void OnActivate()