DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Файл PlayerSoundEventHandler.c

См. исходные тексты.

Перечисления

enum  EPlayerSoundEventID {
  HOLD_BREATH = 1 , EXHAUSTED_BREATH , RELEASE_BREATH , STAMINA_DOWN_LIGHT ,
  STAMINA_DOWN_HEAVY , STAMINA_UP_LIGHT , STAMINA_UP_HEAVY , STAMINA_UP_END ,
  STAMINA_NORMAL_DUMMY , TAKING_DMG_LIGHT , TAKING_DMG_HEAVY , SYMPTOM_COUGH ,
  SYMPTOM_LAUGHTER , SYMPTOM_SNEEZE , SYMPTOM_GASP , JUMP ,
  MELEE_ATTACK_LIGHT , INJURED_LIGHT , INJURED_MEDIUM , INJURED_HIGH ,
  FREEZING , HOT , SYMPTOM_FATIGUE , STAMINA_LOW_FILTER_UPPER ,
  STAMINA_LOW_FILTER_MID , STAMINA_LOW_FILTER_LOWER , DROWNING_BREATH , DROWNING_PAIN ,
  PICKUP_HEAVY , THIRST , FORCE_FEED , FORCE_DRINK ,
  ENUM_COUNT
}
 

Функции

void PlayerSoundEventHandler (PlayerBase player)
 
void RegisterState (PlayerSoundEventBase state)
 
void OnTick (float delta_time)
 
int ConvertAnimIDtoEventID (int anim_id)
 
static override EPlayerSoundEventType GetSoundEventType (int id)
 
override int GetCurrentStateEventID ()
 
override int GetCurrentStateEventType ()
 
override bool PlayRequestEx (EPlayerSoundEventID id, bool sent_from_server=false, int param=0)
 
override bool PlayRequest (EPlayerSoundEventID id, bool sent_from_server=false)
 

Переменные

enum EPlayerSoundEventID m_Player
 
const int SOUND_EVENTS_MAX = EPlayerSoundEventID.ENUM_COUNT
 
static ref PlayerSoundEventBase m_AvailableStates [SOUND_EVENTS_MAX]
 
static ref map< int, intm_ConfigIDToScriptIDmapping = new ref map<int,int>
 
ref PlayerSoundEventBase m_CurrentState
 
ref Timer m_UpdateTimer
 

Перечисления

◆ EPlayerSoundEventID

