Browse Source

Add monster_cleansuit_scientist and monsters corpses implementations.

residual_point
Night Owl 7 years ago
parent
commit
7bebcd6b4a
  1. 13
      dlls/barney.cpp
  2. 2
      dlls/headcrab.cpp
  3. 13
      dlls/hgrunt.cpp
  4. 38
      dlls/scientist.cpp
  5. 72
      dlls/zombie.cpp

13
dlls/barney.cpp

@ -800,14 +800,23 @@ void CDeadBarney::KeyValue( KeyValueData *pkvd )
} }
LINK_ENTITY_TO_CLASS( monster_barney_dead, CDeadBarney ) LINK_ENTITY_TO_CLASS( monster_barney_dead, CDeadBarney )
LINK_ENTITY_TO_CLASS( monster_civ_barney_dead, CDeadBarney )
//========================================================= //=========================================================
// ********** DeadBarney SPAWN ********** // ********** DeadBarney SPAWN **********
//========================================================= //=========================================================
void CDeadBarney::Spawn() void CDeadBarney::Spawn()
{ {
PRECACHE_MODEL( "models/barney.mdl" ); if( FClassnameIs( pev, "monster_civ_barney_dead" ) )
SET_MODEL( ENT( pev ), "models/barney.mdl" ); {
PRECACHE_MODEL( "models/dead_barney.mdl" );
SET_MODEL( ENT( pev ), "models/dead_barney.mdl" );
}
else
{
PRECACHE_MODEL( "models/barney.mdl" );
SET_MODEL( ENT( pev ), "models/barney.mdl" );
}
pev->effects = 0; pev->effects = 0;
pev->yaw_speed = 8; pev->yaw_speed = 8;

2
dlls/headcrab.cpp

@ -189,7 +189,7 @@ void CHeadCrab::SetYawSpeed( void )
if( FClassnameIs( pev, "monster_xenocrab" ) ) if( FClassnameIs( pev, "monster_xenocrab" ) )
{ {
pev->yaw_speed = RANDOM_LONG( 80, 90 ); ys = RANDOM_LONG( 80, 90 );
} }
else else
{ {

13
dlls/hgrunt.cpp

@ -2425,14 +2425,23 @@ 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 )
{ {
PRECACHE_MODEL( "models/hgrunt.mdl" ); if( FClassnameIs( pev, "monster_human_grunt_ally_dead" ) )
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;

38
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_cleansuit_scientist, CScientist )
TYPEDESCRIPTION CScientist::m_SaveData[] = TYPEDESCRIPTION CScientist::m_SaveData[] =
{ {
@ -639,7 +640,11 @@ void CScientist::Spawn( void )
{ {
Precache(); Precache();
SET_MODEL( ENT( pev ), "models/scientist.mdl" ); if( FClassnameIs( pev, "monster_cleansuit_scientist" ) )
SET_MODEL( ENT( pev ), "models/cleansuit_scientist.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 +681,11 @@ void CScientist::Spawn( void )
//========================================================= //=========================================================
void CScientist::Precache( void ) void CScientist::Precache( void )
{ {
PRECACHE_MODEL( "models/scientist.mdl" ); if( FClassnameIs( pev, "monster_cleansuit_scientist" ) )
PRECACHE_MODEL( "models/cleansuit_scientist.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" );
@ -1052,7 +1061,10 @@ MONSTERSTATE CScientist::GetIdealState( void )
} }
BOOL CScientist::CanHeal( void ) BOOL CScientist::CanHeal( void )
{ {
if( FClassnameIs( pev, "monster_cleansuit_scientist" ) )
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;
@ -1120,15 +1132,31 @@ void CDeadScientist::KeyValue( KeyValueData *pkvd )
else else
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_cleansuit_scientist_dead, CDeadScientist )
LINK_ENTITY_TO_CLASS( monster_civ_scientist_dead, CDeadScientist )
// //
// ********** DeadScientist SPAWN ********** // ********** DeadScientist SPAWN **********
// //
void CDeadScientist::Spawn() void CDeadScientist::Spawn()
{ {
PRECACHE_MODEL( "models/scientist.mdl" ); if( FClassnameIs( pev, "monster_cleansuit_scientist_dead" ) )
SET_MODEL( ENT( pev ), "models/scientist.mdl" ); {
PRECACHE_MODEL( "models/cleansuit_scientist.mdl" );
SET_MODEL( ENT( pev ), "models/cleansuit_scientist.mdl" );
}
else if( FClassnameIs( pev, "monster_civ_scientist_dead" ) )
{
PRECACHE_MODEL( "models/civ_scientist.mdl" );
SET_MODEL( ENT( pev ), "models/civ_scientist.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;

72
dlls/zombie.cpp

@ -324,3 +324,75 @@ int CZombie::IgnoreConditions( void )
return iIgnore; return iIgnore;
} }
//=========================================================
// DEAD ZGRUNT PROP
//=========================================================
class CDeadZGrunt : public CBaseMonster
{
public:
void Spawn();
int Classify() { return CLASS_ALIEN_MONSTER; }
void KeyValue( KeyValueData *pkvd );
int m_iPose;// which sequence to display -- temporary, don't need to save
static char *m_szPoses[2];
};
char *CDeadZGrunt::m_szPoses[] =
{
"dead_on_back",
"dead_on_stomach"
};
void CDeadZGrunt::KeyValue( KeyValueData *pkvd )
{
if( FStrEq( pkvd->szKeyName, "pose" ) )
{
m_iPose = atoi( pkvd->szValue );
pkvd->fHandled = TRUE;
}
else
CBaseMonster::KeyValue( pkvd );
}
LINK_ENTITY_TO_CLASS( monster_zombie_soldier_dead, CDeadZGrunt )
LINK_ENTITY_TO_CLASS( monster_zgrunt_dead, CDeadZGrunt )
//=========================================================
// ********** DeadZGrunt SPAWN **********
//=========================================================
void CDeadZGrunt::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" );
SET_MODEL( ENT( pev ), "models/zombie_soldier.mdl" );
}
pev->effects = 0;
pev->yaw_speed = 8;
pev->sequence = 0;
pev->body = 1;
m_bloodColor = BLOOD_COLOR_GREEN;
pev->sequence = LookupSequence( m_szPoses[m_iPose] );
if( pev->sequence == -1 )
{
ALERT( at_console, "Dead zombie soldier with bad pose\n" );
pev->sequence = 0;
pev->effects = EF_BRIGHTFIELD;
}
// Corpses have less health
pev->health = 8;
MonsterInitDead();
}

Loading…
Cancel
Save