DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
Loading...
Searching...
No Matches
WoundInfection.c
Go to the documentation of this file.
2{
3 static const int AGENT_THRESHOLD_ACTIVATE = 100;
4 static const int AGENT_THRESHOLD_DEACTIVATE = 20;
5
7 {
8 Error("[ERROR] :: WoundInfectionMdfr is deprecated.");
9 }
10};
11
12
13
15{
16 static const int AGENT_THRESHOLD_ACTIVATE = 1;
17 static const int AGENT_THRESHOLD_DEACTIVATE = 250;
18 static const int AGENT_THRESHOLD_FEVER = 250;
19
20 static const int PAIN_EVENT_INTERVAL_MIN = 18;
21 static const int PAIN_EVENT_INTERVAL_MAX = 26;
22
23 protected float m_NextEvent;
24 protected float m_Time;
25
26 override void Init()
27 {
29 m_ID = eModifiers.MDF_WOUND_INFECTION1;
32 m_SyncID = eModifierSyncIDs.MODIFIER_SYNC_WOUND_INFECT_1;
33 }
34
35 override string GetDebugText()
36 {
37 return ("Activate threshold: "+AGENT_THRESHOLD_ACTIVATE + "| " +"Deativate threshold: "+AGENT_THRESHOLD_DEACTIVATE);
38 }
39
40 override protected bool ActivateCondition(PlayerBase player)
41 {
42 if( player.GetSingleAgentCount(eAgents.WOUND_AGENT) >= AGENT_THRESHOLD_ACTIVATE && !player.GetModifiersManager().IsModifierActive(eModifiers.MDF_WOUND_INFECTION2))
43 {
44 return true;
45 }
46 else
47 {
48 return false;
49 }
50 }
51
52 override protected void OnActivate(PlayerBase player)
53 {
54 player.IncreaseDiseaseCount();
56 }
57
58 override protected void OnDeactivate(PlayerBase player)
59 {
60 player.DecreaseDiseaseCount();
61 }
62
63 override protected bool DeactivateCondition(PlayerBase player)
64 {
65 return !ActivateCondition(player);
66 }
67
68 override protected void OnTick(PlayerBase player, float deltaT)
69 {
70
71 m_Time += deltaT;
72
73 if ( m_Time >= m_NextEvent )
74 {
75 player.GetSymptomManager().QueueUpPrimarySymptom(SymptomIDs.SYMPTOM_PAIN_LIGHT);
76 m_Time = 0;
78 }
79
80
81 }
82};
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
Definition EnMath.c:7
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)
override void Init()
static const int AGENT_THRESHOLD_DEACTIVATE
protected float m_NextEvent
static const int AGENT_THRESHOLD_FEVER
override protected void OnActivate(PlayerBase player)
override protected bool ActivateCondition(PlayerBase player)
override protected void OnTick(PlayerBase player, float deltaT)
static const int AGENT_THRESHOLD_ACTIVATE
static const int AGENT_THRESHOLD_DEACTIVATE
eModifiers
Definition eModifiers.c:2
void Error(string err)
Messagebox with error message.
Definition EnDebug.c:90
static float RandomFloatInclusive(float min, float max)
Returns a random float number between and min [inclusive] and max [inclusive].
Definition EnMath.c:86