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.

86 lines
2.3 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //=============================================================================//
  8. #include "cbase.h"
  9. #include "ai_default.h"
  10. #include "ai_task.h"
  11. #include "ai_schedule.h"
  12. #include "ai_node.h"
  13. #include "ai_hull.h"
  14. #include "ai_hint.h"
  15. #include "ai_memory.h"
  16. #include "ai_route.h"
  17. #include "ai_motor.h"
  18. #include "soundent.h"
  19. #include "game.h"
  20. #include "npcevent.h"
  21. #include "entitylist.h"
  22. #include "activitylist.h"
  23. #include "animation.h"
  24. #include "basecombatweapon.h"
  25. #include "IEffects.h"
  26. #include "vstdlib/random.h"
  27. #include "engine/IEngineSound.h"
  28. #include "ammodef.h"
  29. #include "hl1_ai_basenpc.h"
  30. class CNPC_Bloater : public CHL1BaseNPC
  31. {
  32. DECLARE_CLASS( CNPC_Bloater, CHL1BaseNPC );
  33. public:
  34. void Spawn( void );
  35. void Precache( void );
  36. /*void SetYawSpeed( void );
  37. int Classify ( void );
  38. void HandleAnimEvent( MonsterEvent_t *pEvent );
  39. void PainSound( const CTakeDamageInfo &info );
  40. void AlertSound( void );
  41. void IdleSound( void );
  42. void AttackSnd( void );
  43. // No range attacks
  44. BOOL CheckRangeAttack1 ( float flDot, float flDist ) { return FALSE; }
  45. BOOL CheckRangeAttack2 ( float flDot, float flDist ) { return FALSE; }
  46. int TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType );*/
  47. };
  48. LINK_ENTITY_TO_CLASS( monster_bloater, CNPC_Bloater );
  49. //=========================================================
  50. // Spawn
  51. //=========================================================
  52. void CNPC_Bloater::Spawn()
  53. {
  54. Precache( );
  55. SetModel( "models/floater.mdl");
  56. // UTIL_SetSize( this, VEC_HUMAN_HULL_MIN, VEC_HUMAN_HULL_MAX );
  57. SetSolid( SOLID_BBOX );
  58. AddSolidFlags( FSOLID_NOT_STANDABLE );
  59. SetMoveType( MOVETYPE_FLY );
  60. m_spawnflags |= FL_FLY;
  61. m_bloodColor = BLOOD_COLOR_GREEN;
  62. m_iHealth = 40;
  63. // pev->view_ofs = VEC_VIEW;// position of the eyes relative to monster's origin.
  64. m_flFieldOfView = 0.5;// indicates the width of this monster's forward view cone ( as a dotproduct result )
  65. m_NPCState = NPC_STATE_NONE;
  66. SetRenderColor( 255, 255, 255, 255 );
  67. NPCInit();
  68. }
  69. //=========================================================
  70. // Precache - precaches all resources this monster needs
  71. //=========================================================
  72. void CNPC_Bloater::Precache()
  73. {
  74. PrecacheModel("models/floater.mdl");
  75. }