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.
44 lines
1.0 KiB
44 lines
1.0 KiB
4 years ago
|
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||
|
// eyeball_boss_notice.cpp
|
||
|
// The 2011 Halloween Boss
|
||
|
// Michael Booth, October 2011
|
||
|
|
||
|
#include "cbase.h"
|
||
|
|
||
|
#include "../eyeball_boss.h"
|
||
|
#include "eyeball_boss_notice.h"
|
||
|
#include "eyeball_boss_approach_target.h"
|
||
|
|
||
|
|
||
|
//---------------------------------------------------------------------------------------------
|
||
|
ActionResult< CEyeballBoss > CEyeballBossNotice::OnStart( CEyeballBoss *me, Action< CEyeballBoss > *priorAction )
|
||
|
{
|
||
|
m_timer.Start( 0.25f );
|
||
|
|
||
|
me->EmitSound( "Halloween.EyeballBossBecomeAlert" );
|
||
|
|
||
|
return Continue();
|
||
|
}
|
||
|
|
||
|
|
||
|
//---------------------------------------------------------------------------------------------
|
||
|
ActionResult< CEyeballBoss > CEyeballBossNotice::Update( CEyeballBoss *me, float interval )
|
||
|
{
|
||
|
CBaseEntity *victim = me->GetVictim();
|
||
|
|
||
|
if ( !victim )
|
||
|
{
|
||
|
return Done( "Victim gone" );
|
||
|
}
|
||
|
|
||
|
me->GetBodyInterface()->AimHeadTowards( victim );
|
||
|
|
||
|
if ( m_timer.IsElapsed() )
|
||
|
{
|
||
|
return ChangeTo( new CEyeballBossApproachTarget, "Chasing victim" );
|
||
|
}
|
||
|
|
||
|
return Continue();
|
||
|
}
|
||
|
|