DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
Loading...
Searching...
No Matches
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 {
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 {
25 }
26
27 override void OnDeactivate(PlayerBase player)
28 {
29 player.m_UnconsciousEndTime = GetGame().GetTime();
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};
EPulseType
Definition EPulseType.c:2
protected int m_ID
ID of effect, given by SEffectManager when registered (automatically done when playing through it)
Definition Effect.c:49
proto string ToString()
DayZPlayer m_Player
Definition Hand_Events.c:42
bool m_TrackActivatedTime
float m_TickIntervalActive
float m_TickIntervalInactive
proto int GetTime()
returns mission time in milliseconds
static void SendPlayerUnconsciousness(DayZPlayer pPlayer, bool enable)
static const float UNCONSCIOUS_THRESHOLD
static const float CONSCIOUS_THRESHOLD
override bool DeactivateCondition(PlayerBase player)
override void OnReconnect(PlayerBase player)
override void OnActivate(PlayerBase player)
override string GetDebugText()
const int UNCONSIOUSS_COOLDOWN_TIME
override void OnTick(PlayerBase player, float deltaT)
override void Init()
override bool ActivateCondition(PlayerBase player)
override void OnDeactivate(PlayerBase player)
eModifiers
Definition eModifiers.c:2
proto native CGame GetGame()