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.

60 lines
1.1 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #include "cbase.h"
  7. #include "weapon_csbase.h"
  8. #include "gamerules.h"
  9. #include "npcevent.h"
  10. #include "engine/IEngineSound.h"
  11. #include "weapon_flashbang.h"
  12. #ifdef CLIENT_DLL
  13. #else
  14. #include "cs_player.h"
  15. #include "items.h"
  16. #include "flashbang_projectile.h"
  17. #endif
  18. #define GRENADE_TIMER 3.0f //Seconds
  19. IMPLEMENT_NETWORKCLASS_ALIASED( Flashbang, DT_Flashbang )
  20. BEGIN_NETWORK_TABLE(CFlashbang, DT_Flashbang)
  21. END_NETWORK_TABLE()
  22. BEGIN_PREDICTION_DATA( CFlashbang )
  23. END_PREDICTION_DATA()
  24. LINK_ENTITY_TO_CLASS( weapon_flashbang, CFlashbang );
  25. PRECACHE_WEAPON_REGISTER( weapon_flashbang );
  26. #ifndef CLIENT_DLL
  27. BEGIN_DATADESC( CFlashbang )
  28. END_DATADESC()
  29. void CFlashbang::EmitGrenade( Vector vecSrc, QAngle vecAngles, Vector vecVel, AngularImpulse angImpulse, CBasePlayer *pPlayer )
  30. {
  31. CFlashbangProjectile::Create(
  32. vecSrc,
  33. vecAngles,
  34. vecVel,
  35. angImpulse,
  36. pPlayer );
  37. }
  38. #endif