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.

116 lines
2.6 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //=============================================================================//
  8. #ifndef NPC_HGRUNT_H
  9. #define NPC_HGRUNT_H
  10. #include "ai_squad.h"
  11. #include "hl1_ai_basenpc.h"
  12. class CNPC_HGrunt : public CHL1BaseNPC
  13. {
  14. DECLARE_CLASS( CNPC_HGrunt, CHL1BaseNPC );
  15. public:
  16. void Precache( void );
  17. void Spawn( void );
  18. void JustSpoke( void );
  19. void SpeakSentence( void );
  20. void PrescheduleThink ( void );
  21. bool FOkToSpeak( void );
  22. Class_T Classify ( void );
  23. int RangeAttack1Conditions ( float flDot, float flDist );
  24. int MeleeAttack1Conditions ( float flDot, float flDist );
  25. int RangeAttack2Conditions ( float flDot, float flDist );
  26. Activity NPC_TranslateActivity( Activity eNewActivity );
  27. void ClearAttackConditions( void );
  28. int IRelationPriority( CBaseEntity *pTarget );
  29. int GetGrenadeConditions ( float flDot, float flDist );
  30. bool FCanCheckAttacks( void );
  31. int GetSoundInterests ( void );
  32. void TraceAttack( const CTakeDamageInfo &info, const Vector &vecDir, trace_t *ptr, CDmgAccumulator *pAccumulator );
  33. int OnTakeDamage_Alive( const CTakeDamageInfo &inputInfo );
  34. float MaxYawSpeed( void );
  35. void IdleSound( void );
  36. void CheckAmmo ( void );
  37. CBaseEntity *Kick( void );
  38. Vector Weapon_ShootPosition( void );
  39. void HandleAnimEvent( animevent_t *pEvent );
  40. void Shoot ( void );
  41. void Shotgun( void );
  42. void StartTask ( const Task_t *pTask );
  43. void RunTask ( const Task_t *pTask );
  44. int SelectSchedule( void );
  45. int TranslateSchedule( int scheduleType );
  46. void PainSound( const CTakeDamageInfo &info );
  47. void DeathSound( const CTakeDamageInfo &info );
  48. void SetAim( const Vector &aimDir );
  49. bool HandleInteraction(int interactionType, void *data, CBaseCombatCharacter* sourceEnt);
  50. void StartNPC ( void );
  51. int SquadRecruit( int searchRadius, int maxMembers );
  52. void Event_Killed( const CTakeDamageInfo &info );
  53. static const char *pGruntSentences[];
  54. bool m_bInBarnacleMouth;
  55. public:
  56. DECLARE_DATADESC();
  57. DEFINE_CUSTOM_AI;
  58. private:
  59. // checking the feasibility of a grenade toss is kind of costly, so we do it every couple of seconds,
  60. // not every server frame.
  61. float m_flNextGrenadeCheck;
  62. float m_flNextPainTime;
  63. float m_flLastEnemySightTime;
  64. float m_flTalkWaitTime;
  65. Vector m_vecTossVelocity;
  66. int m_iLastGrenadeCondition;
  67. bool m_fStanding;
  68. bool m_fFirstEncounter;// only put on the handsign show in the squad's first encounter.
  69. int m_iClipSize;
  70. int m_voicePitch;
  71. int m_iSentence;
  72. float m_flCheckAttackTime;
  73. int m_iAmmoType;
  74. int m_iWeapons;
  75. };
  76. #endif