Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
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  {
10  m_IsPersistent = true;
11  m_ID = eModifiers.MDF_IMMUNITYBOOST;
14  m_RegenTime = PlayerConstants.VITAMINS_LIFETIME_SECS;
15  }
16 
17  override bool ActivateCondition(PlayerBase player)
18  {
19  return false;
20  }
21 
22  override void OnReconnect(PlayerBase player)
23  {
24  OnActivate(player);
25  }
26 
27  override string GetDebugText()
28  {
29  return (m_RegenTime - GetAttachedTime()).ToString();
30  }
31 
32  override void OnActivate(PlayerBase player)
33  {
34  player.SetImmunityBoosted(true);
35  player.IncreaseHealingsCount();
36  /*
37  if( player.GetNotifiersManager() )
38  player.GetNotifiersManager().ActivateByType(eNotifiers.NTF_PILLS);
39  */
40  }
41 
42  override void OnDeactivate(PlayerBase player)
43  {
44  player.SetImmunityBoosted(false);
45  player.DecreaseHealingsCount();
46  /*
47  if( player.GetNotifiersManager() )
48  player.GetNotifiersManager().DeactivateByType(eNotifiers.NTF_PILLS);
49  */
50  }
51 
52  override bool DeactivateCondition(PlayerBase player)
53  {
54  float attached_time = GetAttachedTime();
55 
56  if( attached_time >= m_RegenTime )
57  {
58  return true;
59  }
60  else
61  {
62  return false;
63  }
64  }
65 
66  override void OnTick(PlayerBase player, float deltaT)
67  {
68 
69  }
70 };
ImmunityBoost
Definition: immunityboost.c:1
m_TickIntervalActive
float m_TickIntervalActive
Definition: modifierbase.c:19
m_TrackActivatedTime
bool m_TrackActivatedTime
Definition: modifierbase.c:15
HumanMovementState
Definition: human.c:1125
PlayerBase
Definition: playerbaseclient.c:1
PlayerConstants
Definition: playerconstants.c:1
m_TickIntervalInactive
float m_TickIntervalInactive
Definition: modifierbase.c:18
eModifiers
eModifiers
Definition: emodifiers.c:1
ModifierBase
Definition: breathvapourmdfr.c:3
m_IsPersistent
bool m_IsPersistent
Definition: modifierbase.c:16
GetAttachedTime
float GetAttachedTime()
Definition: modifierbase.c:150
m_ID
protected int m_ID
ID of effect, given by SEffectManager when registered (automatically done when playing through it)
Definition: effect.c:49
DEFAULT_TICK_TIME_INACTIVE
const int DEFAULT_TICK_TIME_INACTIVE
Definition: modifiersmanager.c:33