summaryrefslogtreecommitdiff
path: root/game/client/tf/bot_npc/c_bot_npc_minion.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'game/client/tf/bot_npc/c_bot_npc_minion.cpp')
-rw-r--r--game/client/tf/bot_npc/c_bot_npc_minion.cpp115
1 files changed, 115 insertions, 0 deletions
diff --git a/game/client/tf/bot_npc/c_bot_npc_minion.cpp b/game/client/tf/bot_npc/c_bot_npc_minion.cpp
new file mode 100644
index 0000000..4302b7a
--- /dev/null
+++ b/game/client/tf/bot_npc/c_bot_npc_minion.cpp
@@ -0,0 +1,115 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+// c_bot_npc_minion.cpp
+
+#include "cbase.h"
+#include "NextBot/C_NextBot.h"
+#include "c_bot_npc_minion.h"
+
+// memdbgon must be the last include file in a .cpp file!!!
+#include "tier0/memdbgon.h"
+
+#undef NextBot
+
+//-----------------------------------------------------------------------------
+IMPLEMENT_CLIENTCLASS_DT( C_BotNPCMinion, DT_BotNPCMinion, CBotNPCMinion )
+
+ RecvPropEHandle( RECVINFO( m_stunTarget ) ),
+
+END_RECV_TABLE()
+
+
+//-----------------------------------------------------------------------------
+C_BotNPCMinion::C_BotNPCMinion()
+{
+ m_stunEffect = NULL;
+ m_stunBeamEffect = NULL;
+ m_scanEffect = NULL;
+}
+
+
+//-----------------------------------------------------------------------------
+C_BotNPCMinion::~C_BotNPCMinion()
+{
+ if ( m_stunEffect )
+ {
+ ParticleProp()->StopEmissionAndDestroyImmediately( m_stunEffect );
+ m_stunEffect = NULL;
+ }
+
+ if ( m_stunBeamEffect )
+ {
+ ParticleProp()->StopEmissionAndDestroyImmediately( m_stunBeamEffect );
+ m_stunBeamEffect = NULL;
+ }
+
+ if ( m_scanEffect )
+ {
+ ParticleProp()->StopEmissionAndDestroyImmediately( m_scanEffect );
+ m_scanEffect = NULL;
+ }
+}
+
+
+//-----------------------------------------------------------------------------
+void C_BotNPCMinion::Spawn( void )
+{
+ BaseClass::Spawn();
+
+ SetNextClientThink( CLIENT_THINK_ALWAYS );
+
+ //m_scanEffect = ParticleProp()->Create( "minion_scan", PATTACH_ABSORIGIN_FOLLOW );
+}
+
+
+//-----------------------------------------------------------------------------
+void C_BotNPCMinion::ClientThink( void )
+{
+ if ( m_stunTarget )
+ {
+ if ( !m_stunEffect )
+ {
+ m_stunEffect = ParticleProp()->Create( "cart_flashinglight", PATTACH_ABSORIGIN_FOLLOW );
+ }
+
+ if ( !m_stunBeamEffect )
+ {
+ m_stunBeamEffect = ParticleProp()->Create( "laser_sight_beam", PATTACH_ABSORIGIN_FOLLOW );
+ }
+
+ if ( m_stunBeamEffect )
+ {
+ m_stunBeamEffect->SetSortOrigin( m_stunBeamEffect->GetRenderOrigin() );
+ m_stunBeamEffect->SetControlPoint( 2, Vector( 255, 0, 255 ) );
+ m_stunBeamEffect->SetControlPoint( 1, m_stunTarget->WorldSpaceCenter() );
+ }
+ }
+ else
+ {
+ // shut off the effect
+ if ( m_stunEffect )
+ {
+ ParticleProp()->StopEmissionAndDestroyImmediately( m_stunEffect );
+ m_stunEffect = NULL;
+ }
+
+ if ( m_stunBeamEffect )
+ {
+ ParticleProp()->StopEmissionAndDestroyImmediately( m_stunBeamEffect );
+ m_stunBeamEffect = NULL;
+ }
+ }
+}
+
+
+//-----------------------------------------------------------------------------
+// Return the origin for player observers tracking this target
+Vector C_BotNPCMinion::GetObserverCamOrigin( void )
+{
+ return GetAbsOrigin();
+}
+
+
+//-----------------------------------------------------------------------------
+void C_BotNPCMinion::FireEvent( const Vector& origin, const QAngle& angles, int event, const char *options )
+{
+}