Team Fortress 2 Source Code as on 22/4/2020
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.

115 lines
2.9 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef NPC_STALKER_H
  8. #define NPC_STALKER_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "ai_basenpc.h"
  13. #include "entityoutput.h"
  14. #include "ai_behavior.h"
  15. #include "ai_behavior_actbusy.h"
  16. class CBeam;
  17. class CSprite;
  18. class CScriptedTarget;
  19. typedef CAI_BehaviorHost<CAI_BaseNPC> CAI_BaseStalker;
  20. class CNPC_Stalker : public CAI_BaseStalker
  21. {
  22. DECLARE_CLASS( CNPC_Stalker, CAI_BaseStalker );
  23. public:
  24. float m_flNextAttackSoundTime;
  25. float m_flNextBreatheSoundTime;
  26. float m_flNextScrambleSoundTime;
  27. float m_flNextNPCThink;
  28. // ------------------------------
  29. // Laser Beam
  30. // ------------------------------
  31. int m_eBeamPower;
  32. Vector m_vLaserDir;
  33. Vector m_vLaserTargetPos;
  34. float m_fBeamEndTime;
  35. float m_fBeamRechargeTime;
  36. float m_fNextDamageTime;
  37. float m_nextSmokeTime;
  38. float m_bPlayingHitWall;
  39. float m_bPlayingHitFlesh;
  40. CBeam* m_pBeam;
  41. CSprite* m_pLightGlow;
  42. int m_iPlayerAggression;
  43. float m_flNextScreamTime;
  44. void KillAttackBeam(void);
  45. void DrawAttackBeam(void);
  46. void CalcBeamPosition(void);
  47. Vector LaserStartPosition(Vector vStalkerPos);
  48. Vector m_vLaserCurPos; // Last position successfully burned
  49. bool InnateWeaponLOSCondition( const Vector &ownerPos, const Vector &targetPos, bool bSetConditions );
  50. // ------------------------------
  51. // Dormancy
  52. // ------------------------------
  53. CAI_Schedule* WakeUp(void);
  54. void GoDormant(void);
  55. public:
  56. void Spawn( void );
  57. void Precache( void );
  58. bool CreateBehaviors();
  59. float MaxYawSpeed( void );
  60. Class_T Classify ( void );
  61. void PrescheduleThink();
  62. bool IsValidEnemy( CBaseEntity *pEnemy );
  63. void StartTask( const Task_t *pTask );
  64. void RunTask( const Task_t *pTask );
  65. virtual int SelectSchedule ( void );
  66. virtual int TranslateSchedule( int scheduleType );
  67. int OnTakeDamage_Alive( const CTakeDamageInfo &info );
  68. void OnScheduleChange();
  69. void StalkerThink(void);
  70. void NotifyDeadFriend( CBaseEntity *pFriend );
  71. int MeleeAttack1Conditions ( float flDot, float flDist );
  72. int RangeAttack1Conditions ( float flDot, float flDist );
  73. void HandleAnimEvent( animevent_t *pEvent );
  74. bool FValidateHintType(CAI_Hint *pHint);
  75. Activity GetHintActivity( short sHintType, Activity HintsActivity );
  76. float GetHintDelay( short sHintType );
  77. void IdleSound( void );
  78. void DeathSound( const CTakeDamageInfo &info );
  79. void PainSound( const CTakeDamageInfo &info );
  80. void Event_Killed( const CTakeDamageInfo &info );
  81. void DoSmokeEffect( const Vector &position );
  82. void AddZigZagToPath(void);
  83. void StartAttackBeam();
  84. void UpdateAttackBeam();
  85. CNPC_Stalker(void);
  86. DECLARE_DATADESC();
  87. DEFINE_CUSTOM_AI;
  88. private:
  89. CAI_ActBusyBehavior m_ActBusyBehavior;
  90. };
  91. #endif // NPC_STALKER_H