Browse Source

Add monster_human_grunt_ally, monster_nari_grunt and monster_zombie_grunt implementations.

residual_point
Night Owl 7 years ago
parent
commit
9a7fb0fcda
  1. 3
      dlls/CMakeLists.txt
  2. 103
      dlls/hgrunt.cpp
  3. 89
      dlls/hgrunt.h
  4. 1687
      dlls/rp/fgrunt.cpp
  5. 1581
      dlls/rp/ngrunt.cpp
  6. 1720
      dlls/rp/zgrunt.cpp
  7. 26
      dlls/zombie.cpp

3
dlls/CMakeLists.txt

@ -129,10 +129,13 @@ set (SVDLL_SOURCES
zombie.cpp zombie.cpp
rp/blkop_apache.cpp rp/blkop_apache.cpp
rp/blkop_osprey.cpp rp/blkop_osprey.cpp
rp/fgrunt.cpp
rp/gonome.cpp rp/gonome.cpp
rp/massn.cpp rp/massn.cpp
rp/ngrunt.cpp
rp/otis.cpp rp/otis.cpp
rp/pitdrone.cpp rp/pitdrone.cpp
rp/zgrunt.cpp
../pm_shared/pm_debug.c ../pm_shared/pm_debug.c
../pm_shared/pm_math.c ../pm_shared/pm_math.c
../pm_shared/pm_shared.c ../pm_shared/pm_shared.c

103
dlls/hgrunt.cpp

@ -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.
// //
@ -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;
@ -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
@ -1113,7 +1025,6 @@ void CHGrunt::PainSound( void )
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;
} }
} }
@ -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_opfor.mdl" );
SET_MODEL( ENT( pev ), "models/hgrunt_opfor.mdl" );
}
else
{
PRECACHE_MODEL( "models/hgrunt.mdl" ); PRECACHE_MODEL( "models/hgrunt.mdl" );
SET_MODEL( ENT( pev ), "models/hgrunt.mdl" ); SET_MODEL( ENT( pev ), "models/hgrunt.mdl" );
}
pev->effects = 0; pev->effects = 0;
pev->yaw_speed = 8; pev->yaw_speed = 8;

89
dlls/hgrunt.h

@ -15,6 +15,80 @@
#ifndef HGRUNT_H #ifndef HGRUNT_H
#define HGRUNT_H #define HGRUNT_H
//=========================================================
// 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 )
//========================================================= //=========================================================
// hgrunt // hgrunt
//========================================================= //=========================================================
@ -40,7 +114,7 @@ public:
virtual void IdleSound(void); virtual void IdleSound(void);
Vector GetGunPosition(void); Vector GetGunPosition(void);
void Shoot(void); void Shoot(void);
void Shotgun(void); virtual void Shotgun(void);
void PrescheduleThink(void); void PrescheduleThink(void);
virtual void GibMonster(void); virtual void GibMonster(void);
virtual void SpeakSentence(void); virtual void SpeakSentence(void);
@ -54,7 +128,7 @@ public:
void TraceAttack(entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType); void TraceAttack(entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType);
int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType); int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
int IRelationship(CBaseEntity *pTarget); virtual int IRelationship(CBaseEntity *pTarget);
virtual BOOL FOkToSpeak(void); virtual BOOL FOkToSpeak(void);
void JustSpoke(void); void JustSpoke(void);
@ -85,6 +159,17 @@ public:
static const char *pGruntSentences[]; static const char *pGruntSentences[];
}; };
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;
//========================================================= //=========================================================
// CHGruntRepel - when triggered, spawns a monster_human_grunt // CHGruntRepel - when triggered, spawns a monster_human_grunt

1687
dlls/rp/fgrunt.cpp

File diff suppressed because it is too large Load Diff

1581
dlls/rp/ngrunt.cpp

File diff suppressed because it is too large Load Diff

1720
dlls/rp/zgrunt.cpp

File diff suppressed because it is too large Load Diff

26
dlls/zombie.cpp

