Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
coughstate.c
Go to the documentation of this file.
1class CoughSymptom extends SymptomBase
2{
3 const int COUGH_BLOOD_LOSS = 50;
4 //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
5 override void OnInit()
6 {
8 m_Priority = 100;
9 m_ID = SymptomIDs.SYMPTOM_COUGH;
10 m_DestroyOnAnimFinish = true;
11 m_SyncToClient = false;
12 }
13
14 bool IsContaminationActive()
15 {
16 return m_Player.GetModifiersManager().IsModifierActive(eModifiers.MDF_CONTAMINATION2) || m_Player.GetModifiersManager().IsModifierActive(eModifiers.MDF_CONTAMINATION3);
17 }
18
19
21 override void OnUpdateServer(PlayerBase player, float deltatime)
22 {
23
24 }
25
26 override void OnUpdateClient(PlayerBase player, float deltatime)
27 {
28 }
29
30 override void OnAnimationStart()
31 {
32 if ( IsContaminationActive() )
33 {
34 PluginLifespan module_lifespan = PluginLifespan.Cast( GetPlugin( PluginLifespan ) );
35 module_lifespan.UpdateBloodyHandsVisibilityEx( m_Player, eBloodyHandsTypes.JUST_BLOOD );
36 }
37 }
38
39
41 {
42 return new SmptAnimMetaADD();
43 }
44
46 override void OnGetActivatedServer(PlayerBase player)
47 {
48 if( m_Manager.GetCurrentCommandID() == DayZPlayerConstants.COMMANDID_MOVE && !player.IsRaised() && player.GetCommand_Move() && player.GetCommand_Move() && !player.GetCommand_Move().IsOnBack())
49 {
50 PlayAnimationADD(1);
51 }
52 else
53 {
54 PlaySound(EPlayerSoundEventID.SYMPTOM_COUGH);
55 }
56 player.SpreadAgentsEx(3);
57
58 if ( IsContaminationActive() )
59 player.AddHealth("","Blood", -COUGH_BLOOD_LOSS);
60 }
61
63 override void OnGetActivatedClient(PlayerBase player)
64 {
65 //if (LogManager.IsSymptomLogEnable()) Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetActivated", m_Player.ToString());
66 }
67
69 override void OnGetDeactivatedServer(PlayerBase player)
70 {
71 //if (LogManager.IsSymptomLogEnable()) Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetDeactivated", m_Player.ToString());
72 }
73
75 override void OnGetDeactivatedClient(PlayerBase player)
76 {
77 //if (LogManager.IsSymptomLogEnable()) Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetDeactivated", m_Player.ToString());
78 }
79}
void OnAnimationStart()
void OnGetActivatedServer(PlayerBase player)
gets called once on an Symptom which is being activated
void OnGetActivatedClient(PlayerBase player)
void OnInit()
this is just for the Symptom parameters set-up and is called even if the Symptom doesn't execute,...
void OnGetDeactivatedClient(PlayerBase player)
void OnUpdateClient(PlayerBase player, float deltatime)
gets called every frame
void OnUpdateServer(PlayerBase player, float deltatime)
gets called every frame
void OnGetDeactivatedServer(PlayerBase player)
only gets called once on an active Symptom that is being deactivated
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602
int m_ID
ID of effect, given by SEffectManager when registered (automatically done when playing through it)
Definition effect.c:51
eModifiers
Definition emodifiers.c:2
override SmptAnimMetaBase SpawnAnimMetaObject()
DayZPlayer m_Player
Definition hand_events.c:42
void PlaySound()
ModifiersManager m_Manager
void PluginLifespan()
eBloodyHandsTypes
PluginBase GetPlugin(typename plugin_type)
int m_SymptomType
SymptomTypes