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

◆ ProcessWeaponEvent()

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

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

3433 {
3435 AnimSoundEvent soundEvent = null;
3436
3437 float quantity = 0;
3438
3439 EntityAI entityInHands = GetHumanInventory().GetEntityInHands();
3440 if (entityInHands && entityInHands.IsInherited(ItemBase))
3441 {
3442 ItemBase item;
3443 Class.CastTo(item, entityInHands);
3444 if (item.HasQuantity())
3445 quantity = (float)item.GetQuantity() / (item.GetQuantityMax() - item.GetQuantityMin());
3446 InventoryItemType invItemType = item.GetInventoryItemType();
3447 soundEvent = invItemType.GetSoundEvent(pUserInt);
3448 }
3449
3450 if (soundEvent == null)
3451 {
3452 quantity = 0;
3453 soundEvent = type.GetSoundWeaponEvent(pUserInt);
3454 }
3455
3456 if (soundEvent != null)
3457 {
3458 if (!GetGame().IsDedicatedServer())
3459 {
3460 SoundObjectBuilder builder = soundEvent.GetSoundBuilderEx(m_ActionSoundCategoryHash);
3461 if (builder)
3462 {
3463 builder.AddVariable("quantity", quantity);
3464 builder.AddVariable("interior", IsSoundInsideBuilding());
3465
3466 SoundObject soundObject = builder.BuildSoundObject();
3467 if (soundObject != NULL)
3468 {
3469 AttenuateSoundIfNecessary(soundObject);
3470 AbstractWave sound = PlaySound(soundObject, builder);
3471
3472 if (pUserString == "StopOnAnimEnd")
3473 m_PerformedActionSounds.Insert(sound);
3474 }
3475 }
3476 else
3477 {
3478 //TODO:Userful error message
3479 }
3480 }
3481
3482 if (GetGame().IsServer())
3483 {
3484 AddNoise(soundEvent.m_NoiseParams, NoiseAIEvaluate.GetNoiseReduction(GetGame().GetWeather()));
3485 }
3486 }
3487 }
class LogManager EntityAI
class GP5GasMask extends MaskBase ItemBase
void PlaySound()
Определения HungerSoundHandler.c:38
ref array< AbstractWave > m_PerformedActionSounds
Определения DayZPlayerImplement.c:173
void AttenuateSoundIfNecessary(SoundObject soundObject)
Определения DayZPlayerImplement.c:3849
int m_ActionSoundCategoryHash
Определения DayZPlayerImplement.c:186
void AddNoise(NoiseParams noisePar, float noiseMultiplier=1.0)
Определения DayZPlayerImplement.c:3228
AnimSoundEvent GetSoundEvent(int event_id)
Определения 3_Game/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().