Browse Source

add monster_gus and monster_zombie_barney implementations.

CAd
Night Owl 7 years ago
parent
commit
ad1c3470b3
  1. 28
      dlls/scientist.cpp
  2. 12
      dlls/zombie.cpp

28
dlls/scientist.cpp

@ -119,6 +119,7 @@ private:
}; };
LINK_ENTITY_TO_CLASS( monster_scientist, CScientist ) LINK_ENTITY_TO_CLASS( monster_scientist, CScientist )
LINK_ENTITY_TO_CLASS( monster_gus, CScientist )
TYPEDESCRIPTION CScientist::m_SaveData[] = TYPEDESCRIPTION CScientist::m_SaveData[] =
{ {
@ -639,7 +640,10 @@ void CScientist::Spawn( void )
{ {
Precache(); Precache();
SET_MODEL( ENT( pev ), "models/scientist.mdl" ); if( FClassnameIs( pev, "monster_gus" ) )
SET_MODEL( ENT( pev ), "models/gus.mdl" );
else
SET_MODEL( ENT( pev ), "models/scientist.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;
@ -676,7 +680,11 @@ void CScientist::Spawn( void )
//========================================================= //=========================================================
void CScientist::Precache( void ) void CScientist::Precache( void )
{ {
PRECACHE_MODEL( "models/scientist.mdl" ); if( FClassnameIs( pev, "monster_gus" ) )
PRECACHE_MODEL( "models/gus.mdl" );
else
PRECACHE_MODEL( "models/scientist.mdl" );
PRECACHE_SOUND( "scientist/sci_pain1.wav" ); PRECACHE_SOUND( "scientist/sci_pain1.wav" );
PRECACHE_SOUND( "scientist/sci_pain2.wav" ); PRECACHE_SOUND( "scientist/sci_pain2.wav" );
PRECACHE_SOUND( "scientist/sci_pain3.wav" ); PRECACHE_SOUND( "scientist/sci_pain3.wav" );
@ -1053,6 +1061,9 @@ MONSTERSTATE CScientist::GetIdealState( void )
BOOL CScientist::CanHeal( void ) BOOL CScientist::CanHeal( void )
{ {
if( FClassnameIs( pev, "monster_gus" ) )
return FALSE;
if( ( m_healTime > gpGlobals->time ) || ( m_hTargetEnt == 0 ) || ( m_hTargetEnt->pev->health > ( m_hTargetEnt->pev->max_health * 0.5 ) ) ) if( ( m_healTime > gpGlobals->time ) || ( m_hTargetEnt == 0 ) || ( m_hTargetEnt->pev->health > ( m_hTargetEnt->pev->max_health * 0.5 ) ) )
return FALSE; return FALSE;
@ -1121,14 +1132,23 @@ void CDeadScientist::KeyValue( KeyValueData *pkvd )
CBaseMonster::KeyValue( pkvd ); CBaseMonster::KeyValue( pkvd );
} }
LINK_ENTITY_TO_CLASS( monster_scientist_dead, CDeadScientist ) LINK_ENTITY_TO_CLASS( monster_scientist_dead, CDeadScientist )
LINK_ENTITY_TO_CLASS( monster_gus_dead, CDeadScientist )
// //
// ********** DeadScientist SPAWN ********** // ********** DeadScientist SPAWN **********
// //
void CDeadScientist::Spawn() void CDeadScientist::Spawn()
{ {
PRECACHE_MODEL( "models/scientist.mdl" ); if( FClassnameIs( pev, "monster_gus" ) )
SET_MODEL( ENT( pev ), "models/scientist.mdl" ); {
PRECACHE_MODEL( "models/gus.mdl" );
SET_MODEL( ENT( pev ), "models/gus.mdl" );
}
else
{
PRECACHE_MODEL( "models/scientist.mdl" );
SET_MODEL( ENT( pev ), "models/scientist.mdl" );
}
pev->effects = 0; pev->effects = 0;
pev->sequence = 0; pev->sequence = 0;

12
dlls/zombie.cpp

@ -64,6 +64,7 @@ public:
}; };
LINK_ENTITY_TO_CLASS( monster_zombie, CZombie ) LINK_ENTITY_TO_CLASS( monster_zombie, CZombie )
LINK_ENTITY_TO_CLASS( monster_zombie_barney, CZombie )
const char *CZombie::pAttackHitSounds[] = const char *CZombie::pAttackHitSounds[] =
{ {
@ -266,7 +267,11 @@ void CZombie::Spawn()
{ {
Precache(); Precache();
SET_MODEL( ENT( pev ), "models/zombie.mdl" ); if( FClassnameIs( pev, "monster_zombie_barney" ) )
SET_MODEL( ENT( pev ), "models/zombie_barney.mdl" );
else
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 );
pev->solid = SOLID_SLIDEBOX; pev->solid = SOLID_SLIDEBOX;
@ -288,7 +293,10 @@ void CZombie::Precache()
{ {
size_t i; size_t i;
PRECACHE_MODEL( "models/zombie.mdl" ); if( FClassnameIs( pev, "monster_zombie_barney" ) )
PRECACHE_MODEL( "models/zombie_barney.mdl" );
else
PRECACHE_MODEL( "models/zombie.mdl" );
for( i = 0; i < ARRAYSIZE( pAttackHitSounds ); i++ ) for( i = 0; i < ARRAYSIZE( pAttackHitSounds ); i++ )
PRECACHE_SOUND( pAttackHitSounds[i] ); PRECACHE_SOUND( pAttackHitSounds[i] );

Loading…
Cancel
Save