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.

62 lines
1.3 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef TESLA_H
  7. #define TESLA_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "baseentity.h"
  12. class CTesla : public CBaseEntity
  13. {
  14. public:
  15. DECLARE_CLASS( CTesla, CBaseEntity );
  16. DECLARE_DATADESC();
  17. DECLARE_SERVERCLASS();
  18. CTesla();
  19. virtual void Spawn();
  20. virtual void Activate();
  21. virtual void Precache();
  22. void InputTurnOn( inputdata_t &inputdata );
  23. void InputTurnOff( inputdata_t &inputdata );
  24. void InputDoSpark( inputdata_t &inputdata );
  25. void DoSpark();
  26. void ShootArcThink();
  27. void SetupForNextArc();
  28. CBaseEntity* GetSourceEntity();
  29. public:
  30. // Tesla parameters.
  31. string_t m_SourceEntityName; // Which entity the arcs come from.
  32. CNetworkVar( string_t, m_SoundName ); // What sound to play when arcing.
  33. color32 m_Color;
  34. int m_NumBeams[2]; // Number of beams per spark.
  35. float m_flRadius; // Radius it looks for surfaces to arc to.
  36. float m_flThickness[2]; // Beam thickness.
  37. float m_flTimeVisible[2]; // How long each beam stays around (min/max).
  38. float m_flArcInterval[2]; // Time between args (min/max).
  39. bool m_bOn;
  40. CNetworkVar( string_t, m_iszSpriteName );
  41. };
  42. #endif // TESLA_H