Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
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
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};
override bool DeactivateCondition(PlayerBase player)
Definition heartattack.c:26
override void OnActivate(PlayerBase player)
Definition heartattack.c:22
const float SHOCK_LIMIT
Definition heartattack.c:5
const float SHOCK_DECREMENT_PER_SEC
Definition heartattack.c:4
override void OnTick(PlayerBase player, float deltaT)
Definition heartattack.c:31
const float HEALTH_DECREMENT_PER_SEC
Definition heartattack.c:3
override void Init()
Definition heartattack.c:7
override bool ActivateCondition(PlayerBase player)
Definition heartattack.c:17
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