DayZ 1.24
Loading...
Searching...
No Matches
Contamination3.c
Go to the documentation of this file.
2{
3 static const int AGENT_THRESHOLD_ACTIVATE = 400;
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
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 {
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 player.AddHealth("", "Shock", -100);
48
49 if (player.IsUnconscious())
50 player.AddHealth("", "", DAMAGE_PER_SEC * deltaT);
51
52 }
53};
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
float GetAttachedTime()
eModifierSyncIDs m_SyncID
float m_TickIntervalActive
float m_TickIntervalInactive
eModifierSyncIDs
const int DEFAULT_TICK_TIME_INACTIVE
const int DEFAULT_TICK_TIME_ACTIVE_SHORT
void OnActivate(PlayerBase player)
static const int AGENT_THRESHOLD_ACTIVATE
bool ActivateCondition(PlayerBase player)
void OnDeactivate(PlayerBase player)
static const float DAMAGE_PER_SEC
static const int AGENT_THRESHOLD_DEACTIVATE
override string GetDebugText()
void OnTick(PlayerBase player, float deltaT)
static const int AGENT_THRESHOLD_FEVER
bool DeactivateCondition(PlayerBase player)
eModifiers
Definition eModifiers.c:2