summaryrefslogtreecommitdiff
path: root/game/shared/dod/weapon_dodsniper.h
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/shared/dod/weapon_dodsniper.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'game/shared/dod/weapon_dodsniper.h')
-rw-r--r--game/shared/dod/weapon_dodsniper.h111
1 files changed, 111 insertions, 0 deletions
diff --git a/game/shared/dod/weapon_dodsniper.h b/game/shared/dod/weapon_dodsniper.h
new file mode 100644
index 0000000..da6fefe
--- /dev/null
+++ b/game/shared/dod/weapon_dodsniper.h
@@ -0,0 +1,111 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+//=============================================================================//
+
+#ifndef WEAPON_DODSNIPER_H
+#define WEAPON_DODSNIPER_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+
+#include "cbase.h"
+#include "shake.h"
+#include "weapon_dodsemiauto.h"
+#include "dod_shareddefs.h"
+
+#if defined( CLIENT_DLL )
+ #define CDODSniperWeapon C_DODSniperWeapon
+#endif
+
+#define DOD_SNIPER_ZOOM_CHANGE_TIME 0.3
+
+class CDODSniperWeapon : public CDODSemiAutoWeapon
+{
+public:
+ DECLARE_CLASS( CDODSniperWeapon, CDODSemiAutoWeapon );
+ DECLARE_NETWORKCLASS();
+ DECLARE_PREDICTABLE();
+
+#ifndef CLIENT_DLL
+ DECLARE_DATADESC();
+#endif
+
+ CDODSniperWeapon();
+
+ virtual void Spawn( void );
+ virtual bool Holster( CBaseCombatWeapon *pSwitchingTo );
+ virtual bool Reload( void );
+ virtual void FinishReload( void );
+ virtual void Drop( const Vector &vecVelocity );
+ virtual void ItemPostFrame( void );
+
+ virtual void PrimaryAttack( void );
+ virtual void SecondaryAttack( void );
+
+ void ResetTimers( void ); // reset all the flags, timers that would cause us to re-zoom or unzoom
+
+#ifdef CLIENT_DLL
+ virtual Vector GetDesiredViewModelOffset( C_DODPlayer *pOwner );
+ virtual float GetViewModelSwayScale( void );
+
+ float GetZoomedPercentage( void );
+#endif
+
+ // Is the weapon completely zoomed, finished the raising animation
+ bool IsFullyZoomed( void );
+
+ virtual bool ShouldDrawCrosshair( void );
+
+ virtual bool HideViewModelWhenZoomed( void ) { return true; }
+
+ virtual float GetWeaponAccuracy( float flPlayerSpeed );
+
+ virtual float GetZoomedFOV( void ) { return 20; }
+
+ bool IsZoomed( void );
+
+ virtual bool ShouldZoomOutBetweenShots( void ) { return true; }
+ virtual bool ShouldRezoomAfterReload( void ) { return false; }
+
+ void ToggleZoom( void );
+
+ void ZoomIn( void );
+ void ZoomOut( void );
+
+ void ZoomOutIn( void );
+
+ void SetRezoom( bool bRezoom, float flDelay );
+
+ bool IsZoomingIn( void );
+
+ CNetworkVar( bool, m_bDoViewAnim );
+
+
+
+#ifdef CLIENT_DLL
+ bool m_bDoViewAnimCache;
+ float m_flViewAnimTimer;
+ float m_flZoomPercent;
+#endif
+
+protected:
+ bool m_bShouldRezoomAfterShot; // if the gun zooms out after a shot, does it zoom back in automatically?
+
+private:
+ CDODSniperWeapon( const CDODSniperWeapon & );
+
+ float m_flUnzoomTime;
+ float m_flRezoomTime;
+
+ float m_flZoomInTime;
+ float m_flZoomOutTime;
+
+ bool m_bRezoomAfterReload;
+ float m_flZoomChangeTime;
+ bool m_bRezoomAfterShot;
+};
+
+#endif // WEAPON_DODSNIPER_H \ No newline at end of file