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

◆ ProcessVoiceEvent()

AbstractWave DayZPlayer::ProcessVoiceEvent ( string pEventType,
string pUserString,
int pUserInt )
inlineprotected

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

3596 {
3597 #ifdef SERVER//none of this code needs to run on server, ifdef put here rather than before the method call to maintain mod compatibility
3598 return null;
3599 #endif
3601 DayZPlayerTypeVoiceSoundLookupTable table = type.GetVoiceSoundLookupTable();
3602 if (!table)
3603 return null;
3604 AbstractWave wave;
3605 EntityAI mask = GetInventory().FindAttachment(InventorySlots.MASK);
3606 EntityAI head_gear = GetInventory().FindAttachment(InventorySlots.HEADGEAR);
3607
3608 string category;
3609 if (mask || head_gear)
3610 {
3611 string category_mask;
3612 string category_headgear;
3613
3614 int priority_mask;
3615 int priority_headgear;
3616
3617 if (mask)
3618 {
3619 category_mask = mask.ConfigGetString("soundVoiceType");
3620 priority_mask = mask.ConfigGetInt("soundVoicePriority");
3621 }
3622 if (head_gear)
3623 {
3624 category_headgear = head_gear.ConfigGetString("soundVoiceType");
3625 priority_headgear = head_gear.ConfigGetInt("soundVoicePriority");
3626 }
3627
3628 if (priority_headgear >= priority_mask && category_headgear != "")
3629 {
3630 category = category_headgear;
3631 }
3632 else
3633 {
3634 category = category_mask;
3635 }
3636 }
3637
3638 if (category == "")
3639 {
3640 category = "none";
3641 }
3642
3643 SoundObjectBuilder soundBuilder = table.GetSoundBuilder(pUserInt, category.Hash());
3644
3645 if (soundBuilder)
3646 {
3647 PlayerBase player = PlayerBase.Cast(this);
3648 //this code block looks super shady, but it's the only way the sounds play correctly, god knows what's going on on c++ side
3649 int maleVoiceType = 0;
3650 int femaleVoiceType = 0;
3651 if (player.IsMale())
3652 {
3653 maleVoiceType = player.GetVoiceType();
3654 }
3655 else
3656 {
3657 femaleVoiceType = player.GetVoiceType();
3658 }
3659
3660 soundBuilder.AddVariable("male", maleVoiceType);
3661 soundBuilder.AddVariable("female", femaleVoiceType);
3662
3663 // end of weirdness
3664 SoundObject soundObject = soundBuilder.BuildSoundObject();
3665 if (soundObject != NULL)
3666 {
3667 AttenuateSoundIfNecessary(soundObject);
3668 wave = PlaySound(soundObject, soundBuilder);
3669 }
3670
3671 }
3672
3673 return wave;
3674 }
class LogManager EntityAI
void PlaySound()
Определения HungerSoundHandler.c:38
void AttenuateSoundIfNecessary(SoundObject soundObject)
Определения DayZPlayerImplement.c:3849
override SoundObjectBuilder GetSoundBuilder(int eventId, int parameterHash)
Определения DayZPlayerCfgSounds.c:211
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
proto native int Hash()
Returns hash of string.

Перекрестные ссылки AbstractWave(), AttenuateSoundIfNecessary(), DayZPlayerType(), GetDayZPlayerType(), DayZPlayerTypeVoiceSoundLookupTable::GetSoundBuilder(), string::Hash(), PlaySound() и SoundObjectBuilder().

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