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.

100 lines
2.1 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #include "cbase.h"
  7. #include "fx_cs_shared.h"
  8. #include "c_cs_player.h"
  9. #include "c_basetempentity.h"
  10. #include <cliententitylist.h>
  11. class C_TEFireBullets : public C_BaseTempEntity
  12. {
  13. public:
  14. DECLARE_CLASS( C_TEFireBullets, C_BaseTempEntity );
  15. DECLARE_CLIENTCLASS();
  16. virtual void PostDataUpdate( DataUpdateType_t updateType );
  17. public:
  18. int m_iPlayer;
  19. Vector m_vecOrigin;
  20. QAngle m_vecAngles;
  21. int m_iWeaponID;
  22. int m_iMode;
  23. int m_iSeed;
  24. float m_fInaccuracy;
  25. float m_fSpread;
  26. };
  27. void C_TEFireBullets::PostDataUpdate( DataUpdateType_t updateType )
  28. {
  29. // Create the effect.
  30. m_vecAngles.z = 0;
  31. FX_FireBullets(
  32. m_iPlayer+1,
  33. m_vecOrigin,
  34. m_vecAngles,
  35. m_iWeaponID,
  36. m_iMode,
  37. m_iSeed,
  38. m_fInaccuracy,
  39. m_fSpread
  40. );
  41. }
  42. IMPLEMENT_CLIENTCLASS_EVENT( C_TEFireBullets, DT_TEFireBullets, CTEFireBullets );
  43. BEGIN_RECV_TABLE_NOBASE(C_TEFireBullets, DT_TEFireBullets)
  44. RecvPropVector( RECVINFO( m_vecOrigin ) ),
  45. RecvPropFloat( RECVINFO( m_vecAngles[0] ) ),
  46. RecvPropFloat( RECVINFO( m_vecAngles[1] ) ),
  47. RecvPropInt( RECVINFO( m_iWeaponID ) ),
  48. RecvPropInt( RECVINFO( m_iMode ) ),
  49. RecvPropInt( RECVINFO( m_iSeed ) ),
  50. RecvPropInt( RECVINFO( m_iPlayer ) ),
  51. RecvPropFloat( RECVINFO( m_fInaccuracy ) ),
  52. RecvPropFloat( RECVINFO( m_fSpread ) ),
  53. END_RECV_TABLE()
  54. class C_TEPlantBomb : public C_BaseTempEntity
  55. {
  56. public:
  57. DECLARE_CLASS( C_TEPlantBomb, C_BaseTempEntity );
  58. DECLARE_CLIENTCLASS();
  59. virtual void PostDataUpdate( DataUpdateType_t updateType );
  60. public:
  61. int m_iPlayer;
  62. Vector m_vecOrigin;
  63. PlantBombOption_t m_option;
  64. };
  65. void C_TEPlantBomb::PostDataUpdate( DataUpdateType_t updateType )
  66. {
  67. // Create the effect.
  68. FX_PlantBomb( m_iPlayer+1, m_vecOrigin, m_option );
  69. }
  70. IMPLEMENT_CLIENTCLASS_EVENT( C_TEPlantBomb, DT_TEPlantBomb, CTEPlantBomb );
  71. BEGIN_RECV_TABLE_NOBASE(C_TEPlantBomb, DT_TEPlantBomb)
  72. RecvPropVector( RECVINFO( m_vecOrigin ) ),
  73. RecvPropInt( RECVINFO( m_iPlayer ) ),
  74. RecvPropInt( RECVINFO( m_option ) ),
  75. END_RECV_TABLE()