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

Закрытые члены

eInjurySoundZones DetermineInjuryZone (eInjuryHandlerLevels level)
 
override void Update ()
 
void ProcessSound (eInjurySoundZones zone)
 
void PlaySound (eInjurySoundZones zone)
 

Закрытые данные

const float SOUND_INTERVALS_LIGHT_MIN = 15
 
const float SOUND_INTERVALS_LIGHT_MAX = 30
 
const float SOUND_INTERVALS_MEDIUM_MIN = 10
 
const float SOUND_INTERVALS_MEDIUM_MAX = 25
 
const float SOUND_INTERVALS_HEAVY_MIN = 3
 
const float SOUND_INTERVALS_HEAVY_MAX = 12
 
ref HumanMovementState m_MovementState = new HumanMovementState
 
eInjurySoundZones m_InjurySoundZone
 
eInjuryHandlerLevels m_InjuryLevel
 
float m_SoundTime
 

Подробное описание

Методы

◆ DetermineInjuryZone()

eInjurySoundZones DetermineInjuryZone ( eInjuryHandlerLevels level)
inlineprivate
37 {
38 if( level == eInjuryHandlerLevels.PRISTINE )
39 return eInjurySoundZones.NONE;
40
41 m_Player.GetMovementState(m_MovementState);
42 int speed = m_MovementState.m_iMovement;
43 int stance = m_MovementState.m_iStanceIdx;
44
45 //int stance_lvl_down = DayZPlayerConstants.STANCEMASK_PRONE | DayZPlayerConstants.STANCEMASK_CROUCH;
46
47 if( speed == 0 )
48 return eInjurySoundZones.NONE;
49
50 level--;// shift the level so that we play from higher damage
51
52 if( stance == DayZPlayerConstants.STANCEIDX_PRONE || stance == DayZPlayerConstants.STANCEIDX_CROUCH )
53 {
54 level--;
55 }
56
57 if( speed == DayZPlayerConstants.MOVEMENTIDX_WALK )
58 {
59 level--;
60 }
61 else if(speed == DayZPlayerConstants.MOVEMENTIDX_SPRINT)
62 {
63 level++;
64 }
66 return level;
67 }
DayZPlayer m_Player
Definition Hand_Events.c:42
eInjuryHandlerLevels
Definition InjuryHandler.c:19
eInjurySoundZones
Definition InjurySoundHandler.c:2
ref HumanMovementState m_MovementState
Definition InjurySoundHandler.c:30
Definition EnMath.c:7
Definition EntityAI.c:95
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.

Перекрестные ссылки Math::Clamp(), m_MovementState и m_Player.

◆ PlaySound()

void PlaySound ( eInjurySoundZones zone)
inlineprivate
112 {
114 }
EPlayerSoundEventID
Definition PlayerSoundEventHandler.c:2
bool PlaySoundEvent(EPlayerSoundEventID id, bool from_anim_system=false, bool is_from_server=false)
Definition DayZPlayerImplement.c:493

Перекрестные ссылки m_Player и DayZPlayer::PlaySoundEvent().

◆ ProcessSound()

void ProcessSound ( eInjurySoundZones zone)
inlineprivate
82 {
83 //Print("injury sound zone:"+ zone);
84 // process sound here
85 if( GetGame().GetTime() > m_SoundTime)
86 {
87 float offset_time;
88 if(zone == eInjurySoundZones.NONE)
89 {
90 offset_time = 3000;
91 m_SoundTime = GetGame().GetTime() + offset_time;
92 return;
93 }
94 if(zone == eInjurySoundZones.LIGHT)
95 {
97 }
98 else if(zone == eInjurySoundZones.MEDIUM)
99 {
101 }
102 else if(zone == eInjurySoundZones.HEAVY)
103 {
105 }
106 m_SoundTime = GetGame().GetTime() + offset_time;
108 }
109 }
void PlaySound()
Definition HungerSoundHandler.c:38
float GetTime()
Definition NotificationSystem.c:35
float m_SoundTime
Definition InjurySoundHandler.c:33
const float SOUND_INTERVALS_LIGHT_MAX
Definition InjurySoundHandler.c:26
const float SOUND_INTERVALS_HEAVY_MIN
Definition InjurySoundHandler.c:28
const float SOUND_INTERVALS_MEDIUM_MAX
Definition InjurySoundHandler.c:27
const float SOUND_INTERVALS_MEDIUM_MIN
Definition InjurySoundHandler.c:27
const float SOUND_INTERVALS_HEAVY_MAX
Definition InjurySoundHandler.c:28
const float SOUND_INTERVALS_LIGHT_MIN
Definition InjurySoundHandler.c:26
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

Перекрестные ссылки GetGame(), GetTime(), m_SoundTime, PlaySound(), Math::RandomFloatInclusive(), SOUND_INTERVALS_LIGHT_MAX и SOUND_INTERVALS_LIGHT_MIN.

◆ Update()

override void Update ( )
inlineprivate
71 {
72 m_InjuryLevel = m_Player.m_HealthLevel;
73
74 if( m_InjuryLevel != eInjuryHandlerLevels.PRISTINE )
75 {
78 }
79 }
void ProcessSound()
Definition HungerSoundHandler.c:28
eInjuryHandlerLevels m_InjuryLevel
Definition InjurySoundHandler.c:32
eInjurySoundZones DetermineInjuryZone(eInjuryHandlerLevels level)
Definition InjurySoundHandler.c:36

Перекрестные ссылки m_Player и ProcessSound().

Поля

◆ m_InjuryLevel

eInjuryHandlerLevels m_InjuryLevel
private

◆ m_InjurySoundZone

eInjurySoundZones m_InjurySoundZone
private

◆ m_MovementState

ref HumanMovementState m_MovementState = new HumanMovementState
private

◆ m_SoundTime

float m_SoundTime
private

◆ SOUND_INTERVALS_HEAVY_MAX

const float SOUND_INTERVALS_HEAVY_MAX = 12
private

◆ SOUND_INTERVALS_HEAVY_MIN

const float SOUND_INTERVALS_HEAVY_MIN = 3
private

◆ SOUND_INTERVALS_LIGHT_MAX

const float SOUND_INTERVALS_LIGHT_MAX = 30
private

◆ SOUND_INTERVALS_LIGHT_MIN

const float SOUND_INTERVALS_LIGHT_MIN = 15
private

◆ SOUND_INTERVALS_MEDIUM_MAX

const float SOUND_INTERVALS_MEDIUM_MAX = 25
private

◆ SOUND_INTERVALS_MEDIUM_MIN

const float SOUND_INTERVALS_MEDIUM_MIN = 10
private

Объявления и описания членов класса находятся в файле: