Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
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 
6  void WoundInfectionMdfr()
7  {
8  Error("[ERROR] :: WoundInfectionMdfr is deprecated.");
9  }
10 };
11 
12 
13 
15 {
16  static const int AGENT_THRESHOLD_ACTIVATE = 1;
17  static const int AGENT_THRESHOLD_DEACTIVATE = 250;
18  static const int AGENT_THRESHOLD_FEVER = 250;
19 
20  static const int PAIN_EVENT_INTERVAL_MIN = 18;
21  static const int PAIN_EVENT_INTERVAL_MAX = 26;
22 
23  protected float m_NextEvent;
24  protected float m_Time;
25 
26  override void Init()
27  {
28  m_TrackActivatedTime = false;
29  m_ID = eModifiers.MDF_WOUND_INFECTION1;
32  m_SyncID = eModifierSyncIDs.MODIFIER_SYNC_WOUND_INFECT_1;
33  }
34 
35  override string GetDebugText()
36  {
37  return ("Activate threshold: "+AGENT_THRESHOLD_ACTIVATE + "| " +"Deativate threshold: "+AGENT_THRESHOLD_DEACTIVATE);
38  }
39 
40  override protected bool ActivateCondition(PlayerBase player)
41  {
42  if( player.GetSingleAgentCount(eAgents.WOUND_AGENT) >= AGENT_THRESHOLD_ACTIVATE && !player.GetModifiersManager().IsModifierActive(eModifiers.MDF_WOUND_INFECTION2))
43  {
44  return true;
45  }
46  else
47  {
48  return false;
49  }
50  }
51 
52  override protected void OnActivate(PlayerBase player)
53  {
54  player.IncreaseDiseaseCount();
55  m_NextEvent = Math.RandomFloatInclusive( PAIN_EVENT_INTERVAL_MIN, PAIN_EVENT_INTERVAL_MAX );
56  }
57 
58  override protected void OnDeactivate(PlayerBase player)
59  {
60  player.DecreaseDiseaseCount();
61  }
62 
63  override protected bool DeactivateCondition(PlayerBase player)
64  {
65  return !ActivateCondition(player);
66  }
67 
68  override protected void OnTick(PlayerBase player, float deltaT)
69  {
70 
71  m_Time += deltaT;
72 
73  if ( m_Time >= m_NextEvent )
74  {
75  player.GetSymptomManager().QueueUpPrimarySymptom(SymptomIDs.SYMPTOM_PAIN_LIGHT);
76  m_Time = 0;
77  m_NextEvent = Math.RandomFloatInclusive( PAIN_EVENT_INTERVAL_MIN, PAIN_EVENT_INTERVAL_MAX );
78  }
79 
80 
81  }
82 };
m_Time
protected float m_Time
Definition: carscript.c:146
Error
void Error(string err)
Messagebox with error message.
Definition: endebug.c:90
WoundInfectionMdfr
Definition: woundinfection.c:1
m_SyncID
eModifierSyncIDs m_SyncID
Definition: modifierbase.c:29
m_TickIntervalActive
float m_TickIntervalActive
Definition: modifierbase.c:19
m_TrackActivatedTime
bool m_TrackActivatedTime
Definition: modifierbase.c:15
WoundInfectStage1Mdfr
Definition: woundinfection.c:14
DEFAULT_TICK_TIME_ACTIVE
const int DEFAULT_TICK_TIME_ACTIVE
Definition: modifiersmanager.c:31
PlayerBase
Definition: playerbaseclient.c:1
eAgents
eAgents
Definition: eagents.c:2
m_TickIntervalInactive
float m_TickIntervalInactive
Definition: modifierbase.c:18
eModifiers
eModifiers
Definition: emodifiers.c:1
ModifierBase
Definition: breathvapourmdfr.c:3
eModifierSyncIDs
eModifierSyncIDs
Definition: modifiersmanager.c:2
Math
Definition: enmath.c:6
m_ID
protected int m_ID
ID of effect, given by SEffectManager when registered (automatically done when playing through it)
Definition: effect.c:49
DEFAULT_TICK_TIME_INACTIVE
const int DEFAULT_TICK_TIME_INACTIVE
Definition: modifiersmanager.c:33