Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
hemolyticreaction.c
Go to the documentation of this file.
2 {
3  private float m_RunningTime;
4 
5  override void Init()
6  {
8  m_ID = eModifiers.MDF_HEMOLYTIC_REACTION;
11  m_IsPersistent = true;
12  m_RunningTime = CalculateRunTime();
13 
15  }
16  override bool ActivateCondition(PlayerBase player)
17  {
18  return false;
19  }
20 
21  override void OnActivate(PlayerBase player)
22  {
23  player.IncreaseDiseaseCount();
24  }
25 
26  override void OnDeactivate(PlayerBase player)
27  {
28  player.DecreaseDiseaseCount();
29  }
30 
31  override void OnReconnect(PlayerBase player)
32  {
33  OnActivate(player);
34  }
35 
36  override bool DeactivateCondition(PlayerBase player)
37  {
38  float attached_time = GetAttachedTime();
39 
40  if(attached_time > m_RunningTime )
41  {
42  return true;
43  }
44  else
45  {
46  return false;
47  }
48  }
49 
50  override void OnTick(PlayerBase player, float deltaT)
51  {
52  player.AddHealth("","Blood",-PlayerConstants.HEMOLYTIC_BLOOD_DRAIN_PER_SEC * deltaT);
53  }
54 
55  float CalculateRunTime()
56  {
57  float time = PlayerConstants.HEMOLYTIC_BLOODLOSS_AMOUNT / PlayerConstants.SALINE_BLOOD_REGEN_PER_SEC;
58  return time;
59  }
60 };
HemolyticReactionMdfr
Definition: hemolyticreaction.c:1
m_TickIntervalActive
float m_TickIntervalActive
Definition: modifierbase.c:19
m_TrackActivatedTime
bool m_TrackActivatedTime
Definition: modifierbase.c:15
DEFAULT_TICK_TIME_ACTIVE
const int DEFAULT_TICK_TIME_ACTIVE
Definition: modifiersmanager.c:31
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
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
DEFAULT_TICK_TIME_INACTIVE
const int DEFAULT_TICK_TIME_INACTIVE
Definition: modifiersmanager.c:33