Элементы перечислений
HOLD_BREATH 
EXHAUSTED_BREATH 
RELEASE_BREATH 
STAMINA_DOWN_LIGHT 
STAMINA_DOWN_HEAVY 
STAMINA_UP_LIGHT 
STAMINA_UP_HEAVY 
STAMINA_UP_END 
STAMINA_NORMAL_DUMMY 
TAKING_DMG_LIGHT 
TAKING_DMG_HEAVY 
SYMPTOM_COUGH 
SYMPTOM_LAUGHTER 
SYMPTOM_SNEEZE 
SYMPTOM_GASP 
JUMP 
MELEE_ATTACK_LIGHT 
INJURED_LIGHT 
INJURED_MEDIUM 
INJURED_HIGH 
FREEZING 
HOT 
SYMPTOM_FATIGUE 
STAMINA_LOW_FILTER_UPPER 
STAMINA_LOW_FILTER_MID 
STAMINA_LOW_FILTER_LOWER 
DROWNING_BREATH 
DROWNING_PAIN 
PICKUP_HEAVY 
THIRST 
FORCE_FEED 
FORCE_DRINK 
ENUM_COUNT 
2{
3 HOLD_BREATH = 1,
18 JUMP,
25 HOT,
33 THIRST,
36 //--------------
37 // Count bellow, put enums above
38 //--------------
40}
@ JUMP
Definition PlayerSoundEventHandler.c:18
@ TAKING_DMG_LIGHT
Definition PlayerSoundEventHandler.c:12
@ SYMPTOM_FATIGUE
Definition PlayerSoundEventHandler.c:26
@ FORCE_DRINK
Definition PlayerSoundEventHandler.c:35
@ ENUM_COUNT
Definition PlayerSoundEventHandler.c:39
@ SYMPTOM_SNEEZE
Definition PlayerSoundEventHandler.c:16
@ RELEASE_BREATH
Definition PlayerSoundEventHandler.c:5
@ SYMPTOM_LAUGHTER
Definition PlayerSoundEventHandler.c:15
@ DROWNING_PAIN
Definition PlayerSoundEventHandler.c:31
@ THIRST
Definition PlayerSoundEventHandler.c:33
@ HOT
Definition PlayerSoundEventHandler.c:25
@ FORCE_FEED
Definition PlayerSoundEventHandler.c:34
@ STAMINA_UP_END
Definition PlayerSoundEventHandler.c:10
@ INJURED_MEDIUM
Definition PlayerSoundEventHandler.c:22
@ FREEZING
Definition PlayerSoundEventHandler.c:24
@ EXHAUSTED_BREATH
Definition PlayerSoundEventHandler.c:4
@ STAMINA_UP_LIGHT
Definition PlayerSoundEventHandler.c:8
@ INJURED_HIGH
Definition PlayerSoundEventHandler.c:23
@ SYMPTOM_GASP
Definition PlayerSoundEventHandler.c:17
@ MELEE_ATTACK_LIGHT
Definition PlayerSoundEventHandler.c:19
@ STAMINA_LOW_FILTER_LOWER
Definition PlayerSoundEventHandler.c:29
@ STAMINA_NORMAL_DUMMY
Definition PlayerSoundEventHandler.c:11
@ SYMPTOM_COUGH
Definition PlayerSoundEventHandler.c:14
@ HOLD_BREATH
Definition PlayerSoundEventHandler.c:3
@ STAMINA_LOW_FILTER_UPPER
Definition PlayerSoundEventHandler.c:27
@ PICKUP_HEAVY
Definition PlayerSoundEventHandler.c:32
@ INJURED_LIGHT
Definition PlayerSoundEventHandler.c:21
@ DROWNING_BREATH
Definition PlayerSoundEventHandler.c:30
@ STAMINA_DOWN_LIGHT
Definition PlayerSoundEventHandler.c:6
@ STAMINA_DOWN_HEAVY
Definition PlayerSoundEventHandler.c:7
@ STAMINA_LOW_FILTER_MID
Definition PlayerSoundEventHandler.c:28
@ STAMINA_UP_HEAVY
Definition PlayerSoundEventHandler.c:9
@ TAKING_DMG_HEAVY
Definition PlayerSoundEventHandler.c:13
Definition EntityAI.c:95

Функции

◆ ConvertAnimIDtoEventID()

int ConvertAnimIDtoEventID ( int anim_id)
118 {
120 }
static ref map< int, int > m_ConfigIDToScriptIDmapping
Definition PlayerSoundEventHandler.c:47

Перекрестные ссылки m_ConfigIDToScriptIDmapping.

◆ GetCurrentStateEventID()

override int GetCurrentStateEventID ( )
128 {
130 {
131 return m_CurrentState.GetSoundEventID();
132 }
133 return -1;
134 }
ref PlayerSoundEventBase m_CurrentState
Definition PlayerSoundEventHandler.c:48

Перекрестные ссылки m_CurrentState.

◆ GetCurrentStateEventType()

override int GetCurrentStateEventType ( )
137 {
139 {
140 return m_CurrentState.GetSoundEventType();
141 }
142 return -1;
143 }

Перекрестные ссылки m_CurrentState.

◆ GetSoundEventType()

static override EPlayerSoundEventType GetSoundEventType ( int id)
static
123 {
124 return m_AvailableStates[id].GetSoundEventType();
125 }
static ref PlayerSoundEventBase m_AvailableStates[SOUND_EVENTS_MAX]
Definition PlayerSoundEventHandler.c:46

Перекрестные ссылки m_AvailableStates.

◆ OnTick()

void OnTick ( float delta_time)
107 {
108 if (m_CurrentState)
109 {
110 if( m_CurrentState.IsFinished())
112 else
114 }
115 }

Перекрестные ссылки m_CurrentState.

◆ PlayerSoundEventHandler()

