Browse Source

Add monster_xenocrab implementation.

residual_point
Night Owl 7 years ago
parent
commit
98bde36aac
  1. 14
      dlls/headcrab.cpp

14
dlls/headcrab.cpp

@ -108,6 +108,7 @@ public:
}; };
LINK_ENTITY_TO_CLASS( monster_headcrab, CHeadCrab ) LINK_ENTITY_TO_CLASS( monster_headcrab, CHeadCrab )
LINK_ENTITY_TO_CLASS( monster_xenocrab, CHeadCrab )
DEFINE_CUSTOM_SCHEDULES( CHeadCrab ) DEFINE_CUSTOM_SCHEDULES( CHeadCrab )
{ {
@ -186,6 +187,12 @@ void CHeadCrab::SetYawSpeed( void )
{ {
int ys; int ys;
if( FClassnameIs( pev, "monster_xenocrab" ) )
{
pev->yaw_speed = RANDOM_LONG( 80, 90 );
}
else
{
switch( m_Activity ) switch( m_Activity )
{ {
case ACT_IDLE: case ACT_IDLE:
@ -206,6 +213,7 @@ void CHeadCrab::SetYawSpeed( void )
ys = 30; ys = 30;
break; break;
} }
}
pev->yaw_speed = ys; pev->yaw_speed = ys;
} }
@ -281,6 +289,9 @@ void CHeadCrab::Spawn()
{ {
Precache(); Precache();
if( FClassnameIs( pev, "monster_xenocrab" ) )
SET_MODEL( ENT( pev ), "models/xenocrab.mdl" );
else
SET_MODEL( ENT( pev ), "models/headcrab.mdl" ); SET_MODEL( ENT( pev ), "models/headcrab.mdl" );
UTIL_SetSize( pev, Vector( -12, -12, 0 ), Vector( 12, 12, 24 ) ); UTIL_SetSize( pev, Vector( -12, -12, 0 ), Vector( 12, 12, 24 ) );
@ -309,6 +320,9 @@ void CHeadCrab::Precache()
PRECACHE_SOUND_ARRAY( pDeathSounds ); PRECACHE_SOUND_ARRAY( pDeathSounds );
PRECACHE_SOUND_ARRAY( pBiteSounds ); PRECACHE_SOUND_ARRAY( pBiteSounds );
if( FClassnameIs( pev, "monster_xenocrab" ) )
PRECACHE_MODEL( "models/xenocrab.mdl" );
else
PRECACHE_MODEL( "models/headcrab.mdl" ); PRECACHE_MODEL( "models/headcrab.mdl" );
} }

Loading…
Cancel
Save