DayZ 1.24
Loading...
Searching...
No Matches
WoundInfection2.c
Go to the documentation of this file.
2{
3 static const int AGENT_THRESHOLD_ACTIVATE = 250;
4 static const int AGENT_THRESHOLD_DEACTIVATE = 0;
5
6 static const int PAIN_EVENT_INTERVAL_MIN = 6;
7 static const int PAIN_EVENT_INTERVAL_MAX = 12;
8
9
10 static const float DAMAGE_PER_SEC = 0.04;
11
12 protected float m_NextEvent;
13 protected float m_Time;
14
15 override void Init()
16 {
18 m_ID = eModifiers.MDF_WOUND_INFECTION2;
21 m_SyncID = eModifierSyncIDs.MODIFIER_SYNC_WOUND_INFECT_2;
22 }
23
24 override string GetDebugText()
25 {
26 return ("Activate threshold: " + AGENT_THRESHOLD_ACTIVATE + "| " + "Deativate threshold: " + AGENT_THRESHOLD_DEACTIVATE);
27 }
28
29 override protected bool ActivateCondition(PlayerBase player)
30 {
31 if (player.GetSingleAgentCount(eAgents.WOUND_AGENT) >= AGENT_THRESHOLD_ACTIVATE)
32 return true;
33 else
34 return false;
35 }
36
37 override protected void OnActivate(PlayerBase player)
38 {
39 player.IncreaseDiseaseCount();
41
42 SymptomBase shivers = player.GetSymptomManager().QueueUpSecondarySymptomEx(SymptomIDs.SYMPTOM_HAND_SHIVER);
43 if (shivers)
44 {
47 }
48
49 }
50
51 override protected void OnDeactivate(PlayerBase player)
52 {
53 player.DecreaseDiseaseCount();
54 player.GetSymptomManager().RemoveSecondarySymptom(SymptomIDs.SYMPTOM_HAND_SHIVER);
55 }
56
57 override protected bool DeactivateCondition(PlayerBase player)
58 {
59 if (player.GetSingleAgentCount(eAgents.WOUND_AGENT) <= AGENT_THRESHOLD_DEACTIVATE)
60 return true;
61 else
62 return false;
63 }
64
65 override protected void OnTick(PlayerBase player, float deltaT)
66 {
67 m_Time += deltaT;
68
69 if (m_Time >= m_NextEvent)
70 {
71 if (player.IsAntibioticsActive())
72 player.GetSymptomManager().QueueUpPrimarySymptom(SymptomIDs.SYMPTOM_PAIN_LIGHT);
73 else
74 {
75 player.GetSymptomManager().QueueUpPrimarySymptom(SymptomIDs.SYMPTOM_PAIN_HEAVY);
76 float damage = m_Time * (DAMAGE_PER_SEC + player.GetHealthRegenSpeed());
77 player.AddHealth("", "", -damage);
78 }
79
80 m_Time = 0;
82 }
83
84
85 }
86};
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
eModifierSyncIDs m_SyncID
float m_TickIntervalActive
float m_TickIntervalInactive
eModifierSyncIDs
const int DEFAULT_TICK_TIME_INACTIVE
const int DEFAULT_TICK_TIME_ACTIVE
static ref Param1< int > PARAM1_INT
Definition EnMath.c:7
void OnDeactivate(PlayerBase player)
static const float DAMAGE_PER_SEC
void OnTick(PlayerBase player, float deltaT)
static const int PAIN_EVENT_INTERVAL_MAX
void OnActivate(PlayerBase player)
static const int AGENT_THRESHOLD_DEACTIVATE
static const int AGENT_THRESHOLD_ACTIVATE
static const int PAIN_EVENT_INTERVAL_MIN
bool DeactivateCondition(PlayerBase player)
bool ActivateCondition(PlayerBase player)
override string GetDebugText()
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