Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
contamination.c
Go to the documentation of this file.
2 {
3  static const int AGENT_THRESHOLD_ACTIVATE = 1;
4  static const int AGENT_THRESHOLD_DEACTIVATE = 100;
5 
6  static const int EVENT_1_INTERVAL_MIN = 20;
7  static const int EVENT_1_INTERVAL_MAX = 40;
8 
9  protected float m_NextEvent;
10  protected float m_Time;
11 
12  override void Init()
13  {
14  m_ID = eModifiers.MDF_CONTAMINATION1;
17  m_SyncID = eModifierSyncIDs.MODIFIER_SYNC_CONTAMINATION;
18  }
19 
20  override string GetDebugText()
21  {
22  return ("Activate threshold: "+AGENT_THRESHOLD_ACTIVATE + "| " +"Deativate threshold: "+AGENT_THRESHOLD_DEACTIVATE);
23  }
24 
25  override protected bool ActivateCondition(PlayerBase player)
26  {
27  return ( player.GetSingleAgentCount(eAgents.CHEMICAL_POISON) >= AGENT_THRESHOLD_ACTIVATE && player.GetSingleAgentCount(eAgents.CHEMICAL_POISON) < AGENT_THRESHOLD_DEACTIVATE );
28  }
29 
30  override protected void OnActivate(PlayerBase player)
31  {
32  //player.IncreaseDiseaseCount();
33  m_NextEvent = Math.RandomFloatInclusive( EVENT_1_INTERVAL_MIN, EVENT_1_INTERVAL_MAX );
34  }
35 
36  override protected void OnDeactivate(PlayerBase player)
37  {
38  //player.DecreaseDiseaseCount();
39  }
40 
41  override protected bool DeactivateCondition(PlayerBase player)
42  {
43  return !ActivateCondition(player);
44  }
45 
46  override protected void OnTick(PlayerBase player, float deltaT)
47  {
48  /*
49  m_Time += deltaT;
50 
51  if ( m_Time >= m_NextEvent )
52  {
53  player.GetSymptomManager().QueueUpPrimarySymptom(SymptomIDs.SYMPTOM_COUGH);
54  m_Time = 0;
55  m_NextEvent = Math.RandomFloatInclusive( EVENT_1_INTERVAL_MIN, EVENT_1_INTERVAL_MAX );
56  }
57  */
58  }
59 };
m_SyncID
eModifierSyncIDs m_SyncID
Definition: modifierbase.c:29
ContaminationStage1Mdfr
Definition: contamination.c:1
m_TickIntervalActive
float m_TickIntervalActive
Definition: modifierbase.c:19
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