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.3 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. //
  4. //=============================================================================
  5. #ifndef TF_WEAPON_RAYGUN_REVENGE_H
  6. #define TF_WEAPON_RAYGUN_REVENGE_H
  7. #ifdef _WIN32
  8. #pragma once
  9. #endif
  10. #include "tf_weaponbase_gun.h"
  11. #include "tf_weapon_shotgun.h"
  12. #include "tf_weapon_rocketlauncher.h"
  13. // Client specific.
  14. #ifdef CLIENT_DLL
  15. #define CTFRaygun C_TFRaygun
  16. #define CTFDRGPomson C_TFDRGPomson
  17. #endif
  18. #define RAYGUN_ENERGY_PER_SHOT 20
  19. #define RAYGUN_ENERGY_PER_PUMP 100
  20. class CTFRaygun_Revenge : public CTFRaygun
  21. {
  22. public:
  23. DECLARE_CLASS( CTFRaygun, CTFRocketLauncher );
  24. DECLARE_NETWORKCLASS();
  25. DECLARE_PREDICTABLE();
  26. CTFRaygun();
  27. virtual void Precache();
  28. virtual int GetWeaponID( void ) const { return TF_WEAPON_RAYGUN_REVENGE; }
  29. virtual float GetProjectileSpeed( void );
  30. virtual float GetProjectileGravity( void );
  31. virtual bool IsViewModelFlipped( void );
  32. const char* GetEffectLabelText( void ) { return "#TF_BISON"; }
  33. float GetProgress( void );
  34. virtual bool Holster( CBaseCombatWeapon *pSwitchingTo );
  35. virtual bool Deploy( void );
  36. virtual void ItemPostFrame( void );
  37. virtual void PrimaryAttack( void );
  38. virtual void ModifyProjectile( CBaseEntity* pProj );
  39. virtual const char* GetMuzzleFlashParticleEffect( void );
  40. virtual float GetDamage( void ) { return 20.f; }
  41. virtual bool IsEnergyWeapon( void ) const { return true; }
  42. virtual float Energy_GetShotCost( void ) const
  43. {
  44. int iNoDrain = 0;
  45. CALL_ATTRIB_HOOK_INT( iNoDrain, energy_weapon_no_drain );
  46. if ( iNoDrain > 0 )
  47. {
  48. return 0.0f;
  49. }
  50. return 25.f;
  51. }
  52. virtual float Energy_GetRechargeCost( void ) const { return 25.f; }
  53. #ifdef CLIENT_DLL
  54. virtual void DispatchMuzzleFlash( const char* effectName, C_BaseEntity* pAttachEnt );
  55. void ClientEffectsThink( void );
  56. virtual bool ShouldPlayClientReloadSound() { return true; }
  57. #endif
  58. private:
  59. float m_flIrradiateTime;
  60. bool m_bEffectsThinking;
  61. };
  62. //---------------------------------------------------------
  63. class CTFDRGPomson : public CTFRaygun
  64. {
  65. public:
  66. DECLARE_CLASS( CTFDRGPomson, CTFRaygun );
  67. DECLARE_NETWORKCLASS();
  68. DECLARE_PREDICTABLE();
  69. virtual int GetWeaponID( void ) const { return TF_WEAPON_DRG_POMSON; }
  70. const char* GetEffectLabelText( void ) { return "#TF_POMSON_HUD"; }
  71. };
  72. #endif // TF_WEAPON_RAYGUN_REVENGE_H