DayZ 1.24
Loading...
Searching...
No Matches
Contamination2.c
Go to the documentation of this file.
2{
3 static const int AGENT_THRESHOLD_ACTIVATE = 100;
4 static const int AGENT_THRESHOLD_DEACTIVATE = 400;
5
6 static const int EVENT_1_INTERVAL_MIN = 20;
7 static const int EVENT_1_INTERVAL_MAX = 40;
8
9 protected float m_NextEvent1;
10 protected float m_Time1;
11
12
13 static const int EVENT_2_INTERVAL_MIN = 200;
14 static const int EVENT_2_INTERVAL_MAX = 400;
15
16 protected float m_NextEvent2;
17 protected float m_Time2;
18
19 override void Init()
20 {
21 m_ID = eModifiers.MDF_CONTAMINATION2;
24 m_SyncID = eModifierSyncIDs.MODIFIER_SYNC_CONTAMINATION2;
25 }
26
27 override string GetDebugText()
28 {
29 return ("Activate threshold: " + AGENT_THRESHOLD_ACTIVATE + "| " + "Deativate threshold: " + AGENT_THRESHOLD_DEACTIVATE);
30 }
31
32 override protected bool ActivateCondition(PlayerBase player)
33 {
34 return (player.GetSingleAgentCount(eAgents.CHEMICAL_POISON) >= AGENT_THRESHOLD_ACTIVATE && player.GetSingleAgentCount(eAgents.CHEMICAL_POISON) < AGENT_THRESHOLD_DEACTIVATE);
35 }
36
43
44 override protected void OnDeactivate(PlayerBase player)
45 {
46 player.DecreaseDiseaseCount();
47 }
48
49 override protected bool DeactivateCondition(PlayerBase player)
50 {
52 }
53
54 override protected void OnTick(PlayerBase player, float deltaT)
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 }
75};
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
eModifierSyncIDs m_SyncID
float m_TickIntervalActive
float m_TickIntervalInactive
eModifierSyncIDs
const int DEFAULT_TICK_TIME_INACTIVE
const int DEFAULT_TICK_TIME_ACTIVE
static const int AGENT_THRESHOLD_DEACTIVATE
static const int EVENT_1_INTERVAL_MIN
bool DeactivateCondition(PlayerBase player)
static const int EVENT_2_INTERVAL_MIN
void OnDeactivate(PlayerBase player)
void OnActivate(PlayerBase player)
static const int EVENT_2_INTERVAL_MAX
bool ActivateCondition(PlayerBase player)
static const int AGENT_THRESHOLD_ACTIVATE
static const int EVENT_1_INTERVAL_MAX
override string GetDebugText()
void OnTick(PlayerBase player, float deltaT)
Definition EnMath.c:7
eModifiers
Definition eModifiers.c:2
static float RandomFloatInclusive(float min, float max)
Returns a random float number between and min [inclusive] and max [inclusive].
Definition EnMath.c:106