DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
Loading...
Searching...
No Matches
StaminaEvents.c
Go to the documentation of this file.
2{
3 const int MAX_VOLUME = 4;
5 {
8 }
9
10 override bool HasPriorityOverCurrent(PlayerBase player, EPlayerSoundEventID other_state_id, EPlayerSoundEventType type_other)
11 {
12 return false;
13 }
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 {
26 rel_volume = Math.Lerp(MAX_VOLUME,1,mask.GetFilterQuantity01());
27 }
28 }
29
32
33 #ifdef DIAG_DEVELOPER
34 if (!DiagMenu.GetBool(DiagMenuIDs.MISC_BREATH_VAPOR_LVL))//disabled in debug, do not spawn particles
35 return;
36 #endif
37
38 if ( player.CanSpawnBreathVaporEffect() )
39 player.SpawnBreathVaporEffect();
40
41
43
44 }
45
46
47}
49{
50 void StaminaDownLight()
51 {
52 m_ID = EPlayerSoundEventID.STAMINA_DOWN_LIGHT;
54 }
55}
56
60 {
61 m_ID = EPlayerSoundEventID.STAMINA_DOWN_HEAVY;
63 }
64}
65
67{
68 void StaminaUpHeavy()
69 {
70 m_ID = EPlayerSoundEventID.STAMINA_UP_HEAVY;
72 }
73}
74
76{
78 {
79 m_ID = EPlayerSoundEventID.STAMINA_UP_LIGHT;
81 }
82}
83
85{
86 void StaminaUpEnd()
87 {
88 m_ID = EPlayerSoundEventID.STAMINA_UP_END;
90 }
91
92 override bool HasPriorityOverCurrent(PlayerBase player, EPlayerSoundEventID other_state_id, EPlayerSoundEventType type_other)
93 {
94 return false;
95 }
96}
97
99{
101 {
104 m_ID = EPlayerSoundEventID.STAMINA_NORMAL_DUMMY;
105 m_IsDummyType = true;
106 m_DummySoundLength = 3000;//in ms
107 }
108}
109
110
111// Low filter
113{
117 }
118}
119
121{
123 {
124 m_ID = EPlayerSoundEventID.STAMINA_LOW_FILTER_UPPER;
126 }
127}
128
130{
133 m_ID = EPlayerSoundEventID.STAMINA_LOW_FILTER_MID;
135 }
136}
137
138class StaminaLowFilterLower extends StaminaLowFilterBase
139{
141 {
142 m_ID = EPlayerSoundEventID.STAMINA_LOW_FILTER_LOWER;
144 }
145}
eBleedingSourceType m_Type
DiagMenuIDs
Definition EDiagMenuIDs.c:2
protected 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:86
int m_SoundVoiceAnimEventClassID
Definition SoundEvents.c:89
void StaminaNormalDummy()
class StaminaDownHeavy extends StaminaSoundEventBase StaminaUpHeavy()
override bool HasPriorityOverCurrent(PlayerBase player, EPlayerSoundEventID other_state_id, EPlayerSoundEventType type_other)
class StaminaUpLight extends StaminaSoundEventBase StaminaUpEnd()
void StaminaUpLight()
void StaminaLowFilterUpper()
class StaminaSoundEventBase extends PlayerSoundEventBase StaminaDownLight()
const int MAX_VOLUME
class StaminaLowFilterUpper extends StaminaLowFilterBase StaminaLowFilterMid()
void StaminaDownHeavy()
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 void OnPlay(PlayerBase player)
override bool HasPriorityOverCurrent(PlayerBase player, EPlayerSoundEventID other_state_id, EPlayerSoundEventType type_other)
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'.