Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
contamination3.c
Go to the documentation of this file.
2 {
3  static const int AGENT_THRESHOLD_ACTIVATE = 400;
4  static const int AGENT_THRESHOLD_DEACTIVATE = AGENT_THRESHOLD_ACTIVATE - 1;
5  static const int AGENT_THRESHOLD_FEVER = 250;
6  static const float DAMAGE_PER_SEC = -3;
7 
8  override void Init()
9  {
10  m_ID = eModifiers.MDF_CONTAMINATION3;
13  m_SyncID = eModifierSyncIDs.MODIFIER_SYNC_CONTAMINATION2;//using the same sync as stage 2 for now
14  m_TrackActivatedTime = true;
15  }
16 
17  override string GetDebugText()
18  {
19  return ("Activate threshold: "+AGENT_THRESHOLD_ACTIVATE + "| " +"Deativate threshold: "+AGENT_THRESHOLD_DEACTIVATE);
20  }
21 
22  override protected bool ActivateCondition(PlayerBase player)
23  {
24  return ( player.GetSingleAgentCount(eAgents.CHEMICAL_POISON) >= AGENT_THRESHOLD_ACTIVATE );
25 
26  }
27 
28  override protected void OnActivate(PlayerBase player)
29  {
30  player.IncreaseDiseaseCount();
31  player.GetSymptomManager().QueueUpPrimarySymptom(SymptomIDs.SYMPTOM_VOMIT);
32  }
33 
34  override protected void OnDeactivate(PlayerBase player)
35  {
36  player.DecreaseDiseaseCount();
37  }
38 
39  override protected bool DeactivateCondition(PlayerBase player)
40  {
41  return !ActivateCondition(player);
42  }
43 
44  override protected void OnTick(PlayerBase player, float deltaT)
45  {
46  if(GetAttachedTime() > 4 && (!player.GetSymptomManager().GetCurrentPrimaryActiveSymptom() || (player.GetSymptomManager().GetCurrentPrimaryActiveSymptom() && player.GetSymptomManager().GetCurrentPrimaryActiveSymptom().GetType() != SymptomIDs.SYMPTOM_VOMIT)) )
47  {
48  player.AddHealth("","Shock", -100);
49  }
50 
51  if (player.IsUnconscious())
52  {
53  player.AddHealth("","",DAMAGE_PER_SEC * deltaT);
54  }
55 
56  }
57 };
ContaminationStage3Mdfr
Definition: contamination3.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
PlayerBase
Definition: playerbaseclient.c:1
eAgents
eAgents
Definition: eagents.c:2
DEFAULT_TICK_TIME_ACTIVE_SHORT
const int DEFAULT_TICK_TIME_ACTIVE_SHORT
Definition: modifiersmanager.c:32
m_TickIntervalInactive
float m_TickIntervalInactive
Definition: modifierbase.c:18
eModifiers
eModifiers
Definition: emodifiers.c:1
ModifierBase
Definition: breathvapourmdfr.c:3
GetAttachedTime
float GetAttachedTime()
Definition: modifierbase.c:150
eModifierSyncIDs
eModifierSyncIDs
Definition: modifiersmanager.c:2
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