void PlayerSoundEventHandler ( PlayerBase player)
53 {
55
56 if(!m_UpdateTimer && !m_Player.IsControlledPlayer())
57 {
58 m_UpdateTimer = new Timer();
59 m_UpdateTimer.Run(1, this, "OnTick", null, true);//ticking for remotes, the controlled player is ticking on command handler at higher intervals
60 }
61
72 RegisterState(new DamageHeavySoundEvent());
79 RegisterState(new MeleeAttackHeavyEvent());
85 RegisterState(new HotSoundEvent());
88 RegisterState(new StaminaLowFilterLower());
90 RegisterState(new DrowningEvent2());
94 RegisterState(new ForceDrinkSoundEvent());
95
96 }
class DamageSoundEvents extends PlayerSoundEventBase DamageLightSoundEvent()
Definition DamageEvents.c:23
class DrowningSoundEventBase extends PlayerSoundEventBase DrowningEvent1()
Definition DrowningEvents.c:22
class HeatComfortEventsBase extends PlayerSoundEventBase FreezingSoundEvent()
Definition HeatComfortEvents.c:18
class ExhaustedBreathSoundEvent extends HoldBreathSoundEventBase ReleaseBreathSoundEvent()
Definition HoldBreathEvents.c:52
class HoldBreathSoundEventBase extends PlayerSoundEventBase HoldBreathSoundEvent()
Definition HoldBreathEvents.c:18
void ExhaustedBreathSoundEvent()
Definition HoldBreathEvents.c:53
void InjuryMediumSoundEvent()
Definition InjuryEvents.c:44
class InjuryMediumSoundEvent extends InjurySoundEvents InjuryHeavySoundEvent()
Definition InjuryEvents.c:43
class InjurySoundEvents extends PlayerSoundEventBase InjuryLightSoundEvent()
Definition InjuryEvents.c:23
class JumpEventsBase extends PlayerSoundEventBase JumpSoundEvent()
Definition JumpEvents.c:35
class MeleeAttackSoundEvents extends PlayerSoundEventBase MeleeAttackLightEvent()
Definition MeleeAttack.c:33
class ForceConsumeSoundEvent extends PlayerSoundEventBase ForceFeedSoundEvent()
Definition MiscEvents.c:34
class PickupHeavySoundEvent extends PlayerSoundEventBase ThirstSoundEvent()
Definition MiscEvents.c:14
void PickupHeavySoundEvent()
Definition MiscEvents.c:15
void RegisterState(PlayerSoundEventBase state)
Definition PlayerSoundEventHandler.c:98
enum EPlayerSoundEventID m_Player
ref Timer m_UpdateTimer
Definition PlayerSoundEventHandler.c:49
void StaminaNormalDummy()
Definition StaminaEvents.c:115
class StaminaDownHeavy extends StaminaSoundEventBase StaminaUpHeavy()
Definition StaminaEvents.c:68
class StaminaUpLight extends StaminaSoundEventBase StaminaUpEnd()
Definition StaminaEvents.c:86
void StaminaUpLight()
Definition StaminaEvents.c:87
void StaminaLowFilterUpper()
Definition StaminaEvents.c:132
class StaminaSoundEventBase extends PlayerSoundEventBase StaminaDownLight()
Definition StaminaEvents.c:50
class StaminaLowFilterUpper extends StaminaLowFilterBase StaminaLowFilterMid()
Definition StaminaEvents.c:131
void StaminaDownHeavy()
Definition StaminaEvents.c:69
class SymptomSoundEventBase extends PlayerSoundEventBase CoughSoundEvent()
Definition SymptomEvents.c:17
class GaspSoundEvent extends SymptomSoundEventBase FatigueSoundEvent()
Definition SymptomEvents.c:53
class LaugherSoundEvent extends SymptomSoundEventBase SneezeSoundEvent()
Definition SymptomEvents.c:35
void GaspSoundEvent()
Definition SymptomEvents.c:54
void LaugherSoundEvent()
Definition SymptomEvents.c:36
Definition DayZPlayerImplement.c:63

