|
|
|
@ -154,14 +154,14 @@ void CZombie::PainSound( void )
@@ -154,14 +154,14 @@ void CZombie::PainSound( void )
|
|
|
|
|
int pitch = 95 + RANDOM_LONG( 0, 9 ); |
|
|
|
|
|
|
|
|
|
if( RANDOM_LONG( 0, 5 ) < 2 ) |
|
|
|
|
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, pPainSounds[RANDOM_LONG( 0, ARRAYSIZE( pPainSounds ) - 1 )], 1.0, ATTN_NORM, 0, pitch ); |
|
|
|
|
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, RANDOM_SOUND_ARRAY( pPainSounds ), 1.0, ATTN_NORM, 0, pitch ); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void CZombie::AlertSound( void ) |
|
|
|
|
{ |
|
|
|
|
int pitch = 95 + RANDOM_LONG( 0, 9 ); |
|
|
|
|
|
|
|
|
|
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, pAlertSounds[ RANDOM_LONG( 0, ARRAYSIZE( pAlertSounds ) - 1 )], 1.0, ATTN_NORM, 0, pitch ); |
|
|
|
|
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, RANDOM_SOUND_ARRAY( pAlertSounds ), 1.0, ATTN_NORM, 0, pitch ); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void CZombie::IdleSound( void ) |
|
|
|
@ -169,7 +169,7 @@ void CZombie::IdleSound( void )
@@ -169,7 +169,7 @@ void CZombie::IdleSound( void )
|
|
|
|
|
int pitch = 95 + RANDOM_LONG( 0, 9 ); |
|
|
|
|
|
|
|
|
|
// Play a random idle sound
|
|
|
|
|
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, pIdleSounds[RANDOM_LONG( 0, ARRAYSIZE( pIdleSounds ) -1 )], 1.0, ATTN_NORM, 0, pitch ); |
|
|
|
|
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, RANDOM_SOUND_ARRAY( pIdleSounds ), 1.0, ATTN_NORM, 0, pitch ); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void CZombie::AttackSound( void ) |
|
|
|
@ -177,7 +177,7 @@ void CZombie::AttackSound( void )
@@ -177,7 +177,7 @@ void CZombie::AttackSound( void )
|
|
|
|
|
int pitch = 95 + RANDOM_LONG( 0, 9 ); |
|
|
|
|
|
|
|
|
|
// Play a random attack sound
|
|
|
|
|
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, pAttackSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackSounds ) - 1 )], 1.0, ATTN_NORM, 0, pitch ); |
|
|
|
|
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, RANDOM_SOUND_ARRAY( pAttackSounds ), 1.0, ATTN_NORM, 0, pitch ); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//=========================================================
|
|
|
|
@ -202,10 +202,10 @@ void CZombie::HandleAnimEvent( MonsterEvent_t *pEvent )
@@ -202,10 +202,10 @@ void CZombie::HandleAnimEvent( MonsterEvent_t *pEvent )
|
|
|
|
|
pHurt->pev->velocity = pHurt->pev->velocity - gpGlobals->v_right * 100; |
|
|
|
|
} |
|
|
|
|
// Play a random attack hit sound
|
|
|
|
|
EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, pAttackHitSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackHitSounds ) - 1 )], 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG( -5 , 5 ) ); |
|
|
|
|
EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, RANDOM_SOUND_ARRAY( pAttackHitSounds ), 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG( -5 , 5 ) ); |
|
|
|
|
} |
|
|
|
|
else // Play a random attack miss sound
|
|
|
|
|
EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, pAttackMissSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackMissSounds ) - 1 )], 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); |
|
|
|
|
EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, RANDOM_SOUND_ARRAY( pAttackMissSounds ), 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); |
|
|
|
|
|
|
|
|
|
if( RANDOM_LONG( 0, 1 ) ) |
|
|
|
|
AttackSound(); |
|
|
|
@ -224,10 +224,10 @@ void CZombie::HandleAnimEvent( MonsterEvent_t *pEvent )
@@ -224,10 +224,10 @@ void CZombie::HandleAnimEvent( MonsterEvent_t *pEvent )
|
|
|
|
|
pHurt->pev->punchangle.x = 5; |
|
|
|
|
pHurt->pev->velocity = pHurt->pev->velocity + gpGlobals->v_right * 100; |
|
|
|
|
} |
|
|
|
|
EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, pAttackHitSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackHitSounds ) - 1 )], 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); |
|
|
|
|
EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, RANDOM_SOUND_ARRAY( pAttackHitSounds ), 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, pAttackMissSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackMissSounds ) - 1 )], 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); |
|
|
|
|
EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, RANDOM_SOUND_ARRAY( pAttackMissSounds ), 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); |
|
|
|
|
|
|
|
|
|
if( RANDOM_LONG( 0, 1 ) ) |
|
|
|
|
AttackSound(); |
|
|
|
@ -244,10 +244,10 @@ void CZombie::HandleAnimEvent( MonsterEvent_t *pEvent )
@@ -244,10 +244,10 @@ void CZombie::HandleAnimEvent( MonsterEvent_t *pEvent )
|
|
|
|
|
pHurt->pev->punchangle.x = 5; |
|
|
|
|
pHurt->pev->velocity = pHurt->pev->velocity + gpGlobals->v_forward * -100; |
|
|
|
|
} |
|
|
|
|
EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, pAttackHitSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackHitSounds ) - 1 )], 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); |
|
|
|
|
EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, RANDOM_SOUND_ARRAY( pAttackHitSounds ), 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, pAttackMissSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackMissSounds ) - 1 )], 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); |
|
|
|
|
EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, RANDOM_SOUND_ARRAY( pAttackMissSounds ), 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); |
|
|
|
|
|
|
|
|
|
if( RANDOM_LONG( 0, 1 ) ) |
|
|
|
|
AttackSound(); |
|
|
|
@ -286,27 +286,14 @@ void CZombie::Spawn()
@@ -286,27 +286,14 @@ void CZombie::Spawn()
|
|
|
|
|
//=========================================================
|
|
|
|
|
void CZombie::Precache() |
|
|
|
|
{ |
|
|
|
|
size_t i; |
|
|
|
|
|
|
|
|
|
PRECACHE_MODEL( "models/zombie.mdl" ); |
|
|
|
|
|
|
|
|
|
for( i = 0; i < ARRAYSIZE( pAttackHitSounds ); i++ ) |
|
|
|
|
PRECACHE_SOUND( pAttackHitSounds[i] ); |
|
|
|
|
|
|
|
|
|
for( i = 0; i < ARRAYSIZE( pAttackMissSounds ); i++ ) |
|
|
|
|
PRECACHE_SOUND( pAttackMissSounds[i] ); |
|
|
|
|
|
|
|
|
|
for( i = 0; i < ARRAYSIZE( pAttackSounds ); i++ ) |
|
|
|
|
PRECACHE_SOUND( pAttackSounds[i] ); |
|
|
|
|
|
|
|
|
|
for( i = 0; i < ARRAYSIZE( pIdleSounds ); i++ ) |
|
|
|
|
PRECACHE_SOUND( pIdleSounds[i] ); |
|
|
|
|
|
|
|
|
|
for( i = 0; i < ARRAYSIZE( pAlertSounds ); i++ ) |
|
|
|
|
PRECACHE_SOUND( pAlertSounds[i] ); |
|
|
|
|
|
|
|
|
|
for( i = 0; i < ARRAYSIZE( pPainSounds ); i++ ) |
|
|
|
|
PRECACHE_SOUND( pPainSounds[i] ); |
|
|
|
|
PRECACHE_SOUND_ARRAY( pAttackHitSounds ); |
|
|
|
|
PRECACHE_SOUND_ARRAY( pAttackMissSounds ); |
|
|
|
|
PRECACHE_SOUND_ARRAY( pAttackSounds ); |
|
|
|
|
PRECACHE_SOUND_ARRAY( pIdleSounds ); |
|
|
|
|
PRECACHE_SOUND_ARRAY( pAlertSounds ); |
|
|
|
|
PRECACHE_SOUND_ARRAY( pPainSounds ); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//=========================================================
|
|
|
|
|