Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
vomitstate.c
Go to the documentation of this file.
1 class VomitSymptom extends SymptomBase
2 {
3  //just for the Symptom parameters set-up and gets called even if the Symptom doesn't execute, don't put any gameplay code in here
4  const int BLOOD_LOSS = 250;
5  override void OnInit()
6  {
7  m_SymptomType = SymptomTypes.PRIMARY;
8  m_Priority = 100;
9  m_ID = SymptomIDs.SYMPTOM_VOMIT;
10  m_DestroyOnAnimFinish = true;
11  m_SyncToClient = false;
12  m_Duration = 5;
13  m_MaxCount = 1;
14  }
15 
17  override void OnUpdateServer(PlayerBase player, float deltatime)
18  {
19 
20  }
21 
22  override void OnUpdateClient(PlayerBase player, float deltatime)
23  {
24 
25  }
26 
27  bool IsContaminationActive()
28  {
29  return m_Player.GetModifiersManager().IsModifierActive(eModifiers.MDF_CONTAMINATION2) || m_Player.GetModifiersManager().IsModifierActive(eModifiers.MDF_CONTAMINATION3);
30  }
31 
32  override void OnAnimationStart()
33  {
34  if(m_Player)
35  {
36  m_Player.GetStatToxicity().Set(0);
37  if(m_Player.m_PlayerStomach)
38  m_Player.m_PlayerStomach.ClearContents();
39 
40  if (IsContaminationActive())
41  {
42  m_Player.AddHealth("","Blood", -BLOOD_LOSS);
43  }
44 
45  }
46  //Print("------------ vomit start -------------");
47  }
48 
49  override void OnAnimationFinish()
50  {
52  m_Player.GetStaminaHandler().DepleteStamina(EStaminaModifiers.OVERALL_DRAIN);
53 
54  if (IsContaminationActive())
55  {
56  PluginLifespan module_lifespan = PluginLifespan.Cast( GetPlugin( PluginLifespan ) );
57  module_lifespan.UpdateBloodyHandsVisibilityEx( m_Player, eBloodyHandsTypes.JUST_BLOOD );
58  }
59  }
60 
61  override bool CanActivate()
62  {
63  return ( m_Manager.GetCurrentCommandID() == DayZPlayerConstants.COMMANDID_MOVE || m_Manager.GetCurrentCommandID() == DayZPlayerConstants.COMMANDID_ACTION );
64  }
65 
67  override void OnGetActivatedServer(PlayerBase player)
68  {
69  PlayAnimationFB(DayZPlayerConstants.CMD_ACTIONFB_VOMIT,DayZPlayerConstants.STANCEMASK_CROUCH, GetDuration() );
70  //timer.Run(10, this, "Destroy");
71  //if (LogManager.IsSymptomLogEnable()) Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetActivated", m_Player.ToString());
72  }
73 
75  override void OnGetDeactivatedServer(PlayerBase player)
76  {
77  //if (LogManager.IsSymptomLogEnable()) Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetDeactivated", m_Player.ToString());
78  }
79 
80  override void OnGetDeactivatedClient(PlayerBase player)
81  {
82  //if (LogManager.IsSymptomLogEnable()) Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetDeactivated", m_Player.ToString());
83  }
84 
85  override SmptAnimMetaBase SpawnAnimMetaObject()
86  {
87  return new SmptAnimMetaFB();
88  }
89 }
m_Priority
int m_Priority
Definition: bioslobbyservice.c:34
m_Manager
ModifiersManager m_Manager
Definition: modifierbase.c:12
EStaminaModifiers
EStaminaModifiers
Definition: estaminamodifiers.c:1
eBloodyHandsTypes
eBloodyHandsTypes
Definition: pluginlifespan.c:8
m_Duration
float m_Duration
Definition: bullethitreaction.c:56
SymptomBase
Definition: statebase.c:1
m_SymptomType
int m_SymptomType
Definition: smptanimmeta.c:13
GetDuration
float GetDuration()
Definition: tools.c:313
GetPlugin
PluginBase GetPlugin(typename plugin_type)
Definition: pluginmanager.c:316
PlayerBase
Definition: playerbaseclient.c:1
OnUpdateServer
void OnUpdateServer(float deltatime, float blood_scale, bool no_blood_loss)
Definition: bleedingsource.c:114
PluginLifespan
void PluginLifespan()
Definition: pluginlifespan.c:45
OnUpdateClient
void OnUpdateClient(ActionData action_data)
Definition: actionbase.c:998
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition: dayzplayer.c:601
m_Player
DayZPlayer m_Player
Definition: hand_events.c:42
eModifiers
eModifiers
Definition: emodifiers.c:1
SymptomTypes
SymptomTypes
Definition: statemanager.c:26
OnInit
void OnInit()
Definition: aibehaviour.c:49
m_ID
protected int m_ID
ID of effect, given by SEffectManager when registered (automatically done when playing through it)
Definition: effect.c:49
SmptAnimMetaBase
Definition: smptanimmeta.c:82