@ -37,7 +37,6 @@
LINK_ENTITY_TO_CLASS( monster_zombie, CZombie ) LINK_ENTITY_TO_CLASS( monster_zombie, CZombie )
LINK_ENTITY_TO_CLASS( monster_zombie_barney, CZombie ) LINK_ENTITY_TO_CLASS( monster_zombie_barney, CZombie )
LINK_ENTITY_TO_CLASS( monster_zombie_soldier, CZombie ) LINK_ENTITY_TO_CLASS( monster_zombie_soldier, CZombie )
LINK_ENTITY_TO_CLASS( monster_zombie_grunt, CZombie )
const char *CZombie::pAttackHitSounds[] = const char *CZombie::pAttackHitSounds[] =
{ {
@ -244,8 +243,6 @@ void CZombie::Spawn()
SET_MODEL( ENT( pev ), "models/zombie_barney.mdl" ); SET_MODEL( ENT( pev ), "models/zombie_barney.mdl" );
else if( FClassnameIs( pev, "monster_zombie_soldier" ) ) else if( FClassnameIs( pev, "monster_zombie_soldier" ) )
SET_MODEL( ENT( pev ), "models/zombie_soldier.mdl" ); SET_MODEL( ENT( pev ), "models/zombie_soldier.mdl" );
else if( FClassnameIs( pev, "monster_zombie_grunt" ) )
SET_MODEL( ENT( pev ), "models/zgrunt.mdl" );
else else
SET_MODEL( ENT( pev ), "models/zombie.mdl" ); SET_MODEL( ENT( pev ), "models/zombie.mdl" );
UTIL_SetSize( pev, VEC_HUMAN_HULL_MIN, VEC_HUMAN_HULL_MAX ); UTIL_SetSize( pev, VEC_HUMAN_HULL_MIN, VEC_HUMAN_HULL_MAX );
@ -273,8 +270,6 @@ void CZombie::Precache()
PRECACHE_MODEL( "models/zombie_barney.mdl" ); PRECACHE_MODEL( "models/zombie_barney.mdl" );
else if( FClassnameIs( pev, "monster_zombie_soldier" ) ) else if( FClassnameIs( pev, "monster_zombie_soldier" ) )
PRECACHE_MODEL( "models/zombie_soldier.mdl" ); PRECACHE_MODEL( "models/zombie_soldier.mdl" );
else if( FClassnameIs( pev, "monster_zombie_grunt" ) )
PRECACHE_MODEL( "models/zgrunt.mdl" );
else else
PRECACHE_MODEL( "models/zombie.mdl" ); PRECACHE_MODEL( "models/zombie.mdl" );
@ -326,9 +321,9 @@ int CZombie::IgnoreConditions( void )
} }
//========================================================= //=========================================================
// DEAD ZGRUNT PROP // DEAD ZSOLDIER PROP
//========================================================= //=========================================================
class CDeadZGrunt : public CBaseMonster class CDeadZSoldier : public CBaseMonster
{ {
public: public:
void Spawn(); void Spawn();
@ -340,13 +335,13 @@ public:
static char *m_szPoses[2]; static char *m_szPoses[2];
}; };
char *CDeadZGrunt::m_szPoses[] = char *CDeadZSoldier::m_szPoses[] =
{ {
"dead_on_back", "dead_on_back",
"dead_on_stomach" "dead_on_stomach"
}; };
void CDeadZGrunt::KeyValue( KeyValueData *pkvd ) void CDeadZSoldier::KeyValue( KeyValueData *pkvd )
{ {
if( FStrEq( pkvd->szKeyName, "pose" ) ) if( FStrEq( pkvd->szKeyName, "pose" ) )
{ {
@ -357,24 +352,15 @@ void CDeadZGrunt::KeyValue( KeyValueData *pkvd )
CBaseMonster::KeyValue( pkvd ); CBaseMonster::KeyValue( pkvd );
} }
LINK_ENTITY_TO_CLASS( monster_zombie_soldier_dead, CDeadZGrunt ) LINK_ENTITY_TO_CLASS( monster_zombie_soldier_dead, CDeadZSoldier )
LINK_ENTITY_TO_CLASS( monster_zgrunt_dead, CDeadZGrunt )
//========================================================= //=========================================================
// ********** DeadZGrunt SPAWN ********** // ********** DeadZGrunt SPAWN **********
//========================================================= //=========================================================
void CDeadZGrunt::Spawn() void CDeadZSoldier::Spawn()
{ {
if( FClassnameIs( pev, "monster_zgrunt_dead" ) )
{
PRECACHE_MODEL( "models/zgrunt.mdl" );
SET_MODEL( ENT( pev ), "models/zgrunt.mdl" );
}
else
{
PRECACHE_MODEL( "models/zombie_soldier.mdl" ); PRECACHE_MODEL( "models/zombie_soldier.mdl" );
SET_MODEL( ENT( pev ), "models/zombie_soldier.mdl" ); SET_MODEL( ENT( pev ), "models/zombie_soldier.mdl" );
}
pev->effects = 0; pev->effects = 0;
pev->yaw_speed = 8; pev->yaw_speed = 8;

Loading…
Cancel
Save