DayZ 1.24
Loading...
Searching...
No Matches
StaminaEvents.c
Go to the documentation of this file.
2{
3 const int MAX_VOLUME = 4;
9
14
15 override void OnPlay(PlayerBase player)
16 {
17 super.OnPlay(player);
18
19 MaskBase mask = MaskBase.Cast(player.GetInventory().FindAttachment(InventorySlots.GetSlotIdFromString("Mask")));
20
21 float rel_volume = 1;
22 if (mask)
23 {
24 if (mask.IsExternalFilterAttached() || mask.HasIntegratedFilter())
25 rel_volume = Math.Lerp(MAX_VOLUME, 1, mask.GetFilterQuantity01());
26 }
27
30
31#ifdef DIAG_DEVELOPER
32 if (!DiagMenu.GetBool(DiagMenuIDs.MISC_BREATH_VAPOR_LVL))//disabled in debug, do not spawn particles
33 return;
34#endif
35
36 if (player.CanSpawnBreathVaporEffect())
37 player.SpawnBreathVaporEffect();
38
39
41
42 }
43
44
45}
47{
48 void StaminaDownLight()
49 {
50 m_ID = EPlayerSoundEventID.STAMINA_DOWN_LIGHT;
52 }
53}
54
58 {
59 m_ID = EPlayerSoundEventID.STAMINA_DOWN_HEAVY;
61 }
62}
63
65{
66 void StaminaUpHeavy()
67 {
68 m_ID = EPlayerSoundEventID.STAMINA_UP_HEAVY;
70 }
71}
72
74{
76 {
77 m_ID = EPlayerSoundEventID.STAMINA_UP_LIGHT;
79 }
80}
81
83{
84 void StaminaUpEnd()
85 {
86 m_ID = EPlayerSoundEventID.STAMINA_UP_END;
88 }
89
91 {
92 return false;
93 }
94}
95
97{
99 {
102 m_ID = EPlayerSoundEventID.STAMINA_NORMAL_DUMMY;
103 m_IsDummyType = true;
104 m_DummySoundLength = 3000;//in ms
105 }
106}
107
108
109// Low filter
111{
115 }
116}
117
119{
121 {
122 m_ID = EPlayerSoundEventID.STAMINA_LOW_FILTER_UPPER;
124 }
125}
126
128{
131 m_ID = EPlayerSoundEventID.STAMINA_LOW_FILTER_MID;
133 }
134}
135
136class StaminaLowFilterLower extends StaminaLowFilterBase
137{
139 {
140 m_ID = EPlayerSoundEventID.STAMINA_LOW_FILTER_LOWER;
142 }
143}
eBleedingSourceType m_Type
DiagMenuIDs
Definition EDiagMenuIDs.c:2
int m_ID
ID of effect, given by SEffectManager when registered (automatically done when playing through it)
Definition Effect.c:49
EPlayerSoundEventType
bool m_IsDummyType
float m_DummySoundLength
EPlayerSoundEventType m_HasPriorityOverTypes
bool m_ProcessPlaybackEvent
AbstractWave m_SoundSetCallback
Definition SoundEvents.c:80
int m_SoundVoiceAnimEventClassID
Definition SoundEvents.c:83
class StaminaDownHeavy extends StaminaSoundEventBase StaminaUpHeavy()
class StaminaUpLight extends StaminaSoundEventBase StaminaUpEnd()
void StaminaDownHeavy()
class StaminaSoundEventBase extends PlayerSoundEventBase StaminaDownLight()
override bool HasPriorityOverCurrent(PlayerBase player, EPlayerSoundEventID other_state_id, EPlayerSoundEventType type_other)
void StaminaNormalDummy()
class StaminaNormalDummy extends StaminaSoundEventBase StaminaLowFilterBase()
void StaminaUpLight()
void StaminaLowFilterUpper()
const int MAX_VOLUME
class StaminaLowFilterUpper extends StaminaLowFilterBase StaminaLowFilterMid()
proto void SetVolumeRelative(float value)
provides access to slot configuration
static proto native int GetSlotIdFromString(string slot_name)
converts string to slot_id
Definition EnMath.c:7
override bool HasPriorityOverCurrent(PlayerBase player, EPlayerSoundEventID other_state_id, EPlayerSoundEventType type_other)
override void OnPlay(PlayerBase player)
static proto bool GetBool(int id, bool reverse=false)
Get value as bool from the given script id.
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.