summaryrefslogtreecommitdiff
path: root/game/shared/dod/weapon_dodbasegun.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_dodbasegun.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_dodbasegun.h')
-rw-r--r--game/shared/dod/weapon_dodbasegun.h83
1 files changed, 83 insertions, 0 deletions
diff --git a/game/shared/dod/weapon_dodbasegun.h b/game/shared/dod/weapon_dodbasegun.h
new file mode 100644
index 0000000..8ff215d
--- /dev/null
+++ b/game/shared/dod/weapon_dodbasegun.h
@@ -0,0 +1,83 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+//=============================================================================//
+
+#ifndef WEAPON_DODBASE_GUN_H
+#define WEAPON_DODBASE_GUN_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+
+#include "weapon_dodbase.h"
+
+// This is the base class for pistols and rifles.
+#if defined( CLIENT_DLL )
+
+ //#include "particles_simple.h"
+ //#include "particles_localspace.h"
+ #include "fx.h"
+ #include "fx_dod_muzzleflash.h"
+
+ #define CWeaponDODBaseGun C_WeaponDODBaseGun
+
+#else
+#endif
+
+class CWeaponDODBaseGun : public CWeaponDODBase
+{
+public:
+
+ DECLARE_CLASS( CWeaponDODBaseGun, CWeaponDODBase );
+ DECLARE_NETWORKCLASS();
+ DECLARE_PREDICTABLE();
+
+ CWeaponDODBaseGun();
+
+ virtual void Spawn();
+ virtual void Precache();
+ virtual void PrimaryAttack();
+ virtual bool Reload();
+
+ // Derived classes must call this from inside their Spawn() function instead of
+ // just chaining the Spawn() call down.
+ void DODBaseGunSpawn( void );
+
+ // Derived classes call this to fire a bullet.
+ bool DODBaseGunFire( void );
+
+ // Usually plays the shot sound. Guns with silencers can play different sounds.
+ virtual void DoFireEffects();
+ virtual float GetFireDelay( void );
+
+ virtual float GetWeaponAccuracy( float flPlayerSpeed );
+
+ //Pure animation calls - inheriting classes can override with specific
+ //logic, eg if the idle changes depending on the gun being empty or not
+ virtual Activity GetPrimaryAttackActivity( void );
+ virtual Activity GetReloadActivity( void );
+ virtual Activity GetDrawActivity( void );
+
+ virtual bool CanDrop( void ) { return m_pWeaponInfo->m_bCanDrop; }
+
+ void SetZoomed( bool bZoomed ) { m_bZoomed = bZoomed; }
+ bool IsSniperZoomed( void ) { return m_bZoomed; }
+ CNetworkVar( bool, m_bZoomed );
+
+protected:
+ CDODWeaponInfo *m_pWeaponInfo;
+
+private:
+ CWeaponDODBaseGun( const CWeaponDODBaseGun & );
+
+#ifndef CLIENT_DLL
+
+ DECLARE_DATADESC();
+
+#endif
+};
+
+
+#endif // WEAPON_DODBASE_GUN_H