Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
immunityboost.c
Go to the documentation of this file.
2{
3 float m_LastWaterLevel;
4 ref HumanMovementState m_MovementState = new HumanMovementState();
5 float m_RegenTime;
6
7 override void Init()
8 {
11 m_IsPersistent = true;
12 m_ID = eModifiers.MDF_IMMUNITYBOOST;
15 m_RegenTime = PlayerConstants.VITAMINS_LIFETIME_SECS;
16 }
17
18 override bool ActivateCondition(PlayerBase player)
19 {
20 return false;
21 }
22
23 override void OnReconnect(PlayerBase player)
24 {
25 OnActivate(player);
26 }
27
28 override string GetDebugText()
29 {
30 return (m_RegenTime - GetAttachedTime()).ToString();
31 }
32
33 override void OnActivate(PlayerBase player)
34 {
35 player.SetImmunityBoosted(true);
36 player.IncreaseHealingsCount();
37 }
38
39 override void OnDeactivate(PlayerBase player)
40 {
41 player.SetImmunityBoosted(false);
42 player.DecreaseHealingsCount();
43 }
44
45 override bool DeactivateCondition(PlayerBase player)
46 {
47 float attached_time = GetAttachedTime();
48
49 if( attached_time >= m_RegenTime )
50 return true;
51 else
52 return false;
53 }
54}
int m_ID
ID of effect, given by SEffectManager when registered (automatically done when playing through it)
Definition effect.c:51
eModifiers
Definition emodifiers.c:2
bool m_TrackActivatedTime
overall time this modifier was active
float GetAttachedTime()
bool m_AnalyticsStatsEnabled
float m_TickIntervalActive
float m_TickIntervalInactive
bool m_IsPersistent
should this modifier track overall time it was active ?
const int DEFAULT_TICK_TIME_INACTIVE
void OnActivate()