DayZ 1.24
Loading...
Searching...
No Matches
BloodLoss.c
Go to the documentation of this file.
1class BloodLoss extends SymptomBase
2{
3 Material m_MatGauss;
4 const int BLUR_DURATION = 3000;
5 float m_BloodSet;
7
8 //this is just for the Symptom parameters set-up and is called even if the Symptom doesn't execute, don't put any gameplay code in here
9 override void OnInit()
10 {
11 m_SymptomType = SymptomTypes.SECONDARY;
12 m_Priority = 0;
13 m_ID = SymptomIDs.SYMPTOM_BLOODLOSS;
14 m_DestroyOnAnimFinish = true;
15 m_IsPersistent = false;
16 m_SyncToClient = true;
17 m_BloodSet = -1;
18
19 if (!GetGame().IsDedicatedServer())
20 Class.CastTo(m_RequesterBloodLoss, PPERequester_BloodLoss.Cast(PPERequesterBank.GetRequester(PPERequester_BloodLoss)));
21
22 }
23
26 {
27 }
28
30 {
31 if (player.IsPlayerSelected() && player.GetTransferValues() && player.GetTransferValues().GetBlood() != m_BloodSet)
32 {
33 m_BloodSet = player.GetTransferValues().GetBlood();
34 if (m_BloodSet < 1.0)
35 m_RequesterBloodLoss.SetBloodLossLevel(m_BloodSet);
36 else
37 m_RequesterBloodLoss.Stop();
38 }
39 }
40
43 {
44 if (LogManager.IsSymptomLogEnable()) Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetActivated", m_Player.ToString());
45 }
46
48 {
49 if (LogManager.IsSymptomLogEnable()) Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetActivated", m_Player.ToString());
50 }
51
53 {
54 if (LogManager.IsSymptomLogEnable()) Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetDeactivated", m_Player.ToString());
55 }
56
59 {
60 if (LogManager.IsSymptomLogEnable()) Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetDeactivated", m_Player.ToString());
61 }
62}
int m_Priority
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_IsPersistent
int m_SymptomType
SymptomTypes
Super root of all classes in Enforce script.
Definition EnScript.c:11
Definition Debug.c:14
static void SymptomLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Definition Debug.c:153
static bool IsSymptomLogEnable()
Definition Debug.c:789
override void OnGetActivatedClient(PlayerBase player)
Definition BloodLoss.c:47
override void OnInit()
Definition BloodLoss.c:9
override void OnGetActivatedServer(PlayerBase player)
gets called once on an Symptom which is being activated
Definition BloodLoss.c:42
override void OnGetDeactivatedServer(PlayerBase player)
Definition BloodLoss.c:52
override void OnUpdateClient(PlayerBase player, float deltatime)
Definition BloodLoss.c:29
PPERequester_BloodLoss m_RequesterBloodLoss
Definition BloodLoss.c:6
float m_BloodSet
Definition BloodLoss.c:5
override void OnUpdateServer(PlayerBase player, float deltatime)
gets called every frame
Definition BloodLoss.c:25
override void OnGetDeactivatedClient(PlayerBase player)
only gets called once on an active Symptom that is being deactivated
Definition BloodLoss.c:58
proto native CGame GetGame()
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.