Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Loading...
Searching...
No Matches
hmpsevere.c
Go to the documentation of this file.
1class HMP3Symptom extends SymptomBase
2{
3 protected float m_EffectDuration;
4 protected float m_EffectTime;
5 protected float m_EffectStartTime;
6 protected float m_Time;
7
8 protected PPERequester_HMPGhosts m_Requester;
9
12
13 const int MIN_TIME_BETWEEN_EFFECTS = 24.0;
14 const int MAX_TIME_BETWEEN_EFFECTS = 30.0;
15
16 //this is just for the Symptom parameters set-up and is called even if the Symptom doesn't execute, don't put any gameplay code in here
17 override void OnInit()
18 {
19 m_SymptomType = SymptomTypes.SECONDARY;
20 m_Priority = 0;
21 m_ID = SymptomIDs.SYMPTOM_HMP_SEVERE;
22 m_IsPersistent = false;
23 m_SyncToClient = true;
24 m_MaxCount = 1;
25
26 if (!g_Game.IsDedicatedServer())
27 {
28 Class.CastTo(m_Requester,PPERequesterBank.GetRequester(PPERequesterBank.REQ_HMP_GHOST));
29 }
30 }
31
32 override void OnUpdateClient(PlayerBase player, float deltatime)
33 {
34 m_Time += deltatime;
35 if (m_EffectStartTime <= 0)
36 {
39 }
40
42 {
43 m_EffectTime += deltatime / m_EffectDuration;
44 m_Requester.SetPulseProgress(Math.Clamp(m_EffectTime,0,1));
45
46 if (m_EffectTime >= 1)
47 {
48 m_EffectTime = 0;
50 m_Time = 0;
51 }
52 }
53 }
54
56 override void OnGetActivatedServer(PlayerBase player)
57 {
58 if (LogManager.IsSymptomLogEnable()) Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetActivated", m_Player.ToString());
59 }
60
61 override void OnGetActivatedClient(PlayerBase player)
62 {
63 m_Requester.Start();
64 if (LogManager.IsSymptomLogEnable()) Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetActivated", m_Player.ToString());
65 }
66
67 override void OnGetDeactivatedServer(PlayerBase player)
68 {
69 if (LogManager.IsSymptomLogEnable()) Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetDeactivated", m_Player.ToString());
70 }
71
73 override void OnGetDeactivatedClient(PlayerBase player)
74 {
75 m_Requester.FadeOutEffect(3);
76 if (LogManager.IsSymptomLogEnable()) Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetDeactivated", m_Player.ToString());
77 }
78}
Super root of all classes in Enforce script.
Definition enscript.c:11
Definition debug.c:2
static void SymptomLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Definition debug.c:192
static bool IsSymptomLogEnable()
Definition debug.c:806
Definition enmath.c:7
override void OnInit()
Definition hmpsevere.c:17
bool m_SyncToClient
Definition statebase.c:21
const int MIN_TIME_BETWEEN_EFFECTS
const int EFFECT_DURATION_TIME_MAX
Definition hmpsevere.c:11
const int EFFECT_DURATION_TIME_MIN
Definition hmpsevere.c:10
override void OnUpdateClient(PlayerBase player, float deltatime)
Definition hmpsevere.c:32
override void OnGetDeactivatedServer(PlayerBase player)
Definition hmpsevere.c:67
int m_Priority
Definition statebase.c:4
float m_EffectTime
override void OnGetActivatedServer(PlayerBase player)
gets called once on an Symptom which is being activated
Definition hmpsevere.c:56
int m_SymptomType
Definition statebase.c:18
override void OnGetActivatedClient(PlayerBase player)
Definition hmpsevere.c:61
PlayerBase m_Player
Definition statebase.c:8
override void OnGetDeactivatedClient(PlayerBase player)
only gets called once on an active Symptom that is being deactivated
Definition hmpsevere.c:73
int m_MaxCount
Definition statebase.c:24
PPERequester_FeverEffects m_Requester
float m_EffectDuration
Definition hmpsevere.c:3
const int MAX_TIME_BETWEEN_EFFECTS
bool m_IsPersistent
Definition statebase.c:19
float m_EffectStartTime
DayZGame g_Game
Definition dayzgame.c:3942
proto string ToString()
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.
static float RandomFloatInclusive(float min, float max)
Returns a random float number between and min [inclusive] and max [inclusive].
Definition enmath.c:106
SymptomTypes