DayZ
1.27
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
ThirstSoundHandler.c
См. документацию.
1
class
ThirstSoundHandlerBase
extends
SoundHandlerBase
2
{
3
override
void
Init
()
4
{
5
m_Id
=
eSoundHandlers
.THIRST;
6
}
7
8
}
9
10
//---------------------------
11
// Client
12
//---------------------------
13
class
ThirstSoundHandlerClient
extends
ThirstSoundHandlerBase
14
{
15
const
float
SOUND_INTERVALS_LIGHT_MIN
= 10;
16
const
float
SOUND_INTERVALS_LIGHT_MAX
= 30;
17
float
m_SoundTime
;
18
EffectSound
m_Sound
;
19
20
override
void
Update
()
21
{
22
if
(
m_Player
.GetMixedSoundStates() &
eMixedSoundStates
.THIRSTY )
23
{
24
ProcessSound
();
25
}
26
}
27
28
void
ProcessSound
()
29
{
30
if
(
GetGame
().
GetTime
() >
m_SoundTime
)
31
{
32
float
offset_time =
Math
.
RandomFloatInclusive
(
SOUND_INTERVALS_LIGHT_MIN
,
SOUND_INTERVALS_LIGHT_MAX
) * 1000;
33
m_SoundTime
=
GetGame
().
GetTime
() + offset_time;
34
PlaySound
();
35
}
36
}
37
38
void
PlaySound
()
39
{
40
m_Player
.PlaySoundEventEx(
EPlayerSoundEventID
.THIRST);
41
}
42
}
43
44
45
//---------------------------
46
// Server
47
//---------------------------
48
class
ThirstSoundHandlerServer
extends
ThirstSoundHandlerBase
49
{
50
51
}
eMixedSoundStates
eMixedSoundStates
bits
Определения
EMixedSoundStates.c:3
m_Player
DayZPlayer m_Player
Определения
Hand_Events.c:42
m_SoundTime
float m_SoundTime
Определения
HungerSoundHandler.c:17
SOUND_INTERVALS_LIGHT_MIN
class HungerSoundHandlerBase extends SoundHandlerBase SOUND_INTERVALS_LIGHT_MIN
SOUND_INTERVALS_LIGHT_MAX
const float SOUND_INTERVALS_LIGHT_MAX
Определения
HungerSoundHandler.c:16
m_Sound
EffectSound m_Sound
Определения
HungerSoundHandler.c:18
GetTime
float GetTime()
Определения
NotificationSystem.c:35
EPlayerSoundEventID
EPlayerSoundEventID
Определения
PlayerSoundEventHandler.c:3
eSoundHandlers
eSoundHandlers
Определения
PlayerSoundManager.c:5
m_Id
enum eStaminaZones m_Id
PlaySound
void PlaySound()
Определения
ThirstSoundHandler.c:38
ProcessSound
void ProcessSound()
Определения
ThirstSoundHandler.c:28
CGame::GetTime
proto int GetTime()
returns mission time in milliseconds
EffectSound
Wrapper class for managing sound through SEffectManager.
Определения
EffectSound.c:5
Math
Определения
EnMath.c:7
SoundHandlerBase::Init
override void Init()
Определения
ThirstSoundHandler.c:3
SoundHandlerBase
Определения
HungerSoundHandler.c:2
ThirstSoundHandlerBase
Определения
ThirstSoundHandler.c:49
GetGame
proto native CGame GetGame()
Math::RandomFloatInclusive
static float RandomFloatInclusive(float min, float max)
Returns a random float number between and min [inclusive] and max [inclusive].
Определения
EnMath.c:106
Update
override void Update()
Определения
ThirstSoundHandler.c:20
Ishodniki
scripts
4_World
Classes
SoundHandlers
ThirstSoundHandler.c
Создано системой
1.13.2