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

◆ ProcessWeaponEvent()

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

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

3415 {
3417 AnimSoundEvent soundEvent = null;
3418
3419 float quantity = 0;
3420
3421 EntityAI entityInHands = GetEntityInHands();
3422 if (entityInHands && entityInHands.IsInherited(ItemBase))
3423 {
3424 ItemBase item;
3425 Class.CastTo(item, entityInHands);
3426 if (item.HasQuantity())
3427 quantity = (float)item.GetQuantity() / (item.GetQuantityMax() - item.GetQuantityMin());
3428 InventoryItemType invItemType = item.GetInventoryItemType();
3429 soundEvent = invItemType.GetSoundEvent(pUserInt);
3430 }
3431
3432 if (soundEvent == null)
3433 {
3434 quantity = 0;
3435 soundEvent = type.GetSoundWeaponEvent(pUserInt);
3436 }
3437
3438 if (soundEvent != null)
3439 {
3440 if (!g_Game.IsDedicatedServer())
3441 {
3442 SoundObjectBuilder builder = soundEvent.GetSoundBuilderEx(m_ActionSoundCategoryHash);
3443 if (builder)
3444 {
3445 builder.AddVariable("quantity", quantity);
3446 builder.AddVariable("interior", IsSoundInsideBuilding());
3447
3448 SoundObject soundObject = builder.BuildSoundObject();
3449 if (soundObject != NULL)
3450 {
3451 AttenuateSoundIfNecessary(soundObject);
3452 AbstractWave sound = PlaySound(soundObject, builder);
3453
3454 if (pUserString == "StopOnAnimEnd")
3455 m_PerformedActionSounds.Insert(sound);
3456 }
3457 }
3458 else
3459 {
3460 //TODO:Userful error message
3461 }
3462 }
3463
3464 if (g_Game.IsServer())
3465 {
3466 AddNoise(soundEvent.m_NoiseParams, NoiseAIEvaluate.GetNoiseReduction(g_Game.GetWeather()));
3467 }
3468 }
3469 }
void InventoryItemType()
class LogManager EntityAI
DayZGame g_Game
Определения DayZGame.c:3942
class GP5GasMask extends MaskBase ItemBase
void PlaySound()
Определения HungerSoundHandler.c:39
ref array< AbstractWave > m_PerformedActionSounds
Определения DayZPlayerImplement.c:149
void AttenuateSoundIfNecessary(SoundObject soundObject)
Определения DayZPlayerImplement.c:3832
int m_ActionSoundCategoryHash
Определения DayZPlayerImplement.c:162
void AddNoise(NoiseParams noisePar, float noiseMultiplier=1.0)
Определения DayZPlayerImplement.c:3204
void DayZPlayerType()
Определения dayzplayer.c:512
proto native DayZPlayerType GetDayZPlayerType()
returns appropriate DayZPlayerType
class AbstractSoundScene SoundObjectBuilder(SoundParams soundParams)
void SoundObject(SoundParams soundParams)
void AbstractWave()
Определения Sound.c:167

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

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