Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
fatigue.c
Go to the documentation of this file.
2 {
3  private float m_Time;
4  private float m_NextEvent;
5 
6  static const float FATIGUE_EVENT_INTERVAL_MIN = 5;
7  static const float FATIGUE_EVENT_INTERVAL_MAX = 12;
8  static const float STAMINA_RECOVERY_MULTIPLIER = 0.33;
9  static const float STAMINA_DEPLETION_MULTIPLIER = 1.33;
10 
11  override void Init()
12  {
13  m_TrackActivatedTime = false;
14  m_ID = eModifiers.MDF_FATIGUE;
17  }
18 
19  override bool ActivateCondition(PlayerBase player)
20  {
21  return (player.GetModifiersManager().IsModifierActive(eModifiers.MDF_WOUND_INFECTION1) || player.GetModifiersManager().IsModifierActive(eModifiers.MDF_POISONING) || player.GetModifiersManager().IsModifierActive(eModifiers.MDF_WOUND_INFECTION2));
22  }
23 
24  override void OnActivate(PlayerBase player)
25  {
26  if( player.m_NotifiersManager )
27  player.m_NotifiersManager.ActivateByType(eNotifiers.NTF_FEVERISH);
28 
29 
30 
31  player.GetStaminaHandler().ActivateRecoveryModifier(EStaminaMultiplierTypes.FATIGUE);
32  player.GetStaminaHandler().ActivateDepletionModifier(EStaminaMultiplierTypes.FATIGUE);
33 
34  }
35 
36  override void OnReconnect(PlayerBase player)
37  {
38  this.OnActivate(player);
39  }
40 
41 
42  override void OnDeactivate(PlayerBase player)
43  {
44  //player.GetStaminaHandler().SetDepletionMultiplier(1);
45  player.GetStaminaHandler().DeactivateRecoveryModifier(EStaminaMultiplierTypes.FATIGUE);
46  player.GetStaminaHandler().DeactivateDepletionModifier(EStaminaMultiplierTypes.FATIGUE);
47  }
48 
49 
50  override bool DeactivateCondition(PlayerBase player)
51  {
52  return !ActivateCondition(player);
53  }
54 
55  override void OnTick(PlayerBase player, float deltaT)
56  {
57 
58  }
59 };
m_TickIntervalActive
float m_TickIntervalActive
Definition: modifierbase.c:19
m_TrackActivatedTime
bool m_TrackActivatedTime
Definition: modifierbase.c:15
EStaminaMultiplierTypes
EStaminaMultiplierTypes
Definition: staminahandler.c:1
DEFAULT_TICK_TIME_INACTIVE_LONG
const int DEFAULT_TICK_TIME_INACTIVE_LONG
Definition: modifiersmanager.c:34
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
eNotifiers
eNotifiers
Definition: notifiersmanager.c:1
FatigueMdfr
Definition: fatigue.c:1
m_ID
protected int m_ID
ID of effect, given by SEffectManager when registered (automatically done when playing through it)
Definition: effect.c:49