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.

71 lines
2.0 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef MONSTERMAKER_H
  7. #define MONSTERMAKER_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "cbase.h"
  12. //-----------------------------------------------------------------------------
  13. // Spawnflags
  14. //-----------------------------------------------------------------------------
  15. #define SF_NPCMAKER_START_ON 1 // start active ( if has targetname )
  16. #define SF_NPCMAKER_NPCCLIP 8 // Children are blocked by NPCclip
  17. #define SF_NPCMAKER_FADE 16 // Children's corpses fade
  18. #define SF_NPCMAKER_INF_CHILD 32 // Infinite number of children
  19. #define SF_NPCMAKER_NO_DROP 64 // Do not adjust for the ground's position when checking for spawn
  20. class CNPCMaker : public CBaseEntity
  21. {
  22. public:
  23. DECLARE_CLASS( CNPCMaker, CBaseEntity );
  24. CNPCMaker(void) {}
  25. void Spawn( void );
  26. void Precache( void );
  27. void MakerThink( void );
  28. bool CanMakeNPC( void );
  29. void DeathNotice( CBaseEntity *pChild );// NPC maker children use this to tell the NPC maker that they have died.
  30. void MakeNPC( void );
  31. // Input handlers
  32. void InputSpawnNPC( inputdata_t &inputdata );
  33. void InputEnable( inputdata_t &inputdata );
  34. void InputDisable( inputdata_t &inputdata );
  35. void InputToggle( inputdata_t &inputdata );
  36. // State changers
  37. void Toggle( void );
  38. void Enable( void );
  39. void Disable( void );
  40. bool IsDepleted();
  41. DECLARE_DATADESC();
  42. int m_iMaxNumNPCs; // max number of NPCs this ent can create
  43. float m_flSpawnFrequency; // delay (in secs) between spawns
  44. int m_iMaxLiveChildren; // max number of NPCs that this maker may have out at one time.
  45. string_t m_iszNPCClassname; // classname of the NPC(s) that will be created.
  46. COutputEvent m_OnSpawnNPC;
  47. int m_cLiveChildren;// how many NPCs made by this NPC maker that are currently alive
  48. float m_flGround; // z coord of the ground under me, used to make sure no NPCs are under the maker when it drops a new child
  49. bool m_bDisabled;
  50. };
  51. #endif // MONSTERMAKER_H