Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
antibiotics.c
Go to the documentation of this file.
2 {
3  float m_RegenTime;
4  const int ANTIBIOTICS_LIFETIME = 300;
5  const float ANTIBIOTICS_STRENGTH = 1;
6 
7  override void Init()
8  {
10  m_IsPersistent = true;
11  m_ID = eModifiers.MDF_ANTIBIOTICS;
14  m_RegenTime = ANTIBIOTICS_LIFETIME;
15 
17  }
18 
19  override bool ActivateCondition(PlayerBase player)
20  {
21  return false;
22  }
23 
24  override void OnReconnect(PlayerBase player)
25  {
26  OnActivate(player);
27  }
28 
29  override string GetDebugText()
30  {
31  return (ANTIBIOTICS_LIFETIME - GetAttachedTime()).ToString();
32  }
33 
34 
35  override string GetDebugTextSimple()
36  {
37  return (ANTIBIOTICS_LIFETIME - GetAttachedTime()).ToString();
38  }
39 
40  override void OnActivate(PlayerBase player)
41  {
42  player.IncreaseHealingsCount();
43  player.IncreaseAntibioticsCount();
44  /*
45  if ( player.GetNotifiersManager() )
46  player.GetNotifiersManager().ActivateByType(eNotifiers.NTF_PILLS);
47  */
48  }
49 
50  override void OnDeactivate(PlayerBase player)
51  {
52  player.DecreaseHealingsCount();
53  player.DecreaseAntibioticsCount();
54  /*
55  if ( player.GetNotifiersManager() )
56  player.GetNotifiersManager().DeactivateByType(eNotifiers.NTF_PILLS);
57  */
58  }
59 
60  override bool DeactivateCondition(PlayerBase player)
61  {
62  float attached_time = GetAttachedTime();
63 
64  if ( attached_time >= m_RegenTime )
65  {
66  return true;
67  }
68  else
69  {
70  return false;
71  }
72  }
73 
74  override void OnTick(PlayerBase player, float deltaT)
75  {
76  player.AntibioticsAttack( ANTIBIOTICS_STRENGTH * deltaT );
77  }
78 };
m_TickIntervalActive
float m_TickIntervalActive
Definition: modifierbase.c:19
m_TrackActivatedTime
bool m_TrackActivatedTime
Definition: modifierbase.c:15
PlayerBase
Definition: playerbaseclient.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
DisableActivateCheck
void DisableActivateCheck()
Definition: modifierbase.c:78
m_ID
protected int m_ID
ID of effect, given by SEffectManager when registered (automatically done when playing through it)
Definition: effect.c:49
AntibioticsMdfr
Definition: antibiotics.c:1
DEFAULT_TICK_TIME_INACTIVE
const int DEFAULT_TICK_TIME_INACTIVE
Definition: modifiersmanager.c:33