aboutsummaryrefslogtreecommitdiff
path: root/mp/src/game/server/tempmonster.cpp
blob: 3100c55b9e50617caa1b3121372361473c407406 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
// $NoKeywords: $
//
//=============================================================================//
//=========================================================
// NPC template
//=========================================================
#include "cbase.h"

// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"

#if 0

//=========================================================
// NPC's Anim Events Go Here
//=========================================================

class CMyNPC : public CAI_BaseNPC
{
public:
	DECLARE_CLASS( CMyNPC, CAI_BaseNPC );

	void Spawn( void );
	void Precache( void );
	void MaxYawSpeed( void );
	int  Classify ( void );
	void HandleAnimEvent( animevent_t *pEvent );
};
LINK_ENTITY_TO_CLASS( my_NPC, CMyNPC );

//=========================================================
// Classify - indicates this NPC's place in the 
// relationship table.
//=========================================================
int	CMyNPC::Classify ( void )
{
	return	CLASS_MY_NPC;
}

//=========================================================
// SetYawSpeed - allows each sequence to have a different
// turn rate associated with it.
//=========================================================
float CMyNPC::MaxYawSpeed ( void )
{
	switch ( m_Activity )
	{
	case ACT_IDLE:
	default:
		return 90;
	}
}

//=========================================================
// HandleAnimEvent - catches the NPC-specific messages
// that occur when tagged animation frames are played.
//=========================================================
void CMyNPC::HandleAnimEvent( animevent_t *pEvent )
{
	switch( pEvent->event )
	{
	case 0:
	default:
		CAI_BaseNPC::HandleAnimEvent( pEvent );
		break;
	}
}

//=========================================================
// Spawn
//=========================================================
void CMyNPC::Spawn()
{
	Precache( );

	engine.SetModel(edict(), "models/mymodel.mdl");
	UTIL_SetSize( this, Vector( -12, -12, 0 ), Vector( 12, 12, 24 ) );

	SetSolid( SOLID_SLIDEBOX );
	SetMoveType( MOVETYPE_STEP );
	m_bloodColor		= BLOOD_COLOR_GREEN;
	m_iHealth			= 8;
	m_vecViewOffset		= Vector ( 0, 0, 0 );// position of the eyes relative to NPC's origin.
	m_flFieldOfView		= 0.5;// indicates the width of this NPC's forward view cone ( as a dotproduct result )
	m_NPCState		= NPCSTATE_NONE;

	NPCInit();
}

//=========================================================
// Precache - precaches all resources this NPC needs
//=========================================================
void CMyNPC::Precache()
{
	engine.PrecacheModel("models/mymodel.mdl");
}	

//=========================================================
// AI Schedules Specific to this NPC
//=========================================================
#endif