Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
unconsciousness.c
Go to the documentation of this file.
2 {
3  const int UNCONSIOUSS_COOLDOWN_TIME = 60;//in s
4 
5  override void Init()
6  {
7  m_TrackActivatedTime = false;
8  m_ID = eModifiers.MDF_UNCONSCIOUSNESS;
11  }
12 
13  override bool ActivateCondition(PlayerBase player)
14  {
15  if( player.GetHealth("","Shock") <= PlayerConstants.UNCONSCIOUS_THRESHOLD )
16  {
17  return true;
18  }
19  return false;
20  }
21 
22  override void OnActivate(PlayerBase player)
23  {
24  DayZPlayerSyncJunctures.SendPlayerUnconsciousness(player, true);
25  }
26 
27  override void OnDeactivate(PlayerBase player)
28  {
29  player.m_UnconsciousEndTime = GetGame().GetTime();
30  DayZPlayerSyncJunctures.SendPlayerUnconsciousness(player, false);
31  }
32 
33  override string GetDebugText()
34  {
35  string text_pulse = "pulse type:"+m_Player.GetPulseType()+"|";
36  string text_shock = (PlayerConstants.CONSCIOUS_THRESHOLD - m_Player.GetHealth("","Shock")).ToString();
37  string debug_text = text_pulse + text_shock;
38  return debug_text;
39  }
40 
41  override void OnReconnect(PlayerBase player)
42  {
43  }
44 
45  override bool DeactivateCondition(PlayerBase player)
46  {
47  if( player.GetHealth("","Shock") >= PlayerConstants.CONSCIOUS_THRESHOLD && player.GetPulseType() == EPulseType.REGULAR )
48  {
49  return true;
50  }
51  return false;
52  }
53 
54  override void OnTick(PlayerBase player, float deltaT)
55  {
56 
57  }
58 };
GetGame
proto native CGame GetGame()
UnconsciousnessMdfr
Definition: unconsciousness.c:1
m_TickIntervalActive
float m_TickIntervalActive
Definition: modifierbase.c:19
m_TrackActivatedTime
bool m_TrackActivatedTime
Definition: modifierbase.c:15
ToString
proto string ToString()
PlayerBase
Definition: playerbaseclient.c:1
PlayerConstants
Definition: playerconstants.c:1
EPulseType
EPulseType
Definition: epulsetype.c:1
m_Player
DayZPlayer m_Player
Definition: hand_events.c:42
m_TickIntervalInactive
float m_TickIntervalInactive
Definition: modifierbase.c:18
eModifiers
eModifiers
Definition: emodifiers.c:1
ModifierBase
Definition: breathvapourmdfr.c:3
DayZPlayerSyncJunctures
Definition: dayzplayersyncjunctures.c:4
m_ID
protected int m_ID
ID of effect, given by SEffectManager when registered (automatically done when playing through it)
Definition: effect.c:49