mirror of
https://github.com/YGGverse/hlsdk-portable.git
synced 2025-03-13 05:51:19 +00:00
Add monster_roy_dead implementation.
This commit is contained in:
parent
c5aa59bd32
commit
e44490dd26
@ -389,3 +389,64 @@ void CRoy::DeclineFollowing( void )
|
||||
{
|
||||
PlaySentence( "RO_POK", 2, VOL_NORM, ATTN_NORM );
|
||||
}
|
||||
|
||||
//=========================================================
|
||||
// DEAD ROY PROP
|
||||
//
|
||||
// Designer selects a pose in worldcraft, 0 through num_poses-1
|
||||
// this value is added to what is selected as the 'first dead pose'
|
||||
// among the monster's normal animations. All dead poses must
|
||||
// appear sequentially in the model file. Be sure and set
|
||||
// the m_iFirstPose properly!
|
||||
//
|
||||
//=========================================================
|
||||
class CDeadRoy : public CBaseMonster
|
||||
{
|
||||
public:
|
||||
void Spawn( void );
|
||||
int Classify( void ) { return CLASS_PLAYER_ALLY; }
|
||||
|
||||
void KeyValue( KeyValueData *pkvd );
|
||||
|
||||
int m_iPose;// which sequence to display -- temporary, don't need to save
|
||||
static const char *m_szPoses[3];
|
||||
};
|
||||
|
||||
const char *CDeadRoy::m_szPoses[] = { "lying_on_back", "lying_on_side", "lying_on_stomach" };
|
||||
|
||||
void CDeadRoy::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_roy_dead, CDeadRoy )
|
||||
|
||||
//=========================================================
|
||||
// ********** DeadRoy SPAWN **********
|
||||
//=========================================================
|
||||
void CDeadRoy::Spawn()
|
||||
{
|
||||
PRECACHE_MODEL( "models/roy.mdl" );
|
||||
SET_MODEL( ENT( pev ), "models/roy.mdl" );
|
||||
|
||||
pev->effects = 0;
|
||||
pev->yaw_speed = 8;
|
||||
pev->sequence = 0;
|
||||
m_bloodColor = BLOOD_COLOR_RED;
|
||||
|
||||
pev->sequence = LookupSequence( m_szPoses[m_iPose] );
|
||||
if( pev->sequence == -1 )
|
||||
{
|
||||
ALERT( at_console, "Dead roy with bad pose\n" );
|
||||
}
|
||||
// Corpses have less health
|
||||
pev->health = 8;//gSkillData.royHealth;
|
||||
|
||||
MonsterInitDead();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user