summaryrefslogtreecommitdiff
path: root/game/server/tf/bot_npc/bot_npc_decoy.h
blob: 6c6227f5d84ff925737f08e579f04e59a577b542 (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
//========= Copyright Valve Corporation, All rights reserved. ============//
// bot_npc_decoy.h
// A NextBot non-player decoy that imitates a real player
// Michael Booth, January 2011

#ifndef BOT_NPC_DECOY_H
#define BOT_NPC_DECOY_H

#include "NextBot.h"
#include "NextBotBehavior.h"
#include "NextBotGroundLocomotion.h"
#include "Path/NextBotPathFollow.h"
#include "bot_npc.h"
#include "bot_npc_body.h"


class CTFPlayer;


//----------------------------------------------------------------------------
class CBotNPCDecoyLocomotion : public NextBotGroundLocomotion
{
public:
	DECLARE_CLASS( CBotNPCDecoyLocomotion, NextBotGroundLocomotion );

	CBotNPCDecoyLocomotion( INextBot *bot ) : NextBotGroundLocomotion( bot ) { }
	virtual ~CBotNPCDecoyLocomotion() { }

	virtual float GetRunSpeed( void ) const;			// get maximum running speed

	virtual float GetMaxAcceleration( void ) const;		// return maximum acceleration of locomotor
	virtual float GetMaxDeceleration( void ) const;		// return maximum deceleration of locomotor
};


//----------------------------------------------------------------------------
class CBotNPCDecoy : public NextBotCombatCharacter
{
public:
	DECLARE_CLASS( CBotNPCDecoy, NextBotCombatCharacter );

	CBotNPCDecoy();
	virtual ~CBotNPCDecoy();

	virtual void Precache();
	virtual void Spawn( void );

	// INextBot
	DECLARE_INTENTION_INTERFACE( CBotNPCDecoy );
	virtual CBotNPCDecoyLocomotion *GetLocomotionInterface( void ) const	{ return m_locomotor; }
	virtual CBotNPCBody *GetBodyInterface( void ) const						{ return m_body; }

	virtual Vector EyePosition( void );

	virtual unsigned int PhysicsSolidMaskForEntity( void ) const;
	virtual bool	ShouldCollide( int collisionGroup, int contentsMask ) const;

	Activity GetRunActivity( void ) const;

private:
	CBotNPCDecoyLocomotion *m_locomotor;
	CBotNPCBody *m_body;

	Vector m_eyeOffset;
	Activity m_runActivity;
};


inline Activity CBotNPCDecoy::GetRunActivity( void ) const
{
	return m_runActivity;
}


inline Vector CBotNPCDecoy::EyePosition( void )
{
	return GetAbsOrigin() + m_eyeOffset;
}

#endif // BOT_NPC_DECOY_H