Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
heartattack.c
Go to the documentation of this file.
2{
3 private const float HEALTH_DECREMENT_PER_SEC = -0.2;
4 private const float SHOCK_DECREMENT_PER_SEC = -2;
5 private const float SHOCK_LIMIT = 0;
6
7 override void Init()
8 {
10 m_ID = eModifiers.MDF_HEART_ATTACK;
13 m_IsPersistent = true;
16 }
17 override bool ActivateCondition(PlayerBase player)
18 {
19 return false;
20 }
21
22 override void OnActivate(PlayerBase player)
23 {
24 }
25
26 override bool DeactivateCondition(PlayerBase player)
27 {
28 return false;
29 }
30
31 override void OnTick(PlayerBase player, float deltaT)
32 {
33 if ( player.GetHealth("GlobalHealth","Shock") <= SHOCK_LIMIT )
34 {
35 float currenthealth = player.GetHealth("GlobalHealth", "Health");
36 player.AddHealth("GlobalHealth", "Health" , HEALTH_DECREMENT_PER_SEC * deltaT );
37 }
38 else
39 {
40 float currentshock = player.GetHealth("GlobalHealth", "Shock");
41 player.AddHealth("GlobalHealth", "Shock", SHOCK_DECREMENT_PER_SEC * deltaT);
42 }
43 }
44};
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()
void DisableActivateCheck()
float m_TickIntervalActive
float m_TickIntervalInactive
bool m_IsPersistent
should this modifier track overall time it was active ?
const int DEFAULT_TICK_TIME_INACTIVE
enum eModifierSyncIDs DEFAULT_TICK_TIME_ACTIVE
void OnActivate()