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.

104 lines
2.8 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. //
  4. //=============================================================================
  5. #ifndef TF_WEAPON_RAYGUN_H
  6. #define TF_WEAPON_RAYGUN_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. class CTFRaygun : public CTFRocketLauncher
  19. {
  20. public:
  21. DECLARE_CLASS( CTFRaygun, CTFRocketLauncher );
  22. DECLARE_NETWORKCLASS();
  23. DECLARE_PREDICTABLE();
  24. CTFRaygun();
  25. virtual void Precache();
  26. virtual int GetWeaponID( void ) const { return TF_WEAPON_RAYGUN; }
  27. virtual float GetProjectileSpeed( void );
  28. virtual float GetProjectileGravity( void );
  29. virtual bool IsViewModelFlipped( void );
  30. const char* GetEffectLabelText( void ) { return "#TF_BISON"; }
  31. float GetProgress( void );
  32. virtual bool Holster( CBaseCombatWeapon *pSwitchingTo );
  33. virtual bool Deploy( void );
  34. virtual void ItemPostFrame( void );
  35. virtual void PrimaryAttack( void );
  36. virtual void ModifyProjectile( CBaseEntity* pProj );
  37. virtual const char* GetMuzzleFlashParticleEffect( void );
  38. virtual float GetDamage( void ) { return 20.f; }
  39. virtual bool IsEnergyWeapon( void ) const { return true; }
  40. virtual float Energy_GetShotCost( void ) const
  41. {
  42. int iNoDrain = 0;
  43. CALL_ATTRIB_HOOK_INT( iNoDrain, energy_weapon_no_drain );
  44. if ( iNoDrain > 0 )
  45. {
  46. return 0.0f;
  47. }
  48. return 5.f;
  49. }
  50. virtual float Energy_GetRechargeCost( void ) const { return 5.f; }
  51. #ifdef CLIENT_DLL
  52. virtual void DispatchMuzzleFlash( const char* effectName, C_BaseEntity* pAttachEnt );
  53. void ClientEffectsThink( void );
  54. virtual bool ShouldPlayClientReloadSound() { return true; }
  55. virtual const char *GetIdleParticleEffect( void ) { return "drg_bison_idle"; }
  56. #endif
  57. bool UseNewProjectileCode() const { return m_bUseNewProjectileCode; }
  58. private:
  59. float m_flIrradiateTime;
  60. bool m_bEffectsThinking;
  61. CNetworkVar( bool, m_bUseNewProjectileCode );
  62. };
  63. //---------------------------------------------------------
  64. class CTFDRGPomson : public CTFRaygun
  65. {
  66. public:
  67. DECLARE_CLASS( CTFDRGPomson, CTFRaygun );
  68. DECLARE_NETWORKCLASS();
  69. DECLARE_PREDICTABLE();
  70. virtual void Precache();
  71. virtual int GetWeaponID( void ) const { return TF_WEAPON_DRG_POMSON; }
  72. const char* GetEffectLabelText( void ) { return "#TF_POMSON_HUD"; }
  73. virtual const char *GetMuzzleFlashParticleEffect( void ) { return "drg_pomson_muzzleflash"; }
  74. virtual const char *GetIdleParticleEffect( void ) { return "drg_pomson_idle"; }
  75. virtual void GetProjectileFireSetup( CTFPlayer *pPlayer, Vector vecOffset, Vector *vecSrc, QAngle *angForward, bool bHitTeammates = true, float flEndDist = 2000.f );
  76. };
  77. #endif // TF_WEAPON_RAYGUN_H