Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
bleeding.c
Go to the documentation of this file.
1 //checks for critical blood level and kills the character if bellow
3 {
4  protected const float BLOOD_DECREMENT_PER_SEC = -10;
5  PluginAdminLog m_AdminLog;
6 
7  override void Init()
8  {
9  m_TrackActivatedTime = false;
10  m_ID = eModifiers.MDF_BLEEDING;
13 
14  if( GetGame().IsServer() )
15  {
16  m_AdminLog = PluginAdminLog.Cast( GetPlugin(PluginAdminLog) );
17  }
18 
20  }
21 
22  override bool ActivateCondition(PlayerBase player)
23  {
24  float blood = player.GetHealth("","Blood");
25 
26  if( blood < PlayerConstants.BLOOD_THRESHOLD_FATAL )
27  {
28  return true;
29  }
30  return false;
31 
32  }
33 
34  override void OnActivate(PlayerBase player)
35  {
36  player.SetHealth("","",-1000);
37 
38  if ( m_AdminLog )
39  {
40  m_AdminLog.BleedingOut( player );
41  }
42  }
43 
44  override void OnDeactivate(PlayerBase player)
45  {
46 
47  }
48 
49  override bool DeactivateCondition(PlayerBase player)
50  {
51  return false;
52  }
53 
54  override void OnTick(PlayerBase player, float deltaT)
55  {
56 
57  }
58 };
GetGame
proto native CGame GetGame()
BleedingCheckMdfr
Definition: bleeding.c:2
m_AdminLog
PluginAdminLog m_AdminLog
Definition: emotemanager.c:150
m_TickIntervalActive
float m_TickIntervalActive
Definition: modifierbase.c:19
m_TrackActivatedTime
bool m_TrackActivatedTime
Definition: modifierbase.c:15
GetPlugin
PluginBase GetPlugin(typename plugin_type)
Definition: pluginmanager.c:316
DisableDeactivateCheck
void DisableDeactivateCheck()
Definition: modifierbase.c:83
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_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