DayZ 1.24
Loading...
Searching...
No Matches
HeartAttackMdfr Class Reference
Inheritance diagram for HeartAttackMdfr:
[legend]
Collaboration diagram for HeartAttackMdfr:
[legend]

Private Member Functions

override void Init ()
 
override bool ActivateCondition (PlayerBase player)
 
override void OnActivate (PlayerBase player)
 
override bool DeactivateCondition (PlayerBase player)
 
override void OnTick (PlayerBase player, float deltaT)
 

Private Attributes

const float HEALTH_DECREMENT_PER_SEC = -0.2
 
const float SHOCK_DECREMENT_PER_SEC = -2
 
const float SHOCK_LIMIT = 0
 

Detailed Description

Definition at line 1 of file HeartAttack.c.

Member Function Documentation

◆ ActivateCondition()

override bool HeartAttackMdfr::ActivateCondition ( PlayerBase player)
inlineprivate

Definition at line 17 of file HeartAttack.c.

18 {
19 return false;
20 }

◆ DeactivateCondition()

override bool HeartAttackMdfr::DeactivateCondition ( PlayerBase player)
inlineprivate

Definition at line 26 of file HeartAttack.c.

27 {
28 return false;
29 }

◆ Init()

override void HeartAttackMdfr::Init ( )
inlineprivate

Definition at line 7 of file HeartAttack.c.

8 {
10 m_ID = eModifiers.MDF_HEART_ATTACK;
13 m_IsPersistent = true;
16 }
int m_ID
ID of effect, given by SEffectManager when registered (automatically done when playing through it)
Definition Effect.c:49
bool m_TrackActivatedTime
void DisableDeactivateCheck()
void DisableActivateCheck()
float m_TickIntervalActive
float m_TickIntervalInactive
bool m_IsPersistent
const int DEFAULT_TICK_TIME_INACTIVE
const int DEFAULT_TICK_TIME_ACTIVE
eModifiers
Definition eModifiers.c:2

References DEFAULT_TICK_TIME_ACTIVE, DEFAULT_TICK_TIME_INACTIVE, DisableActivateCheck(), DisableDeactivateCheck(), m_ID, m_IsPersistent, m_TickIntervalActive, m_TickIntervalInactive, and m_TrackActivatedTime.

◆ OnActivate()

override void HeartAttackMdfr::OnActivate ( PlayerBase player)
inlineprivate

Definition at line 22 of file HeartAttack.c.

23 {
24 }

◆ OnTick()

override void HeartAttackMdfr::OnTick ( PlayerBase player,
float deltaT )
inlineprivate

Definition at line 31 of file HeartAttack.c.

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 }
const float HEALTH_DECREMENT_PER_SEC
Definition HeartAttack.c:3
const float SHOCK_LIMIT
Definition HeartAttack.c:5
const float SHOCK_DECREMENT_PER_SEC
Definition HeartAttack.c:4

References HEALTH_DECREMENT_PER_SEC, SHOCK_DECREMENT_PER_SEC, and SHOCK_LIMIT.

Member Data Documentation

◆ HEALTH_DECREMENT_PER_SEC

const float HeartAttackMdfr::HEALTH_DECREMENT_PER_SEC = -0.2
private

Definition at line 3 of file HeartAttack.c.

Referenced by OnTick().

◆ SHOCK_DECREMENT_PER_SEC

const float HeartAttackMdfr::SHOCK_DECREMENT_PER_SEC = -2
private

Definition at line 4 of file HeartAttack.c.

Referenced by OnTick().

◆ SHOCK_LIMIT

const float HeartAttackMdfr::SHOCK_LIMIT = 0
private

Definition at line 5 of file HeartAttack.c.

Referenced by OnTick().


The documentation for this class was generated from the following file: