@ -46,80 +46,6 @@ int g_fGruntQuestion; // true if an idle grunt asked a question. Cleared when
extern DLL_GLOBAL int g_iSkillLevel ;
extern DLL_GLOBAL int g_iSkillLevel ;
//=========================================================
// monster-specific DEFINE's
//=========================================================
# define GRUNT_CLIP_SIZE 36 // how many bullets in a clip? - NOTE: 3 round burst sound, so keep as 3 * x!
# define GRUNT_VOL 0.35 // volume of grunt sounds
# define GRUNT_ATTN ATTN_NORM // attenutation of grunt sentences
# define HGRUNT_LIMP_HEALTH 20
# define HGRUNT_DMG_HEADSHOT ( DMG_BULLET | DMG_CLUB ) // damage types that can kill a grunt with a single headshot.
# define HGRUNT_NUM_HEADS 2 // how many grunt heads are there?
# define HGRUNT_MINIMUM_HEADSHOT_DAMAGE 15 // must do at least this much damage in one shot to head to score a headshot kill
# define HGRUNT_SENTENCE_VOLUME (float)0.35 // volume of grunt sentences
# define HGRUNT_9MMAR ( 1 << 0)
# define HGRUNT_HANDGRENADE ( 1 << 1)
# define HGRUNT_GRENADELAUNCHER ( 1 << 2)
# define HGRUNT_SHOTGUN ( 1 << 3)
# define HEAD_GROUP 1
# define HEAD_GRUNT 0
# define HEAD_COMMANDER 1
# define HEAD_SHOTGUN 2
# define HEAD_M203 3
# define GUN_GROUP 2
# define GUN_MP5 0
# define GUN_SHOTGUN 1
# define GUN_NONE 2
//=========================================================
// Monster's Anim Events Go Here
//=========================================================
# define HGRUNT_AE_RELOAD ( 2 )
# define HGRUNT_AE_KICK ( 3 )
# define HGRUNT_AE_BURST1 ( 4 )
# define HGRUNT_AE_BURST2 ( 5 )
# define HGRUNT_AE_BURST3 ( 6 )
# define HGRUNT_AE_GREN_TOSS ( 7 )
# define HGRUNT_AE_GREN_LAUNCH ( 8 )
# define HGRUNT_AE_GREN_DROP ( 9 )
# define HGRUNT_AE_CAUGHT_ENEMY ( 10 ) // grunt established sight with an enemy (player only) that had previously eluded the squad.
# define HGRUNT_AE_DROP_GUN ( 11 ) // grunt (probably dead) is dropping his mp5.
//=========================================================
// monster-specific schedule types
//=========================================================
enum
{
SCHED_GRUNT_SUPPRESS = LAST_COMMON_SCHEDULE + 1 ,
SCHED_GRUNT_ESTABLISH_LINE_OF_FIRE , // move to a location to set up an attack against the enemy. (usually when a friendly is in the way).
SCHED_GRUNT_COVER_AND_RELOAD ,
SCHED_GRUNT_SWEEP ,
SCHED_GRUNT_FOUND_ENEMY ,
SCHED_GRUNT_REPEL ,
SCHED_GRUNT_REPEL_ATTACK ,
SCHED_GRUNT_REPEL_LAND ,
SCHED_GRUNT_WAIT_FACE_ENEMY ,
SCHED_GRUNT_TAKECOVER_FAILED , // special schedule type that forces analysis of conditions and picks the best possible schedule to recover from this type of failure.
SCHED_GRUNT_ELOF_FAIL
} ;
//=========================================================
// monster-specific tasks
//=========================================================
enum
{
TASK_GRUNT_FACE_TOSS_DIR = LAST_COMMON_TASK + 1 ,
TASK_GRUNT_SPEAK_SENTENCE ,
TASK_GRUNT_CHECK_FIRE
} ;
//=========================================================
// monster-specific conditions
//=========================================================
# define bits_COND_GRUNT_NOFIRE ( bits_COND_SPECIAL1 )
LINK_ENTITY_TO_CLASS ( monster_human_grunt , CHGrunt )
LINK_ENTITY_TO_CLASS ( monster_human_grunt , CHGrunt )
TYPEDESCRIPTION CHGrunt : : m_SaveData [ ] =
TYPEDESCRIPTION CHGrunt : : m_SaveData [ ] =
@ -151,18 +77,6 @@ const char *CHGrunt::pGruntSentences[] =
" HG_TAUNT " , // say rude things
" HG_TAUNT " , // say rude things
} ;
} ;
typedef enum
{
HGRUNT_SENT_NONE = - 1 ,
HGRUNT_SENT_GREN = 0 ,
HGRUNT_SENT_ALERT ,
HGRUNT_SENT_MONSTER ,
HGRUNT_SENT_COVER ,
HGRUNT_SENT_THROW ,
HGRUNT_SENT_CHARGE ,
HGRUNT_SENT_TAUNT
} HGRUNT_SENTENCE_TYPES ;
//=========================================================
//=========================================================
// Speak Sentence - say your cued up sentence.
// Speak Sentence - say your cued up sentence.
//
//
@ -647,7 +561,7 @@ void CHGrunt::IdleSound( void )
SENTENCEG_PlayRndSz ( ENT ( pev ) , " HG_CLEAR " , HGRUNT_SENTENCE_VOLUME , ATTN_NORM , 0 , m_voicePitch ) ;
SENTENCEG_PlayRndSz ( ENT ( pev ) , " HG_CLEAR " , HGRUNT_SENTENCE_VOLUME , ATTN_NORM , 0 , m_voicePitch ) ;
break ;
break ;
case 2 :
case 2 :
// question
// question
SENTENCEG_PlayRndSz ( ENT ( pev ) , " HG_ANSWER " , HGRUNT_SENTENCE_VOLUME , ATTN_NORM , 0 , m_voicePitch ) ;
SENTENCEG_PlayRndSz ( ENT ( pev ) , " HG_ANSWER " , HGRUNT_SENTENCE_VOLUME , ATTN_NORM , 0 , m_voicePitch ) ;
break ;
break ;
}
}
@ -859,7 +773,6 @@ void CHGrunt::HandleAnimEvent( MonsterEvent_t *pEvent )
else
else
{
{
Shotgun ( ) ;
Shotgun ( ) ;
EMIT_SOUND ( ENT ( pev ) , CHAN_WEAPON , " weapons/sbarrel1.wav " , 1 , ATTN_NORM ) ;
EMIT_SOUND ( ENT ( pev ) , CHAN_WEAPON , " weapons/sbarrel1.wav " , 1 , ATTN_NORM ) ;
}
}
@ -907,6 +820,7 @@ void CHGrunt::Spawn()
Precache ( ) ;
Precache ( ) ;
SET_MODEL ( ENT ( pev ) , " models/hgrunt.mdl " ) ;
SET_MODEL ( ENT ( pev ) , " models/hgrunt.mdl " ) ;
UTIL_SetSize ( pev , VEC_HUMAN_HULL_MIN , VEC_HUMAN_HULL_MAX ) ;
UTIL_SetSize ( pev , VEC_HUMAN_HULL_MIN , VEC_HUMAN_HULL_MAX ) ;
pev - > solid = SOLID_SLIDEBOX ;
pev - > solid = SOLID_SLIDEBOX ;
@ -975,7 +889,7 @@ void CHGrunt::Precache()
PRECACHE_SOUND ( " hgrunt/gr_mgun1.wav " ) ;
PRECACHE_SOUND ( " hgrunt/gr_mgun1.wav " ) ;
PRECACHE_SOUND ( " hgrunt/gr_mgun2.wav " ) ;
PRECACHE_SOUND ( " hgrunt/gr_mgun2.wav " ) ;
PRECACHE_SOUND ( " hgrunt/gr_die1.wav " ) ;
PRECACHE_SOUND ( " hgrunt/gr_die1.wav " ) ;
PRECACHE_SOUND ( " hgrunt/gr_die2.wav " ) ;
PRECACHE_SOUND ( " hgrunt/gr_die2.wav " ) ;
PRECACHE_SOUND ( " hgrunt/gr_die3.wav " ) ;
PRECACHE_SOUND ( " hgrunt/gr_die3.wav " ) ;
@ -986,12 +900,10 @@ void CHGrunt::Precache()
PRECACHE_SOUND ( " hgrunt/gr_pain4.wav " ) ;
PRECACHE_SOUND ( " hgrunt/gr_pain4.wav " ) ;
PRECACHE_SOUND ( " hgrunt/gr_pain5.wav " ) ;
PRECACHE_SOUND ( " hgrunt/gr_pain5.wav " ) ;
PRECACHE_SOUND ( " weapons/sbarrel1.wav " ) ;
PRECACHE_SOUND ( " hgrunt/gr_reload1.wav " ) ;
PRECACHE_SOUND ( " hgrunt/gr_reload1.wav " ) ;
PRECACHE_SOUND ( " weapons/glauncher.wav " ) ;
PRECACHE_SOUND ( " weapons/glauncher.wav " ) ;
PRECACHE_SOUND ( " weapons/sbarrel1.wav " ) ;
PRECACHE_SOUND ( " zombie/claw_miss2.wav " ) ; // because we use the basemonster SWIPE animation event
PRECACHE_SOUND ( " zombie/claw_miss2.wav " ) ; // because we use the basemonster SWIPE animation event
// get voice pitch
// get voice pitch
@ -1097,23 +1009,22 @@ void CHGrunt::PainSound( void )
# endif
# endif
switch ( RANDOM_LONG ( 0 , 6 ) )
switch ( RANDOM_LONG ( 0 , 6 ) )
{
{
case 0 :
case 0 :
EMIT_SOUND ( ENT ( pev ) , CHAN_VOICE , " hgrunt/gr_pain3.wav " , 1 , ATTN_NORM ) ;
EMIT_SOUND ( ENT ( pev ) , CHAN_VOICE , " hgrunt/gr_pain3.wav " , 1 , ATTN_NORM ) ;
break ;
break ;
case 1 :
case 1 :
EMIT_SOUND ( ENT ( pev ) , CHAN_VOICE , " hgrunt/gr_pain4.wav " , 1 , ATTN_NORM ) ;
EMIT_SOUND ( ENT ( pev ) , CHAN_VOICE , " hgrunt/gr_pain4.wav " , 1 , ATTN_NORM ) ;
break ;
break ;
case 2 :
case 2 :
EMIT_SOUND ( ENT ( pev ) , CHAN_VOICE , " hgrunt/gr_pain5.wav " , 1 , ATTN_NORM ) ;
EMIT_SOUND ( ENT ( pev ) , CHAN_VOICE , " hgrunt/gr_pain5.wav " , 1 , ATTN_NORM ) ;
break ;
break ;
case 3 :
case 3 :
EMIT_SOUND ( ENT ( pev ) , CHAN_VOICE , " hgrunt/gr_pain1.wav " , 1 , ATTN_NORM ) ;
EMIT_SOUND ( ENT ( pev ) , CHAN_VOICE , " hgrunt/gr_pain1.wav " , 1 , ATTN_NORM ) ;
break ;
break ;
case 4 :
case 4 :
EMIT_SOUND ( ENT ( pev ) , CHAN_VOICE , " hgrunt/gr_pain2.wav " , 1 , ATTN_NORM ) ;
EMIT_SOUND ( ENT ( pev ) , CHAN_VOICE , " hgrunt/gr_pain2.wav " , 1 , ATTN_NORM ) ;
break ;
break ;
}
}
m_flNextPainTime = gpGlobals - > time + 1 ;
m_flNextPainTime = gpGlobals - > time + 1 ;
}
}
}
}
@ -1126,13 +1037,13 @@ void CHGrunt::DeathSound( void )
switch ( RANDOM_LONG ( 0 , 2 ) )
switch ( RANDOM_LONG ( 0 , 2 ) )
{
{
case 0 :
case 0 :
EMIT_SOUND ( ENT ( pev ) , CHAN_VOICE , " hgrunt/gr_die1.wav " , 1 , ATTN_IDLE ) ;
EMIT_SOUND ( ENT ( pev ) , CHAN_VOICE , " hgrunt/gr_die1.wav " , 1 , ATTN_IDLE ) ;
break ;
break ;
case 1 :
case 1 :
EMIT_SOUND ( ENT ( pev ) , CHAN_VOICE , " hgrunt/gr_die2.wav " , 1 , ATTN_IDLE ) ;
EMIT_SOUND ( ENT ( pev ) , CHAN_VOICE , " hgrunt/gr_die2.wav " , 1 , ATTN_IDLE ) ;
break ;
break ;
case 2 :
case 2 :
EMIT_SOUND ( ENT ( pev ) , CHAN_VOICE , " hgrunt/gr_die3.wav " , 1 , ATTN_IDLE ) ;
EMIT_SOUND ( ENT ( pev ) , CHAN_VOICE , " hgrunt/gr_die3.wav " , 1 , ATTN_IDLE ) ;
break ;
break ;
}
}
}
}
@ -2290,6 +2201,7 @@ void CHGruntRepel::Spawn( void )
void CHGruntRepel : : Precache ( void )
void CHGruntRepel : : Precache ( void )
{
{
UTIL_PrecacheOther ( " monster_human_grunt " ) ;
UTIL_PrecacheOther ( " monster_human_grunt " ) ;
m_iSpriteTexture = PRECACHE_MODEL ( " sprites/rope.spr " ) ;
m_iSpriteTexture = PRECACHE_MODEL ( " sprites/rope.spr " ) ;
}
}
@ -2349,23 +2261,14 @@ void CDeadHGrunt::KeyValue( KeyValueData *pkvd )
}
}
LINK_ENTITY_TO_CLASS ( monster_hgrunt_dead , CDeadHGrunt )
LINK_ENTITY_TO_CLASS ( monster_hgrunt_dead , CDeadHGrunt )
LINK_ENTITY_TO_CLASS ( monster_human_grunt_ally_dead , CDeadHGrunt )
//=========================================================
//=========================================================
// ********** DeadHGrunt SPAWN **********
// ********** DeadHGrunt SPAWN **********
//=========================================================
//=========================================================
void CDeadHGrunt : : Spawn ( void )
void CDeadHGrunt : : Spawn ( void )
{
{
if ( FClassnameIs ( pev , " monster_human_grunt_ally_dead " ) )
PRECACHE_MODEL ( " models/hgrunt.mdl " ) ;
{
SET_MODEL ( ENT ( pev ) , " models/hgrunt.mdl " ) ;
PRECACHE_MODEL ( " models/hgrunt_opfor.mdl " ) ;
SET_MODEL ( ENT ( pev ) , " models/hgrunt_opfor.mdl " ) ;
}
else
{
PRECACHE_MODEL ( " models/hgrunt.mdl " ) ;
SET_MODEL ( ENT ( pev ) , " models/hgrunt.mdl " ) ;
}
pev - > effects = 0 ;
pev - > effects = 0 ;
pev - > yaw_speed = 8 ;
pev - > yaw_speed = 8 ;