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.

114 lines
3.0 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: TF Mirv Grenade.
  4. //
  5. //=============================================================================//
  6. #ifndef TF_WEAPON_GRENADE_MIRV_H
  7. #define TF_WEAPON_GRENADE_MIRV_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "tf_weaponbase_grenade.h"
  12. #include "tf_weaponbase_grenadeproj.h"
  13. // Client specific.
  14. #ifdef CLIENT_DLL
  15. #define CTFGrenadeMirv C_TFGrenadeMirv
  16. #define CTFGrenadeMirv_Demoman C_TFGrenadeMirv_Demoman
  17. #endif
  18. //=============================================================================
  19. //
  20. // TF Mirv Grenade
  21. //
  22. class CTFGrenadeMirv : public CTFWeaponBaseGrenade
  23. {
  24. public:
  25. DECLARE_CLASS( CTFGrenadeMirv, CTFWeaponBaseGrenade );
  26. DECLARE_NETWORKCLASS();
  27. DECLARE_PREDICTABLE();
  28. CTFGrenadeMirv() {}
  29. // Unique identifier.
  30. virtual int GetWeaponID( void ) const { return TF_WEAPON_GRENADE_MIRV; }
  31. // Server specific.
  32. #ifdef GAME_DLL
  33. DECLARE_DATADESC();
  34. virtual CTFWeaponBaseGrenadeProj *EmitGrenade( Vector vecSrc, QAngle vecAngles, Vector vecVel, AngularImpulse angImpulse, CBasePlayer *pPlayer, float flTime, int iflags = 0 );
  35. #endif
  36. CTFGrenadeMirv( const CTFGrenadeMirv & ) {}
  37. };
  38. // Demoman version calls different models
  39. class CTFGrenadeMirv_Demoman : public CTFGrenadeMirv
  40. {
  41. public:
  42. DECLARE_CLASS( CTFGrenadeMirv_Demoman, CTFGrenadeMirv );
  43. DECLARE_NETWORKCLASS();
  44. DECLARE_PREDICTABLE();
  45. virtual int GetWeaponID( void ) const { return TF_WEAPON_GRENADE_MIRV_DEMOMAN; }
  46. };
  47. //=============================================================================
  48. //
  49. // TF Mirv Grenade Projectile and Bombs (Server specific.)
  50. //
  51. #ifdef GAME_DLL
  52. class CTFGrenadeMirvProjectile : public CTFWeaponBaseGrenadeProj
  53. {
  54. public:
  55. DECLARE_CLASS( CTFGrenadeMirvProjectile, CTFWeaponBaseGrenadeProj );
  56. // Unique identifier.
  57. virtual int GetWeaponID( void ) const { return TF_WEAPON_GRENADE_MIRV; }
  58. // Creation.
  59. static CTFGrenadeMirvProjectile *Create( const Vector &position, const QAngle &angles, const Vector &velocity,
  60. const AngularImpulse &angVelocity, CBaseCombatCharacter *pOwner, const CTFWeaponInfo &weaponInfo, float timer, int iFlags = 0 );
  61. // Overrides.
  62. virtual void Spawn();
  63. virtual void Precache();
  64. virtual void BounceSound( void );
  65. virtual void Detonate();
  66. virtual void Explode( trace_t *pTrace, int bitsDamageType );
  67. void DetonateThink( void );
  68. DECLARE_DATADESC();
  69. private:
  70. bool m_bPlayedLeadIn;
  71. };
  72. class CTFGrenadeMirvBomb : public CTFWeaponBaseGrenadeProj
  73. {
  74. public:
  75. DECLARE_CLASS( CTFGrenadeMirvBomb, CTFWeaponBaseGrenadeProj );
  76. // Creation.
  77. static CTFGrenadeMirvBomb *Create( const Vector &position, const QAngle &angles, const Vector &velocity,
  78. const AngularImpulse &angVelocity, CBaseCombatCharacter *pOwner, float timer );
  79. virtual int GetWeaponID( void ) const { return TF_WEAPON_GRENADE_MIRVBOMB; }
  80. virtual void Spawn();
  81. virtual void Precache();
  82. virtual void BounceSound( void );
  83. };
  84. #endif
  85. #endif // TF_WEAPON_GRENADE_MIRV_H