Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
bloodloss.c
Go to the documentation of this file.
1 class BloodLoss extends SymptomBase
2 {
3  Material m_MatGauss;
4  const int BLUR_DURATION = 3000;
5  float m_BloodSet;
6  PPERequester_BloodLoss m_RequesterBloodLoss;
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  {
21  Class.CastTo(m_RequesterBloodLoss,PPERequester_BloodLoss.Cast(PPERequesterBank.GetRequester(PPERequester_BloodLoss)));
22  }
23 
24  }
25 
27  override void OnUpdateServer(PlayerBase player, float deltatime)
28  {
29  }
30 
31  override void OnUpdateClient(PlayerBase player, float deltatime)
32  {
33  if ( player.IsPlayerSelected() && player.GetTransferValues() && player.GetTransferValues().GetBlood() != m_BloodSet )
34  {
35  m_BloodSet = player.GetTransferValues().GetBlood();
36  if (m_BloodSet < 1.0)
37  {
38  m_RequesterBloodLoss.SetBloodLossLevel(m_BloodSet);
39  }
40  else
41  {
42  m_RequesterBloodLoss.Stop();
43  }
44  }
45  }
46 
48  override void OnGetActivatedServer(PlayerBase player)
49  {
50  if (LogManager.IsSymptomLogEnable()) Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetActivated", m_Player.ToString());
51  }
52 
53  override void OnGetActivatedClient(PlayerBase player)
54  {
55  if (LogManager.IsSymptomLogEnable()) Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetActivated", m_Player.ToString());
56  }
57 
58  override void OnGetDeactivatedServer(PlayerBase player)
59  {
60  if (LogManager.IsSymptomLogEnable()) Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetDeactivated", m_Player.ToString());
61  }
62 
64  override void OnGetDeactivatedClient(PlayerBase player)
65  {
66  if (LogManager.IsSymptomLogEnable()) Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetDeactivated", m_Player.ToString());
67  }
68 }
GetGame
proto native CGame GetGame()
LogManager
Definition: debug.c:734
m_Priority
int m_Priority
Definition: bioslobbyservice.c:34
SymptomBase
Definition: statebase.c:1
m_SymptomType
int m_SymptomType
Definition: smptanimmeta.c:13
ToString
proto string ToString()
PlayerBase
Definition: playerbaseclient.c:1
OnUpdateServer
void OnUpdateServer(float deltatime, float blood_scale, bool no_blood_loss)
Definition: bleedingsource.c:114
OnUpdateClient
void OnUpdateClient(ActionData action_data)
Definition: actionbase.c:998
Material
Definition: proto.c:267
m_Player
DayZPlayer m_Player
Definition: hand_events.c:42
m_IsPersistent
bool m_IsPersistent
Definition: modifierbase.c:16
SymptomTypes
SymptomTypes
Definition: statemanager.c:26
Debug
Definition: debug.c:13
OnInit
void OnInit()
Definition: aibehaviour.c:49
Class
Super root of all classes in Enforce script.
Definition: enscript.c:10
m_ID
protected int m_ID
ID of effect, given by SEffectManager when registered (automatically done when playing through it)
Definition: effect.c:49