Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
health.c
Go to the documentation of this file.
1
class
HealthMdfr
:
ModifierBase
2
{
3
private
float
m_LastHealthLevel
;
4
private
float
m_LastBloodLevel
;
5
6
7
override
void
Init
()
8
{
9
m_TrackActivatedTime
=
false
;
10
m_ID
=
eModifiers
.MDF_HEALTH;
11
m_TickIntervalInactive
=
DEFAULT_TICK_TIME_INACTIVE
;
12
m_TickIntervalActive
=
DEFAULT_TICK_TIME_ACTIVE
;
13
DisableDeactivateCheck
();
14
}
15
16
override
bool
ActivateCondition
(
PlayerBase
player)
17
{
18
return
true
;
19
}
20
21
22
override
bool
DeactivateCondition
(
PlayerBase
player)
23
{
24
return
false
;
25
}
26
27
override
void
OnTick
(
PlayerBase
player,
float
deltaT)
28
{
29
30
float
blood = player.GetHealth(
"GlobalHealth"
,
"Blood"
);
31
float
health = player.GetHealth(
"GlobalHealth"
,
"Health"
);
32
33
float
healthdelta =
Math
.
AbsInt
(health -
m_LastHealthLevel
);
34
if
(health <
m_LastHealthLevel
) healthdelta = -healthdelta;
35
//if( player.m_NotifiersManager ) player.m_NotifiersManager.FindNotifier(eNotifiers.NTF_LIVES).DisplayTendency(healthdelta);
36
m_LastHealthLevel
= health;
37
38
float
blooddelta =
Math
.
AbsInt
(blood -
m_LastBloodLevel
);
39
if
(blood <
m_LastBloodLevel
) blooddelta = -blooddelta;
40
//if( player.m_NotifiersManager ) player.m_NotifiersManager.FindNotifier(eNotifiers.NTF_BLOOD).DisplayTendency(blooddelta);
41
m_LastBloodLevel
= blood;
42
43
}
44
};
HealthMdfr
Definition
health.c:2
HealthMdfr::DeactivateCondition
override bool DeactivateCondition(PlayerBase player)
Definition
health.c:22
HealthMdfr::m_LastBloodLevel
float m_LastBloodLevel
Definition
health.c:4
HealthMdfr::OnTick
override void OnTick(PlayerBase player, float deltaT)
Definition
health.c:27
HealthMdfr::Init
override void Init()
Definition
health.c:7
HealthMdfr::ActivateCondition
override bool ActivateCondition(PlayerBase player)
Definition
health.c:16
HealthMdfr::m_LastHealthLevel
float m_LastHealthLevel
Definition
health.c:3
Math
Definition
enmath.c:7
ModifierBase
Definition
breathvapourmdfr.c:4
PlayerBase
Definition
playerbaseclient.c:2
m_ID
int m_ID
ID of effect, given by SEffectManager when registered (automatically done when playing through it).
Definition
effect.c:51
eModifiers
eModifiers
Definition
emodifiers.c:2
Math::AbsInt
static proto int AbsInt(int i)
Returns absolute value.
m_TrackActivatedTime
bool m_TrackActivatedTime
overall time this modifier was active
Definition
modifierbase.c:14
DisableDeactivateCheck
void DisableDeactivateCheck()
Definition
modifierbase.c:86
m_TickIntervalActive
float m_TickIntervalActive
Definition
modifierbase.c:18
m_TickIntervalInactive
float m_TickIntervalInactive
Definition
modifierbase.c:17
DEFAULT_TICK_TIME_INACTIVE
const int DEFAULT_TICK_TIME_INACTIVE
Definition
modifiersmanager.c:29
DEFAULT_TICK_TIME_ACTIVE
enum eModifierSyncIDs DEFAULT_TICK_TIME_ACTIVE
Games
Dayz
scripts
4_world
classes
playermodifiers
modifiers
health.c
Generated by
1.17.0