Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
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 {
11 m_ID = eModifiers.MDF_BLEEDING;
14
15 if( GetGame().IsServer() )
16 {
17 m_AdminLog = PluginAdminLog.Cast( GetPlugin(PluginAdminLog) );
18 }
19
21 }
22
23 override bool ActivateCondition(PlayerBase player)
24 {
25 float blood = player.GetHealth("","Blood");
26
27 if( blood < PlayerConstants.BLOOD_THRESHOLD_FATAL )
28 {
29 return true;
30 }
31 return false;
32
33 }
34
35 override void OnActivate(PlayerBase player)
36 {
37 player.SetHealth("","",-1000);
38
39 if ( m_AdminLog )
40 {
41 m_AdminLog.BleedingOut( player );
42 }
43 }
44
45 override void OnDeactivate(PlayerBase player)
46 {
47
48 }
49
50 override bool DeactivateCondition(PlayerBase player)
51 {
52 return false;
53 }
54
55 override void OnTick(PlayerBase player, float deltaT)
56 {
57
58 }
59};
override void OnActivate(PlayerBase player)
Definition bleeding.c:35
const float BLOOD_DECREMENT_PER_SEC
Definition bleeding.c:4
override void Init()
Definition bleeding.c:7
override void OnTick(PlayerBase player, float deltaT)
Definition bleeding.c:55
PluginAdminLog m_AdminLog
Definition bleeding.c:5
override bool ActivateCondition(PlayerBase player)
Definition bleeding.c:23
override void OnDeactivate(PlayerBase player)
Definition bleeding.c:45
override bool DeactivateCondition(PlayerBase player)
Definition bleeding.c:50
int m_ID
ID of effect, given by SEffectManager when registered (automatically done when playing through it)
Definition effect.c:51
eModifiers
Definition emodifiers.c:2
proto native CGame GetGame()
bool m_TrackActivatedTime
overall time this modifier was active
void DisableDeactivateCheck()
bool m_AnalyticsStatsEnabled
float m_TickIntervalActive
float m_TickIntervalInactive
const int DEFAULT_TICK_TIME_INACTIVE
enum eModifierSyncIDs DEFAULT_TICK_TIME_ACTIVE
PluginBase GetPlugin(typename plugin_type)