summaryrefslogtreecommitdiff
path: root/game/server/tf/player_vs_environment/tf_tank_boss_body.cpp
blob: d3dd638b2d8cb56b04710353aaf443bb0c8a58d7 (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
//========= Copyright Valve Corporation, All rights reserved. ============//
#include "cbase.h"

#include "NextBot.h"
#include "tf_tank_boss.h"
#include "tf_tank_boss_body.h"


//-------------------------------------------------------------------------------------------
CTFTankBossBody::CTFTankBossBody( INextBot *bot ) : IBody( bot )
{
}


//-------------------------------------------------------------------------------------------
bool CTFTankBossBody::StartSequence( const char *name )
{
	CTFTankBoss *me = (CTFTankBoss *)GetBot()->GetEntity();

	int animSequence = me->LookupSequence( name );

	if ( animSequence )
	{
		me->SetSequence( animSequence );
		me->SetPlaybackRate( 1.0f );
		me->SetCycle( 0 );
		me->ResetSequenceInfo();

		return true;
	}

	return false;
}

void CTFTankBossBody::SetSkin( int nSkin )
{
	CTFTankBoss *me = (CTFTankBoss *)GetBot()->GetEntity();
	me->m_nSkin = nSkin;
}


//-------------------------------------------------------------------------------------------
void CTFTankBossBody::Update( void )
{
	CTFTankBoss *me = (CTFTankBoss *)GetBot()->GetEntity();

	// move the animation ahead in time	
	me->StudioFrameAdvance();
	me->DispatchAnimEvents( me );
}


//---------------------------------------------------------------------------------------------
// return the bot's collision mask (hack until we get a general hull trace abstraction here or in the locomotion interface)
unsigned int CTFTankBossBody::GetSolidMask( void ) const
{
	return CONTENTS_SOLID;
}