|
|
@ -471,7 +471,7 @@ void CGargantua::StompAttack( void ) |
|
|
|
UTIL_TraceLine( vecStart, vecEnd, ignore_monsters, edict(), &trace ); |
|
|
|
UTIL_TraceLine( vecStart, vecEnd, ignore_monsters, edict(), &trace ); |
|
|
|
CStomp::StompCreate( vecStart, trace.vecEndPos, 0 ); |
|
|
|
CStomp::StompCreate( vecStart, trace.vecEndPos, 0 ); |
|
|
|
UTIL_ScreenShake( pev->origin, 12.0, 100.0, 2.0, 1000 ); |
|
|
|
UTIL_ScreenShake( pev->origin, 12.0, 100.0, 2.0, 1000 ); |
|
|
|
EMIT_SOUND_DYN( edict(), CHAN_WEAPON, pStompSounds[RANDOM_LONG( 0, ARRAYSIZE( pStompSounds ) - 1 )], 1.0, ATTN_GARG, 0, PITCH_NORM + RANDOM_LONG( -10, 10 ) ); |
|
|
|
EMIT_SOUND_DYN( edict(), CHAN_WEAPON, RANDOM_SOUND_ARRAY( pStompSounds ), 1.0, ATTN_GARG, 0, PITCH_NORM + RANDOM_LONG( -10, 10 ) ); |
|
|
|
|
|
|
|
|
|
|
|
UTIL_TraceLine( pev->origin, pev->origin - Vector(0,0,20), ignore_monsters, edict(), &trace ); |
|
|
|
UTIL_TraceLine( pev->origin, pev->origin - Vector(0,0,20), ignore_monsters, edict(), &trace ); |
|
|
|
if( trace.flFraction < 1.0f ) |
|
|
|
if( trace.flFraction < 1.0f ) |
|
|
@ -759,8 +759,6 @@ void CGargantua::Spawn() |
|
|
|
//=========================================================
|
|
|
|
//=========================================================
|
|
|
|
void CGargantua::Precache() |
|
|
|
void CGargantua::Precache() |
|
|
|
{ |
|
|
|
{ |
|
|
|
size_t i; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PRECACHE_MODEL( "models/garg.mdl" ); |
|
|
|
PRECACHE_MODEL( "models/garg.mdl" ); |
|
|
|
PRECACHE_MODEL( GARG_EYE_SPRITE_NAME ); |
|
|
|
PRECACHE_MODEL( GARG_EYE_SPRITE_NAME ); |
|
|
|
PRECACHE_MODEL( GARG_BEAM_SPRITE_NAME ); |
|
|
|
PRECACHE_MODEL( GARG_BEAM_SPRITE_NAME ); |
|
|
@ -769,38 +767,17 @@ void CGargantua::Precache() |
|
|
|
gGargGibModel = PRECACHE_MODEL( GARG_GIB_MODEL ); |
|
|
|
gGargGibModel = PRECACHE_MODEL( GARG_GIB_MODEL ); |
|
|
|
PRECACHE_SOUND( GARG_STOMP_BUZZ_SOUND ); |
|
|
|
PRECACHE_SOUND( GARG_STOMP_BUZZ_SOUND ); |
|
|
|
|
|
|
|
|
|
|
|
for( i = 0; i < ARRAYSIZE( pAttackHitSounds ); i++ ) |
|
|
|
PRECACHE_SOUND_ARRAY( pAttackHitSounds ); |
|
|
|
PRECACHE_SOUND( pAttackHitSounds[i] ); |
|
|
|
PRECACHE_SOUND_ARRAY( pBeamAttackSounds ); |
|
|
|
|
|
|
|
PRECACHE_SOUND_ARRAY( pAttackMissSounds ); |
|
|
|
for( i = 0; i < ARRAYSIZE( pBeamAttackSounds ); i++ ) |
|
|
|
PRECACHE_SOUND_ARRAY( pRicSounds ); |
|
|
|
PRECACHE_SOUND( pBeamAttackSounds[i] ); |
|
|
|
PRECACHE_SOUND_ARRAY( pFootSounds ); |
|
|
|
|
|
|
|
PRECACHE_SOUND_ARRAY( pIdleSounds ); |
|
|
|
for( i = 0; i < ARRAYSIZE( pAttackMissSounds ); i++ ) |
|
|
|
PRECACHE_SOUND_ARRAY( pAlertSounds ); |
|
|
|
PRECACHE_SOUND( pAttackMissSounds[i] ); |
|
|
|
PRECACHE_SOUND_ARRAY( pPainSounds ); |
|
|
|
|
|
|
|
PRECACHE_SOUND_ARRAY( pAttackSounds ); |
|
|
|
for( i = 0; i < ARRAYSIZE( pRicSounds ); i++ ) |
|
|
|
PRECACHE_SOUND_ARRAY( pStompSounds ); |
|
|
|
PRECACHE_SOUND( pRicSounds[i] ); |
|
|
|
PRECACHE_SOUND_ARRAY( pBreatheSounds ); |
|
|
|
|
|
|
|
|
|
|
|
for( i = 0; i < ARRAYSIZE( pFootSounds ); i++ ) |
|
|
|
|
|
|
|
PRECACHE_SOUND( pFootSounds[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] ); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for( i = 0; i < ARRAYSIZE( pAttackSounds ); i++ ) |
|
|
|
|
|
|
|
PRECACHE_SOUND( pAttackSounds[i] ); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for( i = 0; i < ARRAYSIZE( pStompSounds ); i++ ) |
|
|
|
|
|
|
|
PRECACHE_SOUND( pStompSounds[i] ); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for( i = 0; i < ARRAYSIZE( pBreatheSounds ); i++ ) |
|
|
|
|
|
|
|
PRECACHE_SOUND( pBreatheSounds[i] ); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void CGargantua::UpdateOnRemove() |
|
|
|
void CGargantua::UpdateOnRemove() |
|
|
@ -831,7 +808,7 @@ void CGargantua::TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vec |
|
|
|
{ |
|
|
|
{ |
|
|
|
if( m_painSoundTime < gpGlobals->time ) |
|
|
|
if( m_painSoundTime < gpGlobals->time ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, pPainSounds[RANDOM_LONG( 0, ARRAYSIZE( pPainSounds ) - 1 )], 1.0, ATTN_GARG, 0, PITCH_NORM ); |
|
|
|
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, RANDOM_SOUND_ARRAY( pPainSounds ), 1.0, ATTN_GARG, 0, PITCH_NORM ); |
|
|
|
m_painSoundTime = gpGlobals->time + RANDOM_FLOAT( 2.5, 4 ); |
|
|
|
m_painSoundTime = gpGlobals->time + RANDOM_FLOAT( 2.5, 4 ); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -976,10 +953,10 @@ void CGargantua::HandleAnimEvent( MonsterEvent_t *pEvent ) |
|
|
|
//UTIL_MakeVectors( pev->angles ); // called by CheckTraceHullAttack
|
|
|
|
//UTIL_MakeVectors( pev->angles ); // called by CheckTraceHullAttack
|
|
|
|
pHurt->pev->velocity = pHurt->pev->velocity - gpGlobals->v_right * 100; |
|
|
|
pHurt->pev->velocity = pHurt->pev->velocity - gpGlobals->v_right * 100; |
|
|
|
} |
|
|
|
} |
|
|
|
EMIT_SOUND_DYN( edict(), CHAN_WEAPON, pAttackHitSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackHitSounds ) - 1 )], 1.0, ATTN_NORM, 0, 50 + RANDOM_LONG( 0, 15 ) ); |
|
|
|
EMIT_SOUND_DYN( edict(), CHAN_WEAPON, RANDOM_SOUND_ARRAY( pAttackHitSounds ), 1.0, ATTN_NORM, 0, 50 + RANDOM_LONG( 0, 15 ) ); |
|
|
|
} |
|
|
|
} |
|
|
|
else // Play a random attack miss sound
|
|
|
|
else // Play a random attack miss sound
|
|
|
|
EMIT_SOUND_DYN( edict(), CHAN_WEAPON, pAttackMissSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackMissSounds ) - 1 )], 1.0, ATTN_NORM, 0, 50 + RANDOM_LONG( 0, 15 ) ); |
|
|
|
EMIT_SOUND_DYN( edict(), CHAN_WEAPON, RANDOM_SOUND_ARRAY( pAttackMissSounds ), 1.0, ATTN_NORM, 0, 50 + RANDOM_LONG( 0, 15 ) ); |
|
|
|
|
|
|
|
|
|
|
|
Vector forward; |
|
|
|
Vector forward; |
|
|
|
UTIL_MakeVectorsPrivate( pev->angles, forward, NULL, NULL ); |
|
|
|
UTIL_MakeVectorsPrivate( pev->angles, forward, NULL, NULL ); |
|
|
@ -988,14 +965,14 @@ void CGargantua::HandleAnimEvent( MonsterEvent_t *pEvent ) |
|
|
|
case GARG_AE_RIGHT_FOOT: |
|
|
|
case GARG_AE_RIGHT_FOOT: |
|
|
|
case GARG_AE_LEFT_FOOT: |
|
|
|
case GARG_AE_LEFT_FOOT: |
|
|
|
UTIL_ScreenShake( pev->origin, 4.0, 3.0, 1.0, 750 ); |
|
|
|
UTIL_ScreenShake( pev->origin, 4.0, 3.0, 1.0, 750 ); |
|
|
|
EMIT_SOUND_DYN( edict(), CHAN_BODY, pFootSounds[RANDOM_LONG( 0, ARRAYSIZE( pFootSounds ) - 1 )], 1.0, ATTN_GARG, 0, PITCH_NORM + RANDOM_LONG( -10, 10 ) ); |
|
|
|
EMIT_SOUND_DYN( edict(), CHAN_BODY, RANDOM_SOUND_ARRAY( pFootSounds ), 1.0, ATTN_GARG, 0, PITCH_NORM + RANDOM_LONG( -10, 10 ) ); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case GARG_AE_STOMP: |
|
|
|
case GARG_AE_STOMP: |
|
|
|
StompAttack(); |
|
|
|
StompAttack(); |
|
|
|
m_seeTime = gpGlobals->time + 12.0f; |
|
|
|
m_seeTime = gpGlobals->time + 12.0f; |
|
|
|
break; |
|
|
|
break; |
|
|
|
case GARG_AE_BREATHE: |
|
|
|
case GARG_AE_BREATHE: |
|
|
|
EMIT_SOUND_DYN( edict(), CHAN_VOICE, pBreatheSounds[RANDOM_LONG( 0, ARRAYSIZE( pBreatheSounds ) - 1 )], 1.0, ATTN_GARG, 0, PITCH_NORM + RANDOM_LONG( -10, 10 ) ); |
|
|
|
EMIT_SOUND_DYN( edict(), CHAN_VOICE, RANDOM_SOUND_ARRAY( pBreatheSounds ), 1.0, ATTN_GARG, 0, PITCH_NORM + RANDOM_LONG( -10, 10 ) ); |
|
|
|
break; |
|
|
|
break; |
|
|
|
default: |
|
|
|
default: |
|
|
|
CBaseMonster::HandleAnimEvent( pEvent ); |
|
|
|
CBaseMonster::HandleAnimEvent( pEvent ); |
|
|
@ -1071,7 +1048,7 @@ void CGargantua::StartTask( Task_t *pTask ) |
|
|
|
break; |
|
|
|
break; |
|
|
|
case TASK_SOUND_ATTACK: |
|
|
|
case TASK_SOUND_ATTACK: |
|
|
|
if( RANDOM_LONG( 0, 100 ) < 30 ) |
|
|
|
if( RANDOM_LONG( 0, 100 ) < 30 ) |
|
|
|
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, pAttackSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackSounds ) - 1 )], 1.0, ATTN_GARG, 0, PITCH_NORM ); |
|
|
|
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, RANDOM_SOUND_ARRAY( pAttackSounds ), 1.0, ATTN_GARG, 0, PITCH_NORM ); |
|
|
|
TaskComplete(); |
|
|
|
TaskComplete(); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case TASK_DIE: |
|
|
|
case TASK_DIE: |
|
|
|