DayZ 1.24
Loading...
Searching...
No Matches
ContaminationStage2Mdfr Class Reference
Inheritance diagram for ContaminationStage2Mdfr:
[legend]
Collaboration diagram for ContaminationStage2Mdfr:
[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_NextEvent1
 
float m_Time1
 
float m_NextEvent2
 
float m_Time2
 

Static Protected Attributes

static const int EVENT_2_INTERVAL_MIN = 200
 
static const int EVENT_2_INTERVAL_MAX = 400
 

Static Private Attributes

static const int AGENT_THRESHOLD_ACTIVATE = 100
 
static const int AGENT_THRESHOLD_DEACTIVATE = 400
 
static const int EVENT_1_INTERVAL_MIN = 20
 
static const int EVENT_1_INTERVAL_MAX = 40
 

Detailed Description

Definition at line 1 of file Contamination2.c.

Member Function Documentation

◆ ActivateCondition()

bool ContaminationStage2Mdfr::ActivateCondition ( PlayerBase player)
inlineprotected

Definition at line 32 of file Contamination2.c.

33 {
34 return (player.GetSingleAgentCount(eAgents.CHEMICAL_POISON) >= AGENT_THRESHOLD_ACTIVATE && player.GetSingleAgentCount(eAgents.CHEMICAL_POISON) < AGENT_THRESHOLD_DEACTIVATE);
35 }
eAgents
Definition EAgents.c:3
static const int AGENT_THRESHOLD_DEACTIVATE
static const int AGENT_THRESHOLD_ACTIVATE

References AGENT_THRESHOLD_ACTIVATE, and AGENT_THRESHOLD_DEACTIVATE.

Referenced by DeactivateCondition().

◆ DeactivateCondition()

bool ContaminationStage2Mdfr::DeactivateCondition ( PlayerBase player)
inlineprotected

Definition at line 49 of file Contamination2.c.

50 {
52 }
bool ActivateCondition(PlayerBase player)

References ActivateCondition().

◆ GetDebugText()

override string ContaminationStage2Mdfr::GetDebugText ( )
inlineprotected

Definition at line 27 of file Contamination2.c.

28 {
29 return ("Activate threshold: " + AGENT_THRESHOLD_ACTIVATE + "| " + "Deativate threshold: " + AGENT_THRESHOLD_DEACTIVATE);
30 }

References AGENT_THRESHOLD_ACTIVATE, and AGENT_THRESHOLD_DEACTIVATE.

◆ Init()

override void ContaminationStage2Mdfr::Init ( )
inlineprotected

Definition at line 19 of file Contamination2.c.

20 {
21 m_ID = eModifiers.MDF_CONTAMINATION2;
24 m_SyncID = eModifierSyncIDs.MODIFIER_SYNC_CONTAMINATION2;
25 }
int m_ID
ID of effect, given by SEffectManager when registered (automatically done when playing through it)
Definition Effect.c:49
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, and m_TickIntervalInactive.

◆ OnActivate()

void ContaminationStage2Mdfr::OnActivate ( PlayerBase player)
inlineprotected

Definition at line 37 of file Contamination2.c.

38 {
39 player.IncreaseDiseaseCount();
42 }
static const int EVENT_1_INTERVAL_MIN
static const int EVENT_2_INTERVAL_MIN
static const int EVENT_2_INTERVAL_MAX
static const int EVENT_1_INTERVAL_MAX
Definition EnMath.c:7
static float RandomFloatInclusive(float min, float max)
Returns a random float number between and min [inclusive] and max [inclusive].
Definition EnMath.c:106

References EVENT_1_INTERVAL_MAX, EVENT_1_INTERVAL_MIN, EVENT_2_INTERVAL_MAX, EVENT_2_INTERVAL_MIN, m_NextEvent1, m_NextEvent2, and Math::RandomFloatInclusive().

◆ OnDeactivate()

void ContaminationStage2Mdfr::OnDeactivate ( PlayerBase player)
inlineprotected

Definition at line 44 of file Contamination2.c.

45 {
46 player.DecreaseDiseaseCount();
47 }

◆ OnTick()

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

Definition at line 54 of file Contamination2.c.

55 {
56
57 m_Time1 += deltaT;
58 m_Time2 += deltaT;
59
60
61 if (m_Time1 >= m_NextEvent1)
62 {
63 player.GetSymptomManager().QueueUpPrimarySymptom(SymptomIDs.SYMPTOM_COUGH);
64 m_Time1 = 0;
66 }
67 if (m_Time2 >= m_NextEvent2)
68 {
69 player.GetSymptomManager().QueueUpPrimarySymptom(SymptomIDs.SYMPTOM_VOMIT);
70 m_Time2 = 0;
72 }
73
74 }

References EVENT_1_INTERVAL_MAX, EVENT_1_INTERVAL_MIN, EVENT_2_INTERVAL_MAX, EVENT_2_INTERVAL_MIN, m_NextEvent1, m_NextEvent2, m_Time1, m_Time2, and Math::RandomFloatInclusive().

Member Data Documentation

◆ AGENT_THRESHOLD_ACTIVATE

const int ContaminationStage2Mdfr::AGENT_THRESHOLD_ACTIVATE = 100
staticprivate

Definition at line 3 of file Contamination2.c.

Referenced by ActivateCondition(), GetDebugText(), and AntiChemInjector::OnApply().

◆ AGENT_THRESHOLD_DEACTIVATE

const int ContaminationStage2Mdfr::AGENT_THRESHOLD_DEACTIVATE = 400
staticprivate

Definition at line 4 of file Contamination2.c.

Referenced by ActivateCondition(), and GetDebugText().

◆ EVENT_1_INTERVAL_MAX

const int ContaminationStage2Mdfr::EVENT_1_INTERVAL_MAX = 40
staticprivate

Definition at line 7 of file Contamination2.c.

Referenced by OnActivate(), and OnTick().

◆ EVENT_1_INTERVAL_MIN

const int ContaminationStage2Mdfr::EVENT_1_INTERVAL_MIN = 20
staticprivate

Definition at line 6 of file Contamination2.c.

Referenced by OnActivate(), and OnTick().

◆ EVENT_2_INTERVAL_MAX

const int ContaminationStage2Mdfr::EVENT_2_INTERVAL_MAX = 400
staticprotected

Definition at line 14 of file Contamination2.c.

Referenced by OnActivate(), and OnTick().

◆ EVENT_2_INTERVAL_MIN

const int ContaminationStage2Mdfr::EVENT_2_INTERVAL_MIN = 200
staticprotected

Definition at line 13 of file Contamination2.c.

Referenced by OnActivate(), and OnTick().

◆ m_NextEvent1

float ContaminationStage2Mdfr::m_NextEvent1
protected

Definition at line 9 of file Contamination2.c.

Referenced by OnActivate(), and OnTick().

◆ m_NextEvent2

float ContaminationStage2Mdfr::m_NextEvent2
protected

Definition at line 16 of file Contamination2.c.

Referenced by OnActivate(), and OnTick().

◆ m_Time1

float ContaminationStage2Mdfr::m_Time1
protected

Definition at line 10 of file Contamination2.c.

Referenced by OnTick().

◆ m_Time2

float ContaminationStage2Mdfr::m_Time2
protected

Definition at line 17 of file Contamination2.c.

Referenced by OnTick().


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