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