Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
boneregen.c
Go to the documentation of this file.
2 {
3  private const float MINIMAL_WATER_TO_REGENRATE = 2500;
4  private const float MINIMAL_ENERGY_TO_REGENRATE = 4000;
5  private const float MINIMAL_BLOOD_TO_REGENRATE = 5000;
6  private const float MINIMAL_BLOOD_REQUIRED_TO_REGENERATE_HEALTH = 5000;
7  private const float BONE_HEALTH_INCREMENT_PER_SEC = 0.25;
8 
9  override void Init()
10  {
11  m_TrackActivatedTime = false;
12  m_ID = eModifiers.MDF_BONE_REGEN;
15  }
16 
17  override bool ActivateCondition(PlayerBase player)
18  {
19  if ( player.GetHealth("GlobalHealth", "Blood") >= MINIMAL_BLOOD_TO_REGENRATE && player.GetStatWater().Get() >= MINIMAL_WATER_TO_REGENRATE && player.GetStatEnergy().Get() >= MINIMAL_ENERGY_TO_REGENRATE )
20  {
21  return true;
22  }
23  else
24  {
25  return false;
26  }
27  }
28 
29  override void OnActivate(PlayerBase player)
30  {
31  }
32 
33  override bool DeactivateCondition(PlayerBase player)
34  {
35  if ( player.GetHealth("GlobalHealth", "Blood") < MINIMAL_BLOOD_TO_REGENRATE && player.GetStatWater().Get() < MINIMAL_WATER_TO_REGENRATE && player.GetStatEnergy().Get() < MINIMAL_ENERGY_TO_REGENRATE )
36  {
37  return true;
38  }
39  else
40  {
41  return false;
42  }
43  }
44 
45  override void OnTick(PlayerBase player, float deltaT)
46  {
47  /*
48  player.AddHealth("RightArm","Health",BONE_HEALTH_INCREMENT_PER_SEC * deltaT);
49  player.AddHealth("RightHand","Health",BONE_HEALTH_INCREMENT_PER_SEC * deltaT);
50  player.AddHealth("LeftArm","Health",BONE_HEALTH_INCREMENT_PER_SEC * deltaT);
51  player.AddHealth("LeftHand","Health",+BONE_HEALTH_INCREMENT_PER_SEC * deltaT);
52 
53  player.AddHealth("RightLeg","Health",+BONE_HEALTH_INCREMENT_PER_SEC * deltaT);
54  player.AddHealth("RightFoot","Health",+BONE_HEALTH_INCREMENT_PER_SEC * deltaT);
55  player.AddHealth("LeftLeg","Health",+BONE_HEALTH_INCREMENT_PER_SEC * deltaT);
56  player.AddHealth("LeftFoot","Health",+BONE_HEALTH_INCREMENT_PER_SEC * deltaT);
57 
58  player.AddHealth("Torso","Health",+BONE_HEALTH_INCREMENT_PER_SEC * deltaT);
59  */
60  }
61 };
BoneRegenMdfr
Definition: boneregen.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
m_TickIntervalInactive
float m_TickIntervalInactive
Definition: modifierbase.c:18
eModifiers
eModifiers
Definition: emodifiers.c:1
ModifierBase
Definition: breathvapourmdfr.c:3
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