summaryrefslogtreecommitdiff
path: root/game/server/tf2/npc_bug_hole.h
blob: 10dbeec6e85c899eb2612f2f8a3761f577d8c9b8 (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
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
// $NoKeywords: $
//=============================================================================//

#ifndef NPC_BUG_HOLE_H
#define NPC_BUG_HOLE_H
#ifdef _WIN32
#pragma once
#endif

class CNPC_Bug_Warrior;
class CNPC_Bug_Builder;

//-----------------------------------------------------------------------------
// Purpose: BUG HOLE
//-----------------------------------------------------------------------------
class CMaker_BugHole : public CNPCMaker
{
	DECLARE_CLASS( CMaker_BugHole, CNPCMaker );
public:
	CMaker_BugHole( void );

	DECLARE_DATADESC();
	DECLARE_SERVERCLASS();

	virtual void	Spawn( void );
	virtual void	Precache( void );
	virtual void	MakeNPC( void );
	virtual	void	ChildPreSpawn( CAI_BaseNPC *pChild );
	virtual	void	ChildPostSpawn( CAI_BaseNPC *pChild );
	virtual void	DeathNotice( CBaseEntity *pVictim );
	virtual void	Event_Killed( const CTakeDamageInfo &info );

	// Bug interactions
	void	BugHoleThink( void );
	void	SpawnBug( float flTime );
	void	SpawnWarrior( float flTime );
	void	SpawnBuilder( float flTime );
	void	BugHoleUnderAttack( void );
	void	StartPatrol( void );
	void	CheckBuilder( void );
	void	IncomingFleeingBug( CAI_BaseNPC *pBug );
	void	BugReturned( void );

private:
	string_t	m_iszNPCClassname_Warrior;
	string_t	m_iszNPCClassname_Builder;

	// Bug pool
	int			m_iPool;
	int			m_iMaxPool;
	float		m_flPoolRegenTime;

	float		m_flNextSpawnTime;
	float		m_flNextRegenTime;

	// Patrols
	int			m_iMaxNumberOfPatrollers;
	float		m_flPatrolTime;
	float		m_flNextPatrolTime;
	string_t	m_iszPatrolPathName;

	// Builders
	int			m_iMaxNumberOfBuilders;

	// List of bugs I have out there
	typedef	CHandle<CNPC_Bug_Warrior> WarriorHandle_t;
	CUtlVector<WarriorHandle_t>	m_aWarriorBugs;
	typedef	CHandle<CNPC_Bug_Builder> BuilderHandle_t;
	CUtlVector<BuilderHandle_t>	m_aBuilderBugs;
};

#endif // NPC_BUG_HOLE_H