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.

86 lines
2.0 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef WEAPON_DODBASEBOMB_H
  8. #define WEAPON_DODBASEBOMB_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "weapon_dodbase.h"
  13. #if defined( CLIENT_DLL )
  14. #define CDODBaseBombWeapon C_DODBaseBombWeapon
  15. #else
  16. #include "dod_bombtarget.h"
  17. #endif
  18. //-----------------------------------------------------------------------------
  19. // RPG
  20. //-----------------------------------------------------------------------------
  21. class CDODBaseBombWeapon : public CWeaponDODBase
  22. {
  23. public:
  24. DECLARE_CLASS( CDODBaseBombWeapon, CWeaponDODBase );
  25. DECLARE_NETWORKCLASS();
  26. DECLARE_PREDICTABLE();
  27. DECLARE_ACTTABLE();
  28. CDODBaseBombWeapon();
  29. virtual void Spawn();
  30. virtual void Precache( void );
  31. virtual bool Deploy();
  32. virtual void PrimaryAttack();
  33. virtual void SecondaryAttack();
  34. virtual bool Holster( CBaseCombatWeapon *pSwitchingTo );
  35. virtual void ItemPostFrame( void );
  36. virtual bool CanDrop( void ) { return false; }
  37. virtual DODWeaponID GetWeaponID( void ) const { return WEAPON_NONE; }
  38. virtual bool ShouldDrawCrosshair( void ) { return false; }
  39. virtual bool HasPrimaryAmmo() { return true; }
  40. virtual bool CanBeSelected() { return false; }
  41. #ifndef CLIENT_DLL
  42. void StartPlanting( CDODBombTarget *pTarget );
  43. bool CancelPlanting( void );
  44. void CompletePlant( void );
  45. bool IsLookingAtBombTarget( CBasePlayer *pPlayer, CDODBombTarget *pTarget );
  46. #endif
  47. void SetPlanting( bool bPlanting );
  48. bool IsPlanting( void );
  49. protected:
  50. CDODWeaponInfo *m_pWeaponInfo;
  51. private:
  52. CDODBaseBombWeapon( const CDODBaseBombWeapon & );
  53. bool m_bPlanting;
  54. // pointer to the dod_bomb_target that we're planting at
  55. EHANDLE m_hBombTarget;
  56. // when the plant will be complete
  57. float m_flPlantCompleteTime;
  58. bool m_bUsePlant; // player hit +use to start this plant
  59. float m_flNextPlantCheck;
  60. #ifndef CLIENT_DLL
  61. DECLARE_DATADESC();
  62. #endif
  63. };
  64. #endif // WEAPON_DODBASEBOMB_H