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.

93 lines
2.6 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //=============================================================================//
  8. #include "cbase.h"
  9. #include "plasma.h"
  10. // memdbgon must be the last include file in a .cpp file!!!
  11. #include "tier0/memdbgon.h"
  12. //==================================================
  13. // CPlasma
  14. //==================================================
  15. //Link the entity
  16. LINK_ENTITY_TO_CLASS( _plasma, CPlasma );
  17. //Send datatable
  18. IMPLEMENT_SERVERCLASS_ST( CPlasma, DT_Plasma )
  19. SendPropFloat( SENDINFO( m_flScale ), 0, SPROP_NOSCALE),
  20. SendPropFloat( SENDINFO( m_flScaleTime ), 0, SPROP_NOSCALE),
  21. SendPropInt( SENDINFO( m_nFlags ), 8, SPROP_UNSIGNED ),
  22. SendPropModelIndex( SENDINFO( m_nPlasmaModelIndex )),
  23. SendPropModelIndex( SENDINFO( m_nPlasmaModelIndex2 )),
  24. SendPropModelIndex( SENDINFO( m_nGlowModelIndex )),
  25. END_SEND_TABLE()
  26. //Data description
  27. BEGIN_DATADESC( CPlasma )
  28. //Client-side
  29. DEFINE_FIELD( m_flScale, FIELD_FLOAT ),
  30. DEFINE_FIELD( m_flScaleTime, FIELD_FLOAT ),
  31. DEFINE_FIELD( m_nFlags, FIELD_INTEGER ),
  32. // DEFINE_FIELD( m_nPlasmaModelIndex, FIELD_INTEGER ),
  33. // DEFINE_FIELD( m_nPlasmaModelIndex2, FIELD_INTEGER ),
  34. // DEFINE_FIELD( m_nGlowModelIndex, FIELD_INTEGER ),
  35. //Server-side
  36. END_DATADESC()
  37. //-----------------------------------------------------------------------------
  38. // Purpose:
  39. // Input : *name -
  40. //-----------------------------------------------------------------------------
  41. CPlasma::CPlasma( void )
  42. {
  43. //Client-side
  44. m_flScale = 0.0f;
  45. m_flScaleTime = 0.0f;
  46. m_nFlags = bitsFIRE_NONE;
  47. m_nPlasmaModelIndex = PrecacheModel( "sprites/plasma1.vmt" );
  48. m_nPlasmaModelIndex2 = PrecacheModel( "sprites/plasma1.vmt" );//<<TEMP>>
  49. m_nGlowModelIndex = PrecacheModel( "sprites/fire_floor.vmt" );
  50. //Server-side
  51. }
  52. //-----------------------------------------------------------------------------
  53. // Purpose:
  54. //-----------------------------------------------------------------------------
  55. CPlasma::~CPlasma( void )
  56. {
  57. }
  58. //-----------------------------------------------------------------------------
  59. // Purpose:
  60. // Input : state -
  61. //-----------------------------------------------------------------------------
  62. void CPlasma::EnableSmoke( int state )
  63. {
  64. if ( state )
  65. {
  66. m_nFlags |= bitsFIRESMOKE_SMOKE;
  67. }
  68. else
  69. {
  70. m_nFlags &= ~bitsFIRESMOKE_SMOKE;
  71. }
  72. }
  73. //-----------------------------------------------------------------------------
  74. // Purpose:
  75. //-----------------------------------------------------------------------------
  76. void CPlasma::Precache( void )
  77. {
  78. PrecacheModel( "sprites/plasma1.vmt" );
  79. PrecacheModel( "sprites/fire_floor.vmt" );
  80. }