DayZ 1.24
Loading...
Searching...
No Matches
WoundInfection.c
Go to the documentation of this file.
2{
3 static const int AGENT_THRESHOLD_ACTIVATE = 100;
4 static const int AGENT_THRESHOLD_DEACTIVATE = 20;
5
7 {
8 Error("[ERROR] :: WoundInfectionMdfr is deprecated.");
9 }
10};
11
12
14{
15 static const int AGENT_THRESHOLD_ACTIVATE = 1;
16 static const int AGENT_THRESHOLD_DEACTIVATE = 250;
17 static const int AGENT_THRESHOLD_FEVER = 250;
18
19 static const int PAIN_EVENT_INTERVAL_MIN = 18;
20 static const int PAIN_EVENT_INTERVAL_MAX = 26;
21
22 protected float m_NextEvent;
23 protected float m_Time;
24
25 override void Init()
26 {
28 m_ID = eModifiers.MDF_WOUND_INFECTION1;
31 m_SyncID = eModifierSyncIDs.MODIFIER_SYNC_WOUND_INFECT_1;
32 }
33
34 override string GetDebugText()
35 {
36 return ("Activate threshold: " + AGENT_THRESHOLD_ACTIVATE + "| " + "Deativate threshold: " + AGENT_THRESHOLD_DEACTIVATE);
37 }
38
39 override protected bool ActivateCondition(PlayerBase player)
40 {
41 if (player.GetSingleAgentCount(eAgents.WOUND_AGENT) >= AGENT_THRESHOLD_ACTIVATE && !player.GetModifiersManager().IsModifierActive(eModifiers.MDF_WOUND_INFECTION2))
42 return true;
43 else
44 return false;
45 }
46
47 override protected void OnActivate(PlayerBase player)
48 {
49 player.IncreaseDiseaseCount();
51 }
52
53 override protected void OnDeactivate(PlayerBase player)
54 {
55 player.DecreaseDiseaseCount();
56 }
57
58 override protected bool DeactivateCondition(PlayerBase player)
59 {
61 }
62
63 override protected void OnTick(PlayerBase player, float deltaT)
64 {
65
66 m_Time += deltaT;
67
68 if (m_Time >= m_NextEvent)
69 {
70 player.GetSymptomManager().QueueUpPrimarySymptom(SymptomIDs.SYMPTOM_PAIN_LIGHT);
71 m_Time = 0;
73 }
74
75
76 }
77};
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
Definition EnMath.c:7
static const int AGENT_THRESHOLD_FEVER
bool DeactivateCondition(PlayerBase player)
static const int AGENT_THRESHOLD_ACTIVATE
void OnActivate(PlayerBase player)
static const int PAIN_EVENT_INTERVAL_MAX
bool ActivateCondition(PlayerBase player)
static const int AGENT_THRESHOLD_DEACTIVATE
static const int PAIN_EVENT_INTERVAL_MIN
override string GetDebugText()
void OnDeactivate(PlayerBase player)
override void Init()
void OnTick(PlayerBase player, float deltaT)
static const int AGENT_THRESHOLD_ACTIVATE
static const int AGENT_THRESHOLD_DEACTIVATE
eModifiers
Definition eModifiers.c:2
void Error(string err)
Messagebox with error message.
Definition EnDebug.c:90
static float RandomFloatInclusive(float min, float max)
Returns a random float number between and min [inclusive] and max [inclusive].
Definition EnMath.c:106