DayZ 1.24
Loading...
Searching...
No Matches
CommonCold.c
Go to the documentation of this file.
2{
3 const int AGENT_THRESHOLD_ACTIVATE = 200;
12
13 override string GetDebugText()
14 {
15 return ("Activate threshold: " + AGENT_THRESHOLD_ACTIVATE + "| " + "Deativate threshold: " + AGENT_THRESHOLD_DEACTIVATE);
16 }
17
19 {
20 if (player.GetSingleAgentCount(eAgents.INFLUENZA) >= AGENT_THRESHOLD_ACTIVATE)
21 return true;
22 else
23 return false;
24 }
25
26 override protected void OnActivate(PlayerBase player)
27 {
28 //if( player.m_NotifiersManager ) player.m_NotifiersManager.ActivateByType(eNotifiers.NTF_SICK);
29 player.IncreaseDiseaseCount();
30 }
31
32 override protected void OnDeactivate(PlayerBase player)
33 {
34
35 player.DecreaseDiseaseCount();
36 }
37
38
39 override protected bool DeactivateCondition(PlayerBase player)
40 {
41 return (player.GetSingleAgentCount(eAgents.INFLUENZA) <= AGENT_THRESHOLD_DEACTIVATE);
42 }
43
44 override protected void OnTick(PlayerBase player, float deltaT)
45 {
46 float chance_of_sneeze = player.GetSingleAgentCountNormalized(eAgents.INFLUENZA);
47
49 player.GetSymptomManager().QueueUpPrimarySymptom(SymptomIDs.SYMPTOM_SNEEZE);
50 }
51};
eAgents
Definition EAgents.c:3
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
bool DeactivateCondition(PlayerBase player)
Definition CommonCold.c:39
const int AGENT_THRESHOLD_DEACTIVATE
Definition CommonCold.c:4
void OnDeactivate(PlayerBase player)
Definition CommonCold.c:32
override string GetDebugText()
Definition CommonCold.c:13
override void Init()
Definition CommonCold.c:5
const int AGENT_THRESHOLD_ACTIVATE
Definition CommonCold.c:3
override bool ActivateCondition(PlayerBase player)
Definition CommonCold.c:18
void OnActivate(PlayerBase player)
Definition CommonCold.c:26
void OnTick(PlayerBase player, float deltaT)
Definition CommonCold.c:44
Definition EnMath.c:7
eModifiers
Definition eModifiers.c:2
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].