|
|
@ -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,25 +187,32 @@ void CHeadCrab::SetYawSpeed( void ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
int ys; |
|
|
|
int ys; |
|
|
|
|
|
|
|
|
|
|
|
switch( m_Activity ) |
|
|
|
if( FClassnameIs( pev, "monster_xenocrab" ) ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
case ACT_IDLE: |
|
|
|
pev->yaw_speed = RANDOM_LONG( 80, 90 ); |
|
|
|
ys = 30; |
|
|
|
} |
|
|
|
break; |
|
|
|
else |
|
|
|
case ACT_RUN: |
|
|
|
{ |
|
|
|
case ACT_WALK: |
|
|
|
switch( m_Activity ) |
|
|
|
ys = 20; |
|
|
|
{ |
|
|
|
break; |
|
|
|
case ACT_IDLE: |
|
|
|
case ACT_TURN_LEFT: |
|
|
|
ys = 30; |
|
|
|
case ACT_TURN_RIGHT: |
|
|
|
break; |
|
|
|
ys = 60; |
|
|
|
case ACT_RUN: |
|
|
|
break; |
|
|
|
case ACT_WALK: |
|
|
|
case ACT_RANGE_ATTACK1: |
|
|
|
ys = 20; |
|
|
|
ys = 30; |
|
|
|
break; |
|
|
|
break; |
|
|
|
case ACT_TURN_LEFT: |
|
|
|
default: |
|
|
|
case ACT_TURN_RIGHT: |
|
|
|
ys = 30; |
|
|
|
ys = 60; |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
case ACT_RANGE_ATTACK1: |
|
|
|
|
|
|
|
ys = 30; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
ys = 30; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
pev->yaw_speed = ys; |
|
|
|
pev->yaw_speed = ys; |
|
|
@ -281,7 +289,10 @@ void CHeadCrab::Spawn() |
|
|
|
{ |
|
|
|
{ |
|
|
|
Precache(); |
|
|
|
Precache(); |
|
|
|
|
|
|
|
|
|
|
|
SET_MODEL( ENT( pev ), "models/headcrab.mdl" ); |
|
|
|
if( FClassnameIs( pev, "monster_xenocrab" ) ) |
|
|
|
|
|
|
|
SET_MODEL( ENT( pev ), "models/xenocrab.mdl" ); |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
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 ) ); |
|
|
|
|
|
|
|
|
|
|
|
pev->solid = SOLID_SLIDEBOX; |
|
|
|
pev->solid = SOLID_SLIDEBOX; |
|
|
@ -309,7 +320,10 @@ void CHeadCrab::Precache() |
|
|
|
PRECACHE_SOUND_ARRAY( pDeathSounds ); |
|
|
|
PRECACHE_SOUND_ARRAY( pDeathSounds ); |
|
|
|
PRECACHE_SOUND_ARRAY( pBiteSounds ); |
|
|
|
PRECACHE_SOUND_ARRAY( pBiteSounds ); |
|
|
|
|
|
|
|
|
|
|
|
PRECACHE_MODEL( "models/headcrab.mdl" ); |
|
|
|
if( FClassnameIs( pev, "monster_xenocrab" ) ) |
|
|
|
|
|
|
|
PRECACHE_MODEL( "models/xenocrab.mdl" ); |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
PRECACHE_MODEL( "models/headcrab.mdl" ); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//=========================================================
|
|
|
|
//=========================================================
|
|
|
|