DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ ProcessWeaponEvent()

void DayZPlayer::ProcessWeaponEvent ( string pEventType,
string pUserString,
int pUserInt )
inlineprotected

См. определение в файле DayZPlayerImplement.c строка 3366

3367 {
3369 AnimSoundEvent soundEvent = null;
3370
3371 float quantity = 0;
3372
3373 EntityAI entityInHands = GetHumanInventory().GetEntityInHands();
3374 if (entityInHands && entityInHands.IsInherited(ItemBase))
3375 {
3376 ItemBase item;
3377 Class.CastTo(item, entityInHands);
3378 if (item.HasQuantity())
3379 quantity = (float)item.GetQuantity() / (item.GetQuantityMax() - item.GetQuantityMin());
3380 InventoryItemType invItemType = item.GetInventoryItemType();
3381 soundEvent = invItemType.GetSoundEvent(pUserInt);
3382 }
3383
3384 if (soundEvent == null)
3385 {
3386 quantity = 0;
3387 soundEvent = type.GetSoundWeaponEvent(pUserInt);
3388 }
3389
3390 if (soundEvent != null)
3391 {
3392 if (!GetGame().IsDedicatedServer())
3393 {
3394 SoundObjectBuilder builder = soundEvent.GetSoundBuilderEx(m_ActionSoundCategoryHash);
3395 if (builder)
3396 {
3397 builder.AddVariable("quantity", quantity);
3398 builder.AddVariable("interior", IsSoundInsideBuilding());
3399
3400 SoundObject soundObject = builder.BuildSoundObject();
3401 if (soundObject != NULL)
3402 {
3403 AttenuateSoundIfNecessary(soundObject);
3404 AbstractWave sound = PlaySound(soundObject, builder);
3405
3406 if (pUserString == "StopOnAnimEnd")
3407 m_PerformedActionSounds.Insert(sound);
3408 }
3409 }
3410 else
3411 {
3412 //TODO:Userful error message
3413 }
3414 }
3415
3416 if (GetGame().IsServer())
3417 {
3418 AddNoise(soundEvent.m_NoiseParams, NoiseAIEvaluate.GetNoiseReduction(GetGame().GetWeather()));
3419 }
3420 }
3421 }
class LogManager EntityAI
class GP5GasMask extends MaskBase ItemBase
void PlaySound()
Определения HungerSoundHandler.c:38
ref array< AbstractWave > m_PerformedActionSounds
Определения DayZPlayerImplement.c:171
void AttenuateSoundIfNecessary(SoundObject soundObject)
Определения DayZPlayerImplement.c:3783
int m_ActionSoundCategoryHash
Определения DayZPlayerImplement.c:184
void AddNoise(NoiseParams noisePar, float noiseMultiplier=1.0)
Определения DayZPlayerImplement.c:3162
AnimSoundEvent GetSoundEvent(int event_id)
Определения InventoryItemType.c:50
void DayZPlayerType()
Определения dayzplayer.c:512
proto native DayZPlayerType GetDayZPlayerType()
returns appropriate DayZPlayerType
proto native CGame GetGame()
class AbstractSoundScene SoundObjectBuilder(SoundParams soundParams)
void SoundObject(SoundParams soundParams)
void AbstractWave()
Определения Sound.c:167

Перекрестные ссылки AbstractWave(), AddNoise(), AttenuateSoundIfNecessary(), Class::CastTo(), DayZPlayerType(), GetDayZPlayerType(), GetGame(), NoiseAIEvaluate::GetNoiseReduction(), InventoryItemType::GetSoundEvent(), m_ActionSoundCategoryHash, m_PerformedActionSounds, PlaySound() и SoundObjectBuilder().

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