DayZ 1.24
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
15 {
16 return m_Player.GetModifiersManager().IsModifierActive(eModifiers.MDF_CONTAMINATION2) || m_Player.GetModifiersManager().IsModifierActive(eModifiers.MDF_CONTAMINATION3);
17 }
18
19
22 {
23
24 }
25
27 {
28 }
29
30 override void OnAnimationStart()
31 {
32 if (IsContaminationActive())
33 {
35 module_lifespan.UpdateBloodyHandsVisibilityEx(m_Player, eBloodyHandsTypes.JUST_BLOOD);
36 }
37 }
38
39
41 {
42 return new SmptAnimMetaADD();
43 }
44
47 {
48 if (m_Manager.GetCurrentCommandID() == DayZPlayerConstants.COMMANDID_MOVE && !player.IsRaised() && player.GetCommand_Move() && player.GetCommand_Move() && !player.GetCommand_Move().IsOnBack())
49 PlayAnimationADD(1);
50 else
51 PlaySound(EPlayerSoundEventID.SYMPTOM_COUGH);
52 player.SpreadAgentsEx(3);
53
54 if (IsContaminationActive())
55 player.AddHealth("", "Blood", -COUGH_BLOOD_LOSS);
56 }
57
60 {
61 //if (LogManager.IsSymptomLogEnable()) Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetActivated", m_Player.ToString());
62 }
63
66 {
67 //if (LogManager.IsSymptomLogEnable()) Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetDeactivated", m_Player.ToString());
68 }
69
72 {
73 //if (LogManager.IsSymptomLogEnable()) Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetDeactivated", m_Player.ToString());
74 }
75}
int m_Priority
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
void PlaySound()
ModifiersManager m_Manager
void PluginLifespan()
eBloodyHandsTypes
PluginBase GetPlugin(typename plugin_type)
int m_SymptomType
SymptomTypes
override void OnGetActivatedClient(PlayerBase player)
gets called once on a Symptom which is being activated
Definition CoughState.c:59
override void OnAnimationStart()
Definition CoughState.c:30
override SmptAnimMetaBase SpawnAnimMetaObject()
Definition CoughState.c:40
override void OnInit()
Definition CoughState.c:5
override void OnGetActivatedServer(PlayerBase player)
gets called once on an Symptom which is being activated
Definition CoughState.c:46
override void OnGetDeactivatedServer(PlayerBase player)
only gets called once on an active Symptom that is being deactivated
Definition CoughState.c:65
override void OnUpdateClient(PlayerBase player, float deltatime)
Definition CoughState.c:26
override void OnUpdateServer(PlayerBase player, float deltatime)
gets called every frame
Definition CoughState.c:21
override void OnGetDeactivatedClient(PlayerBase player)
only gets called once on an active Symptom that is being deactivated
Definition CoughState.c:71
bool IsContaminationActive()
Definition CoughState.c:14
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597
eModifiers
Definition eModifiers.c:2