DayZ 1.24
Loading...
Searching...
No Matches
VomitState.c
Go to the documentation of this file.
1class 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 {
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
18 {
19
20 }
21
23 {
24
25 }
26
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 m_Player.AddHealth("", "Blood", -BLOOD_LOSS);
42
43 }
44 //Print("------------ vomit start -------------");
45 }
46
47 override void OnAnimationFinish()
48 {
50 m_Player.GetStaminaHandler().DepleteStamina(EStaminaModifiers.OVERALL_DRAIN);
51
52 if (IsContaminationActive())
53 {
55 module_lifespan.UpdateBloodyHandsVisibilityEx(m_Player, eBloodyHandsTypes.JUST_BLOOD);
56 }
57 }
58
59 override bool CanActivate()
60 {
61 return (m_Manager.GetCurrentCommandID() == DayZPlayerConstants.COMMANDID_MOVE || m_Manager.GetCurrentCommandID() == DayZPlayerConstants.COMMANDID_ACTION);
62 }
63
66 {
67 PlayAnimationFB(DayZPlayerConstants.CMD_ACTIONFB_VOMIT, DayZPlayerConstants.STANCEMASK_CROUCH, GetDuration());
68 //timer.Run(10, this, "Destroy");
69 //if (LogManager.IsSymptomLogEnable()) Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetActivated", m_Player.ToString());
70 }
71
74 {
75 //if (LogManager.IsSymptomLogEnable()) Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetDeactivated", m_Player.ToString());
76 }
77
79 {
80 //if (LogManager.IsSymptomLogEnable()) Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetDeactivated", m_Player.ToString());
81 }
82
84 {
85 return new SmptAnimMetaFB();
86 }
87}
int m_Priority
float m_Duration
EStaminaModifiers
int m_ID
ID of effect, given by SEffectManager when registered (automatically done when playing through it)
Definition Effect.c:49
DayZPlayer m_Player
Definition Hand_Events.c:42
ModifiersManager m_Manager
void PluginLifespan()
eBloodyHandsTypes
PluginBase GetPlugin(typename plugin_type)
int m_SymptomType
SymptomTypes
void DepleteStamina(EStaminaModifiers modifier, float dT=-1)
override void OnAnimationStart()
Definition VomitState.c:32
override SmptAnimMetaBase SpawnAnimMetaObject()
Definition VomitState.c:83
override void OnInit()
Definition VomitState.c:5
override bool CanActivate()
Definition VomitState.c:59
override void OnGetActivatedServer(PlayerBase player)
gets called once on an Symptom which is being activated
Definition VomitState.c:65
override void OnGetDeactivatedServer(PlayerBase player)
only gets called once on an active Symptom that is being deactivated
Definition VomitState.c:73
override void OnUpdateClient(PlayerBase player, float deltatime)
Definition VomitState.c:22
override void OnAnimationFinish()
Definition VomitState.c:47
override void OnUpdateServer(PlayerBase player, float deltatime)
gets called every frame
Definition VomitState.c:17
override void OnGetDeactivatedClient(PlayerBase player)
Definition VomitState.c:78
bool IsContaminationActive()
Definition VomitState.c:27
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597
eModifiers
Definition eModifiers.c:2
float GetDuration()
Definition tools.c:297