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

Protected Member Functions

void OnActivate (PlayerBase player)
 
void OnDeactivate (PlayerBase player)
 
bool DeactivateCondition (PlayerBase player)
 
void OnTick (PlayerBase player, float deltaT)
 

Private Member Functions

override void Init ()
 
override string GetDebugText ()
 
override bool ActivateCondition (PlayerBase player)
 

Private Attributes

const int AGENT_THRESHOLD_ACTIVATE = 200
 
const int AGENT_THRESHOLD_DEACTIVATE = 100
 

Detailed Description

Definition at line 1 of file CommonCold.c.

Member Function Documentation

◆ ActivateCondition()

override bool CommonColdMdfr::ActivateCondition ( PlayerBase player)
inlineprivate

Definition at line 18 of file CommonCold.c.

19 {
20 if (player.GetSingleAgentCount(eAgents.INFLUENZA) >= AGENT_THRESHOLD_ACTIVATE)
21 return true;
22 else
23 return false;
24 }
eAgents
Definition EAgents.c:3
const int AGENT_THRESHOLD_ACTIVATE
Definition CommonCold.c:3

References AGENT_THRESHOLD_ACTIVATE.

◆ DeactivateCondition()

bool CommonColdMdfr::DeactivateCondition ( PlayerBase player)
inlineprotected

Definition at line 39 of file CommonCold.c.

40 {
41 return (player.GetSingleAgentCount(eAgents.INFLUENZA) <= AGENT_THRESHOLD_DEACTIVATE);
42 }
const int AGENT_THRESHOLD_DEACTIVATE
Definition CommonCold.c:4

References AGENT_THRESHOLD_DEACTIVATE.

◆ GetDebugText()

override string CommonColdMdfr::GetDebugText ( )
inlineprivate

Definition at line 13 of file CommonCold.c.

14 {
15 return ("Activate threshold: " + AGENT_THRESHOLD_ACTIVATE + "| " + "Deativate threshold: " + AGENT_THRESHOLD_DEACTIVATE);
16 }

References AGENT_THRESHOLD_ACTIVATE, and AGENT_THRESHOLD_DEACTIVATE.

◆ Init()

override void CommonColdMdfr::Init ( )
inlineprivate

Definition at line 5 of file CommonCold.c.

6 {
8 m_ID = eModifiers.MDF_COMMON_COLD;
11 }
int m_ID
ID of effect, given by SEffectManager when registered (automatically done when playing through it)
Definition Effect.c:49
bool m_TrackActivatedTime
float m_TickIntervalActive
float m_TickIntervalInactive
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_TickIntervalActive, m_TickIntervalInactive, and m_TrackActivatedTime.

◆ OnActivate()

void CommonColdMdfr::OnActivate ( PlayerBase player)
inlineprotected

Definition at line 26 of file CommonCold.c.

27 {
28 //if( player.m_NotifiersManager ) player.m_NotifiersManager.ActivateByType(eNotifiers.NTF_SICK);
29 player.IncreaseDiseaseCount();
30 }

◆ OnDeactivate()

void CommonColdMdfr::OnDeactivate ( PlayerBase player)
inlineprotected

Definition at line 32 of file CommonCold.c.

33 {
34
35 player.DecreaseDiseaseCount();
36 }

◆ OnTick()

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

Definition at line 44 of file CommonCold.c.

45 {
46 float chance_of_sneeze = player.GetSingleAgentCountNormalized(eAgents.INFLUENZA);
47
49 player.GetSymptomManager().QueueUpPrimarySymptom(SymptomIDs.SYMPTOM_SNEEZE);
50 }
Definition EnMath.c:7
static float RandomFloat01()
Returns a random float number between and min [inclusive] and max [inclusive].
Definition EnMath.c:126
static proto int RandomInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].

References Math::RandomFloat01(), and Math::RandomInt().

Member Data Documentation

◆ AGENT_THRESHOLD_ACTIVATE

const int CommonColdMdfr::AGENT_THRESHOLD_ACTIVATE = 200
private

Definition at line 3 of file CommonCold.c.

Referenced by ActivateCondition(), and GetDebugText().

◆ AGENT_THRESHOLD_DEACTIVATE

const int CommonColdMdfr::AGENT_THRESHOLD_DEACTIVATE = 100
private

Definition at line 4 of file CommonCold.c.

Referenced by DeactivateCondition(), and GetDebugText().


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