Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
hmpsevere.c
Go to the documentation of this file.
1
class
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
10
const
int
EFFECT_DURATION_TIME_MIN
= 6;
11
const
int
EFFECT_DURATION_TIME_MAX
= 10;
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
{
37
m_EffectStartTime
=
Math
.
RandomFloatInclusive
(
MIN_TIME_BETWEEN_EFFECTS
,
MAX_TIME_BETWEEN_EFFECTS
);
38
m_EffectDuration
=
Math
.
RandomFloatInclusive
(
EFFECT_DURATION_TIME_MIN
,
EFFECT_DURATION_TIME_MAX
);
39
}
40
41
if
(
m_EffectStartTime
> 0 &&
m_Time
>
m_EffectStartTime
)
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;
49
m_EffectStartTime
= -1;
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
}
Class
Super root of all classes in Enforce script.
Definition
enscript.c:11
Debug
Definition
debug.c:2
Debug::SymptomLog
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
LogManager
Definition
debug.c:692
LogManager::IsSymptomLogEnable
static bool IsSymptomLogEnable()
Definition
debug.c:806
Math
Definition
enmath.c:7
PlayerBase
Definition
playerbaseclient.c:2
SymptomBase
Definition
statebase.c:2
SymptomBase::OnInit
override void OnInit()
Definition
hmpsevere.c:17
SymptomBase::m_SyncToClient
bool m_SyncToClient
Definition
statebase.c:21
SymptomBase::MIN_TIME_BETWEEN_EFFECTS
const int MIN_TIME_BETWEEN_EFFECTS
Definition
feverblurstate.c:18
SymptomBase::EFFECT_DURATION_TIME_MAX
const int EFFECT_DURATION_TIME_MAX
Definition
hmpsevere.c:11
SymptomBase::EFFECT_DURATION_TIME_MIN
const int EFFECT_DURATION_TIME_MIN
Definition
hmpsevere.c:10
SymptomBase::m_Time
float m_Time
Definition
feverblurstate.c:9
SymptomBase::OnUpdateClient
override void OnUpdateClient(PlayerBase player, float deltatime)
Definition
hmpsevere.c:32
SymptomBase::OnGetDeactivatedServer
override void OnGetDeactivatedServer(PlayerBase player)
Definition
hmpsevere.c:67
SymptomBase::m_Priority
int m_Priority
Definition
statebase.c:4
SymptomBase::m_EffectTime
float m_EffectTime
Definition
feverblurstate.c:7
SymptomBase::OnGetActivatedServer
override void OnGetActivatedServer(PlayerBase player)
gets called once on an Symptom which is being activated
Definition
hmpsevere.c:56
SymptomBase::m_SymptomType
int m_SymptomType
Definition
statebase.c:18
SymptomBase::OnGetActivatedClient
override void OnGetActivatedClient(PlayerBase player)
Definition
hmpsevere.c:61
SymptomBase::m_Player
PlayerBase m_Player
Definition
statebase.c:8
SymptomBase::OnGetDeactivatedClient
override void OnGetDeactivatedClient(PlayerBase player)
only gets called once on an active Symptom that is being deactivated
Definition
hmpsevere.c:73
SymptomBase::m_MaxCount
int m_MaxCount
Definition
statebase.c:24
SymptomBase::m_ID
int m_ID
Definition
statebase.c:13
SymptomBase::m_Requester
PPERequester_FeverEffects m_Requester
Definition
feverblurstate.c:10
SymptomBase::m_EffectDuration
float m_EffectDuration
Definition
hmpsevere.c:3
SymptomBase::MAX_TIME_BETWEEN_EFFECTS
const int MAX_TIME_BETWEEN_EFFECTS
Definition
feverblurstate.c:19
SymptomBase::m_IsPersistent
bool m_IsPersistent
Definition
statebase.c:19
SymptomBase::m_EffectStartTime
float m_EffectStartTime
Definition
feverblurstate.c:8
g_Game
DayZGame g_Game
Definition
dayzgame.c:3942
ToString
proto string ToString()
Class::CastTo
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
Math::Clamp
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'.
Math::RandomFloatInclusive
static float RandomFloatInclusive(float min, float max)
Returns a random float number between and min [inclusive] and max [inclusive].
Definition
enmath.c:106
SymptomTypes
SymptomTypes
Definition
statemanager.c:32
Games
Dayz
scripts
4_world
classes
playersymptoms
states
secondary
hmpsevere.c
Generated by
1.17.0