DayZ 1.24
Loading...
Searching...
No Matches
HungerSoundHandler.c File Reference

Go to the source code of this file.

Classes

class  SoundHandlerBase
 
class  HungerSoundHandlerBase
 

Functions

override void Update ()
 
void ProcessSound ()
 
void PlaySound ()
 

Variables

class HungerSoundHandlerBase extends SoundHandlerBase SOUND_INTERVALS_LIGHT_MIN = 10
 
const float SOUND_INTERVALS_LIGHT_MAX = 30
 
float m_SoundTime
 
EffectSound m_Sound
 

Function Documentation

◆ PlaySound()

void PlaySound ( )

Definition at line 36 of file HungerSoundHandler.c.

37 {
38 m_Sound = SEffectManager.PlaySoundOnObject("hungry_uni_Voice_Char_SoundSet", m_Player);
39
40 if (m_Sound)
42 else
43 Debug.LogError("Missing sounset");
44 }
DayZPlayer m_Player
Definition Hand_Events.c:42
EffectSound m_Sound
Definition Debug.c:14
static void LogError(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message as error message.
Definition Debug.c:341
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
Manager class for managing Effect (EffectParticle, EffectSound)
static EffectSound PlaySoundOnObject(string sound_set, Object parent_object, float play_fade_in=0, float stop_fade_out=0, bool loop=false)
Create and play an EffectSound.

References Debug::LogError(), m_Player, m_Sound, SEffectManager::PlaySoundOnObject(), and EffectSound::SetAutodestroy().

Referenced by SymptomBase::OnGetActivatedServer(), DayZPlayer::OnStepEvent(), EntityAI::PlayImpactSound(), EntityAI::PlaySoundByAnimEvent(), DayZPlayer::ProcessAttachmentEvent(), ProcessSound(), InjurySoundHandlerBase::ProcessSound(), DayZCreature::ProcessSoundEvent(), DayZPlayer::ProcessSoundEvent(), DayZCreature::ProcessSoundVoiceEvent(), DayZInfected::ProcessSoundVoiceEvent(), DayZCreature::ProcessStepEvent(), DayZPlayer::ProcessVoiceEvent(), DayZInfected::ProcessVoiceFX(), DayZPlayer::ProcessWeaponEvent(), ItemBase::SoundCollision(), BarbedWireTrigger::SoundCollision(), ItemBase::SoundCut(), ItemBase::SoundElectricShock(), BarbedWireTrigger::SoundElectricShock(), and ItemBase::SoundSpark().

◆ ProcessSound()

void ProcessSound ( )

Definition at line 26 of file HungerSoundHandler.c.

27 {
28 if (GetGame().GetTime() > m_SoundTime)
29 {
31 m_SoundTime = GetGame().GetTime() + offset_time;
32 PlaySound();
33 }
34 }
float m_SoundTime
void PlaySound()
class HungerSoundHandlerBase extends SoundHandlerBase SOUND_INTERVALS_LIGHT_MIN
const float SOUND_INTERVALS_LIGHT_MAX
float GetTime()
Definition EnMath.c:7
proto native CGame GetGame()
static float RandomFloatInclusive(float min, float max)
Returns a random float number between and min [inclusive] and max [inclusive].
Definition EnMath.c:106

References GetGame(), GetTime(), m_SoundTime, PlaySound(), Math::RandomFloatInclusive(), SOUND_INTERVALS_LIGHT_MAX, and SOUND_INTERVALS_LIGHT_MIN.

Referenced by Tick(), Update(), and InjurySoundHandlerBase::Update().

Variable Documentation

◆ m_Sound

◆ m_SoundTime

float m_SoundTime

Definition at line 17 of file HungerSoundHandler.c.

Referenced by ProcessSound(), and InjurySoundHandlerBase::ProcessSound().

◆ SOUND_INTERVALS_LIGHT_MAX

const float SOUND_INTERVALS_LIGHT_MAX = 30

Definition at line 16 of file HungerSoundHandler.c.

Referenced by ProcessSound(), and InjurySoundHandlerBase::ProcessSound().

◆ SOUND_INTERVALS_LIGHT_MIN