Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Loading...
Searching...
No Matches
woundinfection2.c
Go to the documentation of this file.
2{
3 static const int AGENT_THRESHOLD_ACTIVATE = 250;
4 static const int AGENT_THRESHOLD_DEACTIVATE = 0;
5
6 static const int PAIN_EVENT_INTERVAL_MIN = 6;
7 static const int PAIN_EVENT_INTERVAL_MAX = 12;
8
9
10 static const float DAMAGE_PER_SEC = 0.04;
11
12 protected float m_NextEvent;
13 protected float m_Time;
14
15 override void Init()
16 {
19 m_ID = eModifiers.MDF_WOUND_INFECTION2;
22 m_SyncID = eModifierSyncIDs.MODIFIER_SYNC_WOUND_INFECT_2;
23 }
24
25 override string GetDebugText()
26 {
27 return ("Activate threshold: "+AGENT_THRESHOLD_ACTIVATE + "| " +"Deativate threshold: "+AGENT_THRESHOLD_DEACTIVATE);
28 }
29
30 override protected bool ActivateCondition(PlayerBase player)
31 {
32 if(player.GetSingleAgentCount(eAgents.WOUND_AGENT) >= AGENT_THRESHOLD_ACTIVATE)
33 {
34 return true;
35 }
36 else
37 {
38 return false;
39 }
40 }
41
42 override protected void OnActivate(PlayerBase player)
43 {
44 player.IncreaseDiseaseCount();
46
47 SymptomBase shivers = player.GetSymptomManager().QueueUpSecondarySymptomEx(SymptomIDs.SYMPTOM_HAND_SHIVER);
48 if ( shivers )
49 {
52 }
53
54 }
55
56 override protected void OnDeactivate(PlayerBase player)
57 {
58 player.DecreaseDiseaseCount();
59 player.GetSymptomManager().RemoveSecondarySymptom(SymptomIDs.SYMPTOM_HAND_SHIVER);
60 }
61
62 override protected bool DeactivateCondition(PlayerBase player)
63 {
64 if(player.GetSingleAgentCount(eAgents.WOUND_AGENT) <= AGENT_THRESHOLD_DEACTIVATE)
65 {
66 return true;
67 }
68 else
69 {
70 return false;
71 }
72 }
73
74 override protected void OnTick(PlayerBase player, float deltaT)
75 {
76 m_Time += deltaT;
77
78 if ( m_Time >= m_NextEvent )
79 {
80 if( player.IsAntibioticsActive() )
81 {
82 player.GetSymptomManager().QueueUpPrimarySymptom(SymptomIDs.SYMPTOM_PAIN_LIGHT);
83 }
84 else
85 {
86 player.GetSymptomManager().QueueUpPrimarySymptom(SymptomIDs.SYMPTOM_PAIN_HEAVY);
87 float damage = m_Time * (DAMAGE_PER_SEC + player.GetHealthRegenSpeed());
88 player.AddHealth("","", -damage);
89 }
90
91 m_Time = 0;
93 }
94
95
96 }
97};
static ref Param1< int > PARAM1_INT
Definition enmath.c:7
void SetParam(Param p)
Definition statebase.c:105
static const int PAIN_EVENT_INTERVAL_MIN
static const int AGENT_THRESHOLD_ACTIVATE
bool ActivateCondition(PlayerBase player)
override string GetDebugText()
static const int PAIN_EVENT_INTERVAL_MAX
static const float DAMAGE_PER_SEC
bool DeactivateCondition(PlayerBase player)
static const int AGENT_THRESHOLD_DEACTIVATE
void OnTick(PlayerBase player, float deltaT)
void OnActivate(PlayerBase player)
void OnDeactivate(PlayerBase player)
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:51
eModifiers
Definition emodifiers.c:2
static float RandomFloatInclusive(float min, float max)
Returns a random float number between and min [inclusive] and max [inclusive].
Definition enmath.c:106
bool m_TrackActivatedTime
overall time this modifier was active
bool m_AnalyticsStatsEnabled
eModifierSyncIDs m_SyncID
float m_TickIntervalActive
float m_TickIntervalInactive
eModifierSyncIDs
const int DEFAULT_TICK_TIME_INACTIVE
enum eModifierSyncIDs DEFAULT_TICK_TIME_ACTIVE