Portable Half-Life SDK. GoldSource and Xash3D. Crossplatform.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

124 lines
3.3 KiB

9 years ago
//========= Copyright <EFBFBD> 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose: New version of the slider bar
//
// $NoKeywords: $
//=============================================================================
//=========================================================
// playermonster - for scripted sequence use.
//=========================================================
9 years ago
#include "extdll.h"
#include "util.h"
#include "cbase.h"
#include "monsters.h"
#include "schedule.h"
// For holograms, make them not solid so the player can walk through them
#define SF_MONSTERPLAYER_NOTSOLID 4
//=========================================================
// Monster's Anim Events Go Here
//=========================================================
class CPlayerMonster : public CBaseMonster
{
public:
void Spawn( void );
void Precache( void );
void SetYawSpeed( void );
8 years ago
int Classify( void );
9 years ago
void HandleAnimEvent( MonsterEvent_t *pEvent );
8 years ago
int ISoundMask( void );
9 years ago
};
LINK_ENTITY_TO_CLASS( monster_player, CPlayerMonster )
9 years ago
//=========================================================
// Classify - indicates this monster's place in the
// relationship table.
//=========================================================
8 years ago
int CPlayerMonster::Classify( void )
9 years ago
{
8 years ago
return CLASS_PLAYER_ALLY;
9 years ago
}
//=========================================================
// SetYawSpeed - allows each sequence to have a different
// turn rate associated with it.
//=========================================================
8 years ago
void CPlayerMonster::SetYawSpeed( void )
9 years ago
{
int ys;
8 years ago
switch( m_Activity )
9 years ago
{
case ACT_IDLE:
default:
ys = 90;
}
pev->yaw_speed = ys;
}
//=========================================================
// HandleAnimEvent - catches the monster-specific messages
// that occur when tagged animation frames are played.
//=========================================================
void CPlayerMonster :: HandleAnimEvent( MonsterEvent_t *pEvent )
{
switch( pEvent->event )
{
case 0:
default:
CBaseMonster::HandleAnimEvent( pEvent );
break;
}
}
//=========================================================
// ISoundMask - player monster can't hear.
//=========================================================
8 years ago
int CPlayerMonster::ISoundMask( void )
9 years ago
{
8 years ago
return NULL;
9 years ago
}
//=========================================================
// Spawn
//=========================================================
8 years ago
void CPlayerMonster::Spawn()
9 years ago
{
8 years ago
Precache();
9 years ago
8 years ago
SET_MODEL( ENT( pev ), "models/player.mdl" );
UTIL_SetSize( pev, VEC_HULL_MIN, VEC_HULL_MAX );
9 years ago
8 years ago
pev->solid = SOLID_SLIDEBOX;
pev->movetype = MOVETYPE_STEP;
m_bloodColor = BLOOD_COLOR_RED;
pev->health = 8;
m_flFieldOfView = 0.5;// indicates the width of this monster's forward view cone ( as a dotproduct result )
m_MonsterState = MONSTERSTATE_NONE;
9 years ago
MonsterInit();
8 years ago
if( pev->spawnflags & SF_MONSTERPLAYER_NOTSOLID )
9 years ago
{
pev->solid = SOLID_NOT;
pev->takedamage = DAMAGE_NO;
}
}
//=========================================================
// Precache - precaches all resources this monster needs
//=========================================================
8 years ago
void CPlayerMonster::Precache()
9 years ago
{
8 years ago
PRECACHE_MODEL( "models/player.mdl" );
}
9 years ago
//=========================================================
// AI Schedules Specific to this monster
//=========================================================