DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
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 {
18 m_ID = eModifiers.MDF_WOUND_INFECTION2;
21 m_SyncID = eModifierSyncIDs.MODIFIER_SYNC_WOUND_INFECT_2;
22 }
23
24 override string GetDebugText()
25 {
26 return ("Activate threshold: "+AGENT_THRESHOLD_ACTIVATE + "| " +"Deativate threshold: "+AGENT_THRESHOLD_DEACTIVATE);
27 }
28
29 override protected bool ActivateCondition(PlayerBase player)
30 {
31 if(player.GetSingleAgentCount(eAgents.WOUND_AGENT) >= AGENT_THRESHOLD_ACTIVATE)
32 {
33 return true;
34 }
35 else
36 {
37 return false;
38 }
39 }
40
41 override protected void OnActivate(PlayerBase player)
42 {
43 player.IncreaseDiseaseCount();
45
46 SymptomBase shivers = player.GetSymptomManager().QueueUpSecondarySymptomEx(SymptomIDs.SYMPTOM_HAND_SHIVER);
47 if ( shivers )
48 {
51 }
52
53 }
54
55 override protected void OnDeactivate(PlayerBase player)
56 {
57 player.DecreaseDiseaseCount();
58 player.GetSymptomManager().RemoveSecondarySymptom(SymptomIDs.SYMPTOM_HAND_SHIVER);
59 }
60
61 override protected bool DeactivateCondition(PlayerBase player)
62 {
63 if(player.GetSingleAgentCount(eAgents.WOUND_AGENT) <= AGENT_THRESHOLD_DEACTIVATE)
64 {
65 return true;
66 }
67 else
68 {
69 return false;
70 }
71 }
72
73 override protected void OnTick(PlayerBase player, float deltaT)
74 {
75 m_Time += deltaT;
76
77 if ( m_Time >= m_NextEvent )
78 {
79 if( player.IsAntibioticsActive() )
80 {
81 player.GetSymptomManager().QueueUpPrimarySymptom(SymptomIDs.SYMPTOM_PAIN_LIGHT);
82 }
83 else
84 {
85 player.GetSymptomManager().QueueUpPrimarySymptom(SymptomIDs.SYMPTOM_PAIN_HEAVY);
86 float damage = m_Time * (DAMAGE_PER_SEC + player.GetHealthRegenSpeed());
87 player.AddHealth("","", -damage);
88 }
89
90 m_Time = 0;
92 }
93
94
95 }
96};
eAgents
Definition EAgents.c:3
protected int m_ID
ID of effect, given by SEffectManager when registered (automatically done when playing through it)
Definition Effect.c:49
bool m_TrackActivatedTime
eModifierSyncIDs m_SyncID
float m_TickIntervalActive
float m_TickIntervalInactive
eModifierSyncIDs
const int DEFAULT_TICK_TIME_INACTIVE
const int DEFAULT_TICK_TIME_ACTIVE
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
protected float m_Time
override string GetDebugText()
static const int PAIN_EVENT_INTERVAL_MAX
override protected void OnDeactivate(PlayerBase player)
override protected bool DeactivateCondition(PlayerBase player)
static const float DAMAGE_PER_SEC
static const int AGENT_THRESHOLD_DEACTIVATE
protected float m_NextEvent
override protected void OnActivate(PlayerBase player)
override protected bool ActivateCondition(PlayerBase player)
override protected void OnTick(PlayerBase player, float deltaT)
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:86