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.

74 lines
2.0 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef TF_TRIGGERS_H
  8. #define TF_TRIGGERS_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "triggers.h"
  13. //-----------------------------------------------------------------------------
  14. // Purpose: Puts anything that touches the trigger into loser state.
  15. //-----------------------------------------------------------------------------
  16. class CTriggerStun : public CBaseTrigger
  17. {
  18. public:
  19. CTriggerStun()
  20. {
  21. }
  22. DECLARE_CLASS( CTriggerStun, CBaseTrigger );
  23. void Spawn( void );
  24. void StunThink( void );
  25. void Touch( CBaseEntity *pOther );
  26. void EndTouch( CBaseEntity *pOther );
  27. bool StunEntity( CBaseEntity *pOther );
  28. int StunAllTouchers( float dt );
  29. DECLARE_DATADESC();
  30. float m_flTriggerDelay;
  31. float m_flStunDuration;
  32. float m_flMoveSpeedReduction;
  33. int m_iStunType;
  34. bool m_bStunEffects;
  35. // Outputs
  36. COutputEvent m_OnStunPlayer;
  37. float m_flLastStunTime;
  38. CUtlVector<EHANDLE> m_stunEntities;
  39. };
  40. //-----------------------------------------------------------------------------
  41. // Purpose: Trigger that allows the map-maker to force the spawn time of players that die inside
  42. //-----------------------------------------------------------------------------
  43. DECLARE_AUTO_LIST( ITriggerPlayerRespawnOverride );
  44. class CTriggerPlayerRespawnOverride : public CTriggerMultiple, public ITriggerPlayerRespawnOverride
  45. {
  46. public:
  47. DECLARE_DATADESC();
  48. DECLARE_CLASS( CTriggerPlayerRespawnOverride, CTriggerMultiple );
  49. DECLARE_AUTO_LIST( ITriggerPlayerRespawnOverride );
  50. void InputSetRespawnTime( inputdata_t &inputdata ) { m_flRespawnTime = inputdata.value.Float(); }
  51. void InputSetRespawnName( inputdata_t &inputdata ) { m_strRespawnEnt = inputdata.value.StringID(); }
  52. float GetRespawnTime( void ) { return m_flRespawnTime; }
  53. string_t GetRespawnName( void ) { return m_strRespawnEnt; }
  54. private:
  55. float m_flRespawnTime;
  56. string_t m_strRespawnEnt;
  57. };
  58. #endif // TF_TRIGGERS_H