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.

92 lines
2.4 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #include "cbase.h"
  7. #include "shake.h"
  8. #include "weapon_dodfullauto.h"
  9. #if defined( CLIENT_DLL )
  10. #define CDODBipodWeapon C_DODBipodWeapon
  11. #endif
  12. class CDODBipodWeapon : public CDODFullAutoWeapon
  13. {
  14. public:
  15. DECLARE_CLASS( CDODBipodWeapon, CDODFullAutoWeapon );
  16. DECLARE_NETWORKCLASS();
  17. DECLARE_PREDICTABLE();
  18. CDODBipodWeapon();
  19. virtual void Spawn();
  20. virtual void Precache();
  21. virtual void Drop( const Vector &vecVelocity );
  22. virtual void SecondaryAttack( void );
  23. virtual bool Reload( void );
  24. virtual float GetWeaponAccuracy( float flPlayerSpeed );
  25. virtual Activity GetUndeployActivity( void );
  26. virtual Activity GetDeployActivity( void );
  27. virtual Activity GetPrimaryAttackActivity( void );
  28. virtual Activity GetReloadActivity( void );
  29. virtual Activity GetIdleActivity( void );
  30. virtual bool CanDrop( void );
  31. virtual bool CanHolster( void );
  32. inline void SetDeployed( bool bDeployed );
  33. inline bool IsDeployed( void ) { return m_bDeployed; }
  34. virtual void ItemBusyFrame( void );
  35. virtual void ItemPostFrame( void );
  36. void BipodThink( void );
  37. bool AttemptToDeploy( void );
  38. bool CheckDeployEnt( void );
  39. bool TestDeploy( float *flDeployedHeight, CBaseEntity **pDeployedOn, float *flYawLimitLeft = NULL, float *flYawLimitRight = NULL );
  40. bool TestDeployAngle( CDODPlayer *pPlayer, float *flDeployedHeight, CBaseEntity **pDeployedOn, QAngle angles );
  41. bool FindYawLimits( float *flLeftLimit, float *flRightLimit );
  42. virtual void DoFireEffects();
  43. void DeployBipod( float flHeight, CBaseEntity *pDeployedOn, float flYawLimitLeft, float flYawLimitRight );
  44. void UndeployBipod( void );
  45. virtual DODWeaponID GetWeaponID( void ) const { return WEAPON_NONE; }
  46. #ifdef CLIENT_DLL
  47. virtual int GetWorldModelIndex( void );
  48. virtual void CheckForAltWeapon( int iCurrentState );
  49. virtual void OverrideMouseInput( float *x, float *y );
  50. #endif
  51. private:
  52. CDODBipodWeapon( const CDODBipodWeapon & );
  53. CNetworkVar( bool, m_bDeployed );
  54. CNetworkVar( int, m_iDeployedModelIndex );
  55. CNetworkVar( int, m_iDeployedReloadModelIndex );
  56. CNetworkVar( int, m_iProneDeployedReloadModelIndex );
  57. int m_iCurrentWorldModel;
  58. EHANDLE m_hDeployedOnEnt;
  59. float m_flDeployedHeight;
  60. float m_flNextDeployCheckTime;
  61. Vector m_DeployedEntOrigin;
  62. bool m_bDuckedWhenDeployed;
  63. #ifdef CLIENT_DLL
  64. bool m_bUseDeployedReload;
  65. #endif
  66. };