Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
bullethitstate.c
Go to the documentation of this file.
1 /*
2 class BulletHitSymptom extends SymptomBase
3 {
4  float m_HitDuration;
5  float m_BreakPoint;
6  float m_TimeActive;
7  //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
8  override void OnInit()
9  {
10  m_SymptomType = SymptomTypes.SECONDARY;
11  m_Priority = 0;
12  m_ID = SymptomIDs.SYMPTOM_BULLET_HIT;
13  m_DestroyOnAnimFinish = true;
14  m_SyncToClient = false;
15  m_HitDuration = 0.4;
16  m_BreakPoint = 0.1;
17  }
18 
19  override void OnUpdateClient(PlayerBase player, float deltatime)
20  {
21  m_TimeActive += deltatime;
22  if(m_TimeActive >= m_HitDuration)
23  {
24  RequestDestroy();
25  }
26 
27  float value;
28 
29  if( m_TimeActive <= m_BreakPoint )
30  {
31  value = Math.InverseLerp(0, m_BreakPoint, m_TimeActive);
32  }
33  else
34  {
35  float tmp_value = Math.InverseLerp(m_BreakPoint, m_HitDuration, m_TimeActive);
36  value = 1 - tmp_value;
37  }
38 
39  PPEffects.HitEffect(value);
40 
41  }
42 
43 
44  override void OnGetActivatedClient(PlayerBase player)
45  {
46  //PPEffects.EnableBurlapSackBlindness();
47  //PPEffects.HitEffect(1);
48 
49  }
50 
52  override void OnGetDeactivatedClient(PlayerBase player)
53  {
54  PPEffects.HitEffect(0);
55  Debug.Log("OnGetDeactivated CoughSymptom called", "PlayerSymptom");
56  }
57 
58 }
59 */