Перекрестные ссылки CoughSoundEvent(), DamageLightSoundEvent(), DrowningEvent1(), ExhaustedBreathSoundEvent(), FatigueSoundEvent(), ForceFeedSoundEvent(), FreezingSoundEvent(), GaspSoundEvent(), HoldBreathSoundEvent(), InjuryHeavySoundEvent(), InjuryLightSoundEvent(), InjuryMediumSoundEvent(), JumpSoundEvent(), LaugherSoundEvent(), m_Player, m_UpdateTimer, MeleeAttackLightEvent(), PickupHeavySoundEvent(), RegisterState(), ReleaseBreathSoundEvent(), SneezeSoundEvent(), StaminaDownHeavy(), StaminaDownLight(), StaminaLowFilterMid(), StaminaLowFilterUpper(), StaminaNormalDummy(), StaminaUpEnd(), StaminaUpHeavy(), StaminaUpLight() и ThirstSoundEvent().

Используется в ManBase::OnPlayerLoaded().

◆ PlayRequest()

override bool PlayRequest ( EPlayerSoundEventID id,
bool sent_from_server = false )
197 {
199 }
override bool PlayRequestEx(EPlayerSoundEventID id, bool sent_from_server=false, int param=0)
Definition PlayerSoundEventHandler.c:145

Перекрестные ссылки PlayRequestEx().

◆ PlayRequestEx()

override bool PlayRequestEx ( EPlayerSoundEventID id,
bool sent_from_server = false,
int param = 0 )
146 {
148 {
149 Error("EPlayerSoundEventID out of bounds");
150 }
151
153 if ( sent_from_server && (param & EPlayerSoundEventParam.SKIP_CONTROLLED_PLAYER) && m_Player.GetInstanceType() == DayZPlayerInstanceType.INSTANCETYPE_CLIENT )
154 {
155 return false;
156 }
157
158 if ( !requested_state.CanPlay(m_Player) )
159 {
160 return false;
161 }
162
163 if (m_CurrentState)
164 {
165 if (param & EPlayerSoundEventParam.HIGHEST_PRIORITY)
166 {
167 m_CurrentState.Stop();
168 }
169 else
170 {
171 int current_type = m_CurrentState.GetSoundEventType();
172 //int requested_type = requested_state.GetSoundEventType();
173
174 if ( (requested_state.GetPriorityOverTypes() & current_type) == 0 )
175 {
176 return false;
177 }
178 if (!requested_state.HasPriorityOverCurrent(m_Player, id, current_type) )
179 {
180 return false;
181 }
182
183 m_CurrentState.Stop();
184 }
185 }
186 m_CurrentState = PlayerSoundEventBase.Cast(requested_state.ClassName().ToType().Spawn());
188 if (m_CurrentState.Play())
189 {
190 m_CurrentState.OnPlay(m_Player);
191 }
192 return true;
193 }
const int SOUND_EVENTS_MAX
Definition PlayerSoundEventHandler.c:45
Definition DamageEvents.c:2
DayZPlayerInstanceType
defined in C++
Definition dayzplayer.c:1068
void Error(string err)
Messagebox with error message.
Definition EnDebug.c:90

Перекрестные ссылки Error(), m_AvailableStates, m_CurrentState, m_Player и SOUND_EVENTS_MAX.

Используется в PlayRequest().

◆ RegisterState()

void RegisterState ( PlayerSoundEventBase state)
99 {
100 int index = state.GetSoundEventID();
102 m_ConfigIDToScriptIDmapping.Insert(state.GetSoundVoiceAnimEventClassID(),index);
103 }

Перекрестные ссылки m_AvailableStates и m_ConfigIDToScriptIDmapping.

Используется в PlayerSoundEventHandler().

Переменные

◆ m_AvailableStates

ref PlayerSoundEventBase m_AvailableStates[SOUND_EVENTS_MAX]
static

◆ m_ConfigIDToScriptIDmapping

ref map<int,int> m_ConfigIDToScriptIDmapping = new ref map<int,int>
static

Используется в ConvertAnimIDtoEventID() и RegisterState().

◆ m_CurrentState

ref PlayerSoundEventBase m_CurrentState

◆ m_Player

◆ m_UpdateTimer

ref Timer m_UpdateTimer

◆ SOUND_EVENTS_MAX