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.

138 lines
3.2 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //=============================================================================//
  8. #ifndef NPC_SCIENTIST_H
  9. #define NPC_SCIENTIST_H
  10. #include "hl1_npc_talker.h"
  11. //=========================================================
  12. //=========================================================
  13. class CNPC_Scientist : public CHL1NPCTalker
  14. {
  15. DECLARE_CLASS( CNPC_Scientist, CHL1NPCTalker );
  16. public:
  17. // DECLARE_SERVERCLASS();
  18. DECLARE_DATADESC();
  19. void Precache( void );
  20. void Spawn( void );
  21. void Activate();
  22. Class_T Classify( void );
  23. int GetSoundInterests ( void );
  24. virtual void ModifyOrAppendCriteria( AI_CriteriaSet& set );
  25. virtual int ObjectCaps( void ) { return UsableNPCObjectCaps(BaseClass::ObjectCaps()); }
  26. float MaxYawSpeed( void );
  27. float TargetDistance( void );
  28. bool IsValidEnemy( CBaseEntity *pEnemy );
  29. int OnTakeDamage_Alive( const CTakeDamageInfo &inputInfo );
  30. void Event_Killed( const CTakeDamageInfo &info );
  31. void Heal( void );
  32. bool CanHeal( void );
  33. int TranslateSchedule( int scheduleType );
  34. void HandleAnimEvent( animevent_t *pEvent );
  35. int SelectSchedule( void );
  36. void StartTask( const Task_t *pTask );
  37. void RunTask( const Task_t *pTask );
  38. NPC_STATE SelectIdealState ( void );
  39. int FriendNumber( int arrayNumber );
  40. bool DisregardEnemy( CBaseEntity *pEnemy ) { return !pEnemy->IsAlive() || (gpGlobals->curtime - m_flFearTime) > 15; }
  41. void TalkInit( void );
  42. void DeclineFollowing( void );
  43. bool CanBecomeRagdoll( void );
  44. bool ShouldGib( const CTakeDamageInfo &info );
  45. void SUB_StartLVFadeOut( float delay = 10.0f, bool bNotSolid = true );
  46. void SUB_LVFadeOut( void );
  47. void Scream( void );
  48. Activity GetStoppedActivity( void );
  49. Activity NPC_TranslateActivity( Activity newActivity );
  50. void PainSound( const CTakeDamageInfo &info );
  51. void DeathSound( const CTakeDamageInfo &info );
  52. enum
  53. {
  54. SCHED_SCI_HEAL = BaseClass::NEXT_SCHEDULE,
  55. SCHED_SCI_FOLLOWTARGET,
  56. SCHED_SCI_STOPFOLLOWING,
  57. SCHED_SCI_FACETARGET,
  58. SCHED_SCI_COVER,
  59. SCHED_SCI_HIDE,
  60. SCHED_SCI_IDLESTAND,
  61. SCHED_SCI_PANIC,
  62. SCHED_SCI_FOLLOWSCARED,
  63. SCHED_SCI_FACETARGETSCARED,
  64. SCHED_SCI_FEAR,
  65. SCHED_SCI_STARTLE,
  66. };
  67. enum
  68. {
  69. TASK_SAY_HEAL = BaseClass::NEXT_TASK,
  70. TASK_HEAL,
  71. TASK_SAY_FEAR,
  72. TASK_RUN_PATH_SCARED,
  73. TASK_SCREAM,
  74. TASK_RANDOM_SCREAM,
  75. TASK_MOVE_TO_TARGET_RANGE_SCARED,
  76. };
  77. DEFINE_CUSTOM_AI;
  78. private:
  79. float m_flFearTime;
  80. float m_flHealTime;
  81. float m_flPainTime;
  82. //float m_flResponseDelay;
  83. };
  84. //=========================================================
  85. // Sitting Scientist PROP
  86. //=========================================================
  87. class CNPC_SittingScientist : public CNPC_Scientist // kdb: changed from public CBaseMonster so he can speak
  88. {
  89. DECLARE_CLASS( CNPC_SittingScientist, CNPC_Scientist );
  90. public:
  91. // DECLARE_SERVERCLASS();
  92. DECLARE_DATADESC();
  93. void Spawn( void );
  94. void Precache( void );
  95. int FriendNumber( int arrayNumber );
  96. void SittingThink( void );
  97. virtual void SetAnswerQuestion( CNPCSimpleTalker *pSpeaker );
  98. int m_baseSequence;
  99. int m_iHeadTurn;
  100. float m_flResponseDelay;
  101. //DEFINE_CUSTOM_AI;
  102. };
  103. #endif // NPC_SCIENTIST_H