aboutsummaryrefslogtreecommitdiff
path: root/mp/src/game/server/hl2/npc_assassin.h
diff options
context:
space:
mode:
authorJoe Ludwig <[email protected]>2013-06-26 15:22:04 -0700
committerJoe Ludwig <[email protected]>2013-06-26 15:22:04 -0700
commit39ed87570bdb2f86969d4be821c94b722dc71179 (patch)
treeabc53757f75f40c80278e87650ea92808274aa59 /mp/src/game/server/hl2/npc_assassin.h
downloadsource-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.tar.xz
source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.zip
First version of the SOurce SDK 2013
Diffstat (limited to 'mp/src/game/server/hl2/npc_assassin.h')
-rw-r--r--mp/src/game/server/hl2/npc_assassin.h90
1 files changed, 90 insertions, 0 deletions
diff --git a/mp/src/game/server/hl2/npc_assassin.h b/mp/src/game/server/hl2/npc_assassin.h
new file mode 100644
index 00000000..17fb9e0f
--- /dev/null
+++ b/mp/src/game/server/hl2/npc_assassin.h
@@ -0,0 +1,90 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//=============================================================================//
+
+#ifndef NPC_ASSASSIN_H
+#define NPC_ASSASSIN_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+#include "ai_basenpc.h"
+#include "Sprite.h"
+#include "SpriteTrail.h"
+#include "soundent.h"
+
+//Eye states
+enum eyeState_t
+{
+ ASSASSIN_EYE_SEE_TARGET = 0, //Sees the target, bright and big
+ ASSASSIN_EYE_SEEKING_TARGET, //Looking for a target, blinking (bright)
+ ASSASSIN_EYE_ACTIVE, //Actively looking
+ ASSASSIN_EYE_DORMANT, //Not active
+ ASSASSIN_EYE_DEAD, //Completely invisible
+};
+
+//=========================================================
+//=========================================================
+class CNPC_Assassin : public CAI_BaseNPC
+{
+public:
+ DECLARE_CLASS( CNPC_Assassin, CAI_BaseNPC );
+ // DECLARE_SERVERCLASS();
+ DECLARE_DATADESC();
+
+ CNPC_Assassin( void );
+
+ Class_T Classify( void ) { return CLASS_COMBINE; }
+ int GetSoundInterests ( void ) { return (SOUND_WORLD|SOUND_COMBAT|SOUND_PLAYER); }
+
+ int SelectSchedule ( void );
+ int MeleeAttack1Conditions ( float flDot, float flDist );
+ int RangeAttack1Conditions ( float flDot, float flDist );
+ int RangeAttack2Conditions ( float flDot, float flDist );
+
+ void Precache( void );
+ void Spawn( void );
+ void PrescheduleThink( void );
+ void HandleAnimEvent( animevent_t *pEvent );
+ void StartTask( const Task_t *pTask );
+ void RunTask( const Task_t *pTask );
+ void OnScheduleChange( void );
+ void GatherEnemyConditions( CBaseEntity *pEnemy );
+ void BuildScheduleTestBits( void );
+ void Event_Killed( const CTakeDamageInfo &info );
+
+ bool FValidateHintType ( CAI_Hint *pHint );
+ bool IsJumpLegal(const Vector &startPos, const Vector &apex, const Vector &endPos) const;
+ bool MovementCost( int moveType, const Vector &vecStart, const Vector &vecEnd, float *pCost );
+
+ float MaxYawSpeed( void );
+
+ const Vector &GetViewOffset( void );
+
+private:
+
+ void SetEyeState( eyeState_t state );
+ void FirePistol( int hand );
+ bool CanFlip( int flipType, Activity &activity, const Vector *avoidPosition );
+
+ int m_nNumFlips;
+ int m_nLastFlipType;
+ float m_flNextFlipTime; //Next earliest time the assassin can flip again
+ float m_flNextLungeTime;
+ float m_flNextShotTime;
+
+ bool m_bEvade;
+ bool m_bAggressive; // Sets certain state, including whether or not her eye is visible
+ bool m_bBlinkState;
+
+ CSprite *m_pEyeSprite;
+ CSpriteTrail *m_pEyeTrail;
+
+ DEFINE_CUSTOM_AI;
+};
+
+
+#endif // NPC_ASSASSIN_H