Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
toxicity.c
Go to the documentation of this file.
2 {
3  private const float TOXICITY_CLEANUP_PER_SEC = 1;
4  private const float VOMIT_THRESHOLD = 70;
5 
6  override void Init()
7  {
8  m_TrackActivatedTime = false;
9  m_ID = eModifiers.MDF_TOXICITY;
13  }
14 
15  override bool ActivateCondition(PlayerBase player)
16  {
17  return true;
18  }
19 
20  override bool DeactivateCondition(PlayerBase player)
21  {
22  return false;
23  }
24 
25  override void OnTick(PlayerBase player, float deltaT)
26  {
27  player.GetStatToxicity().Add( -TOXICITY_CLEANUP_PER_SEC * deltaT );
28  if( player.GetStatToxicity().Get() > VOMIT_THRESHOLD )
29  {
30  SymptomBase symptom = player.GetSymptomManager().QueueUpPrimarySymptom(SymptomIDs.SYMPTOM_VOMIT);
31 
32  if( symptom )
33  {
34  symptom.SetDuration(Math.RandomIntInclusive(4,8));
35  }
36  }
37  }
38 
39  override void OnReconnect(PlayerBase player)
40  {
41 
42  }
43 
44  override void OnActivate(PlayerBase player)
45  {
46 
47  }
48 };
ToxicityMdfr
Definition: toxicity.c:1
m_TickIntervalActive
float m_TickIntervalActive
Definition: modifierbase.c:19
m_TrackActivatedTime
bool m_TrackActivatedTime
Definition: modifierbase.c:15
SymptomBase
Definition: statebase.c:1
DisableDeactivateCheck
void DisableDeactivateCheck()
Definition: modifierbase.c:83
DEFAULT_TICK_TIME_ACTIVE
const int DEFAULT_TICK_TIME_ACTIVE
Definition: modifiersmanager.c:31
PlayerBase
Definition: playerbaseclient.c:1
m_TickIntervalInactive
float m_TickIntervalInactive
Definition: modifierbase.c:18
eModifiers
eModifiers
Definition: emodifiers.c:1
ModifierBase
Definition: breathvapourmdfr.c:3
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