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

Protected Member Functions

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

Protected Attributes

float m_NextEvent
 
float m_Time
 

Static Private Attributes

static const int AGENT_THRESHOLD_ACTIVATE = 250
 
static const int AGENT_THRESHOLD_DEACTIVATE = 0
 
static const int PAIN_EVENT_INTERVAL_MIN = 6
 
static const int PAIN_EVENT_INTERVAL_MAX = 12
 
static const float DAMAGE_PER_SEC = 0.04
 

Detailed Description

Definition at line 1 of file WoundInfection2.c.

Member Function Documentation

◆ ActivateCondition()

bool WoundInfectStage2Mdfr::ActivateCondition ( PlayerBase player)
inlineprotected

Definition at line 29 of file WoundInfection2.c.

30 {
31 if (player.GetSingleAgentCount(eAgents.WOUND_AGENT) >= AGENT_THRESHOLD_ACTIVATE)
32 return true;
33 else
34 return false;
35 }
eAgents
Definition EAgents.c:3
static const int AGENT_THRESHOLD_ACTIVATE

References AGENT_THRESHOLD_ACTIVATE.

◆ DeactivateCondition()

bool WoundInfectStage2Mdfr::DeactivateCondition ( PlayerBase player)
inlineprotected

Definition at line 57 of file WoundInfection2.c.

58 {
59 if (player.GetSingleAgentCount(eAgents.WOUND_AGENT) <= AGENT_THRESHOLD_DEACTIVATE)
60 return true;
61 else
62 return false;
63 }
static const int AGENT_THRESHOLD_DEACTIVATE

References AGENT_THRESHOLD_DEACTIVATE.

◆ GetDebugText()

override string WoundInfectStage2Mdfr::GetDebugText ( )
inlineprotected

Definition at line 24 of file WoundInfection2.c.

25 {
26 return ("Activate threshold: " + AGENT_THRESHOLD_ACTIVATE + "| " + "Deativate threshold: " + AGENT_THRESHOLD_DEACTIVATE);
27 }

References AGENT_THRESHOLD_ACTIVATE, and AGENT_THRESHOLD_DEACTIVATE.

◆ Init()

override void WoundInfectStage2Mdfr::Init ( )
inlineprotected

Definition at line 15 of file WoundInfection2.c.

16 {
18 m_ID = eModifiers.MDF_WOUND_INFECTION2;
21 m_SyncID = eModifierSyncIDs.MODIFIER_SYNC_WOUND_INFECT_2;
22 }
int m_ID
ID of effect, given by SEffectManager when registered (automatically done when playing through it)
Definition Effect.c:49
bool m_TrackActivatedTime
eModifierSyncIDs m_SyncID
float m_TickIntervalActive
float m_TickIntervalInactive
eModifierSyncIDs
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, m_ID, m_SyncID, m_TickIntervalActive, m_TickIntervalInactive, and m_TrackActivatedTime.

◆ OnActivate()

void WoundInfectStage2Mdfr::OnActivate ( PlayerBase player)
inlineprotected

Definition at line 37 of file WoundInfection2.c.

38 {
39 player.IncreaseDiseaseCount();
41
42 SymptomBase shivers = player.GetSymptomManager().QueueUpSecondarySymptomEx(SymptomIDs.SYMPTOM_HAND_SHIVER);
43 if (shivers)
44 {
47 }
48
49 }
static ref Param1< int > PARAM1_INT
Definition EnMath.c:7
static const int PAIN_EVENT_INTERVAL_MAX
static const int PAIN_EVENT_INTERVAL_MIN
static float RandomFloatInclusive(float min, float max)
Returns a random float number between and min [inclusive] and max [inclusive].
Definition EnMath.c:106

References m_NextEvent, PAIN_EVENT_INTERVAL_MAX, PAIN_EVENT_INTERVAL_MIN, CachedObjectsParams::PARAM1_INT, and Math::RandomFloatInclusive().

◆ OnDeactivate()

void WoundInfectStage2Mdfr::OnDeactivate ( PlayerBase player)
inlineprotected

Definition at line 51 of file WoundInfection2.c.

52 {
53 player.DecreaseDiseaseCount();
54 player.GetSymptomManager().RemoveSecondarySymptom(SymptomIDs.SYMPTOM_HAND_SHIVER);
55 }

◆ OnTick()

void WoundInfectStage2Mdfr::OnTick ( PlayerBase player,
float deltaT )
inlineprotected

Definition at line 65 of file WoundInfection2.c.

66 {
67 m_Time += deltaT;
68
69 if (m_Time >= m_NextEvent)
70 {
71 if (player.IsAntibioticsActive())
72 player.GetSymptomManager().QueueUpPrimarySymptom(SymptomIDs.SYMPTOM_PAIN_LIGHT);
73 else
74 {
75 player.GetSymptomManager().QueueUpPrimarySymptom(SymptomIDs.SYMPTOM_PAIN_HEAVY);
76 float damage = m_Time * (DAMAGE_PER_SEC + player.GetHealthRegenSpeed());
77 player.AddHealth("", "", -damage);
78 }
79
80 m_Time = 0;
82 }
83
84
85 }
static const float DAMAGE_PER_SEC

References DAMAGE_PER_SEC, m_NextEvent, m_Time, PAIN_EVENT_INTERVAL_MAX, PAIN_EVENT_INTERVAL_MIN, and Math::RandomFloatInclusive().

Member Data Documentation

◆ AGENT_THRESHOLD_ACTIVATE

const int WoundInfectStage2Mdfr::AGENT_THRESHOLD_ACTIVATE = 250
staticprivate

Definition at line 3 of file WoundInfection2.c.

Referenced by ActivateCondition(), and GetDebugText().

◆ AGENT_THRESHOLD_DEACTIVATE

const int WoundInfectStage2Mdfr::AGENT_THRESHOLD_DEACTIVATE = 0
staticprivate

Definition at line 4 of file WoundInfection2.c.

Referenced by DeactivateCondition(), and GetDebugText().

◆ DAMAGE_PER_SEC

const float WoundInfectStage2Mdfr::DAMAGE_PER_SEC = 0.04
staticprivate

Definition at line 10 of file WoundInfection2.c.

Referenced by OnTick().

◆ m_NextEvent

float WoundInfectStage2Mdfr::m_NextEvent
protected

Definition at line 12 of file WoundInfection2.c.

Referenced by OnActivate(), and OnTick().

◆ m_Time

float WoundInfectStage2Mdfr::m_Time
protected

Definition at line 13 of file WoundInfection2.c.

Referenced by OnTick().

◆ PAIN_EVENT_INTERVAL_MAX

const int WoundInfectStage2Mdfr::PAIN_EVENT_INTERVAL_MAX = 12
staticprivate

Definition at line 7 of file WoundInfection2.c.

Referenced by OnActivate(), and OnTick().

◆ PAIN_EVENT_INTERVAL_MIN

const int WoundInfectStage2Mdfr::PAIN_EVENT_INTERVAL_MIN = 6
staticprivate

Definition at line 6 of file WoundInfection2.c.

Referenced by OnActivate(), and OnTick().


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