Browse Source

Add monster_cleansuit_scientist and monsters corpses implementations.

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

9
dlls/barney.cpp

@ -800,14 +800,23 @@ void CDeadBarney::KeyValue( KeyValueData *pkvd ) @@ -800,14 +800,23 @@ void CDeadBarney::KeyValue( KeyValueData *pkvd )
}
LINK_ENTITY_TO_CLASS( monster_barney_dead, CDeadBarney )
LINK_ENTITY_TO_CLASS( monster_civ_barney_dead, CDeadBarney )
//=========================================================
// ********** DeadBarney SPAWN **********
//=========================================================
void CDeadBarney::Spawn()
{
if( FClassnameIs( pev, "monster_civ_barney_dead" ) )
{
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->yaw_speed = 8;

2
dlls/headcrab.cpp

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

9
dlls/hgrunt.cpp

@ -2425,14 +2425,23 @@ void CDeadHGrunt::KeyValue( KeyValueData *pkvd ) @@ -2425,14 +2425,23 @@ void CDeadHGrunt::KeyValue( KeyValueData *pkvd )
}
LINK_ENTITY_TO_CLASS( monster_hgrunt_dead, CDeadHGrunt )
LINK_ENTITY_TO_CLASS( monster_human_grunt_ally_dead, CDeadHGrunt )
//=========================================================
// ********** DeadHGrunt SPAWN **********
//=========================================================
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" );
SET_MODEL( ENT( pev ), "models/hgrunt.mdl" );
}
pev->effects = 0;
pev->yaw_speed = 8;

28
dlls/scientist.cpp

@ -119,6 +119,7 @@ private: @@ -119,6 +119,7 @@ private:
};
LINK_ENTITY_TO_CLASS( monster_scientist, CScientist )
LINK_ENTITY_TO_CLASS( monster_cleansuit_scientist, CScientist )
TYPEDESCRIPTION CScientist::m_SaveData[] =
{
@ -639,7 +640,11 @@ void CScientist::Spawn( void ) @@ -639,7 +640,11 @@ void CScientist::Spawn( void )
{
Precache();
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 );
pev->solid = SOLID_SLIDEBOX;
@ -676,7 +681,11 @@ void CScientist::Spawn( void ) @@ -676,7 +681,11 @@ void CScientist::Spawn( void )
//=========================================================
void CScientist::Precache( void )
{
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_pain2.wav" );
PRECACHE_SOUND( "scientist/sci_pain3.wav" );
@ -1053,6 +1062,9 @@ MONSTERSTATE CScientist::GetIdealState( void ) @@ -1053,6 +1062,9 @@ MONSTERSTATE CScientist::GetIdealState( 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 ) ) )
return FALSE;
@ -1120,15 +1132,31 @@ void CDeadScientist::KeyValue( KeyValueData *pkvd ) @@ -1120,15 +1132,31 @@ void CDeadScientist::KeyValue( KeyValueData *pkvd )
else
CBaseMonster::KeyValue( pkvd );
}
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 **********
//
void CDeadScientist::Spawn()
{
if( FClassnameIs( pev, "monster_cleansuit_scientist_dead" ) )
{
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->sequence = 0;

72
dlls/zombie.cpp

@ -324,3 +324,75 @@ int CZombie::IgnoreConditions( void ) @@ -324,3 +324,75 @@ int CZombie::IgnoreConditions( void )
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