summaryrefslogtreecommitdiff
path: root/game/shared/tf/tf_weapon_pistol.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/tf/tf_weapon_pistol.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'game/shared/tf/tf_weapon_pistol.h')
-rw-r--r--game/shared/tf/tf_weapon_pistol.h104
1 files changed, 104 insertions, 0 deletions
diff --git a/game/shared/tf/tf_weapon_pistol.h b/game/shared/tf/tf_weapon_pistol.h
new file mode 100644
index 0000000..6c81329
--- /dev/null
+++ b/game/shared/tf/tf_weapon_pistol.h
@@ -0,0 +1,104 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+//
+//=============================================================================
+#ifndef TF_WEAPON_PISTOL_H
+#define TF_WEAPON_PISTOL_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+#include "tf_weaponbase_gun.h"
+
+#include "tf_weapon_shotgun.h"
+
+// Client specific.
+#ifdef CLIENT_DLL
+#define CTFPistol C_TFPistol
+#define CTFPistol_Scout C_TFPistol_Scout
+#define CTFPistol_ScoutPrimary C_TFPistol_ScoutPrimary
+#define CTFPistol_ScoutSecondary C_TFPistol_ScoutSecondary
+#endif
+
+// We allow the pistol to fire as fast as the player can click.
+// This is the minimum time between shots.
+#define PISTOL_FASTEST_REFIRE_TIME 0.1f
+
+// The faster the player fires, the more inaccurate he becomes
+#define PISTOL_ACCURACY_SHOT_PENALTY_TIME 0.2f // Applied amount of time each shot adds to the time we must recover from
+#define PISTOL_ACCURACY_MAXIMUM_PENALTY_TIME 1.5f // Maximum time penalty we'll allow
+
+//=============================================================================
+//
+// TF Weapon Pistol.
+//
+class CTFPistol : public CTFWeaponBaseGun
+{
+public:
+
+ DECLARE_CLASS( CTFPistol, CTFWeaponBaseGun );
+ DECLARE_NETWORKCLASS();
+ DECLARE_PREDICTABLE();
+
+// Server specific.
+#ifdef GAME_DLL
+ DECLARE_DATADESC();
+#endif
+
+ CTFPistol() {}
+ ~CTFPistol() {}
+
+ virtual int GetWeaponID( void ) const { return TF_WEAPON_PISTOL; }
+
+private:
+ CTFPistol( const CTFPistol & ) {}
+};
+
+// Scout specific version
+class CTFPistol_Scout : public CTFPistol
+{
+public:
+ DECLARE_CLASS( CTFPistol_Scout, CTFPistol );
+ DECLARE_NETWORKCLASS();
+ DECLARE_PREDICTABLE();
+
+ virtual int GetWeaponID( void ) const { return TF_WEAPON_PISTOL_SCOUT; }
+};
+
+class CTFPistol_ScoutPrimary : public CTFPistol_Scout
+{
+public:
+ DECLARE_CLASS( CTFPistol_ScoutPrimary, CTFPistol_Scout );
+ DECLARE_NETWORKCLASS();
+ DECLARE_PREDICTABLE();
+
+ CTFPistol_ScoutPrimary();
+
+ virtual int GetViewModelWeaponRole() { return TF_WPN_TYPE_SECONDARY; }
+ virtual int GetWeaponID( void ) const { return TF_WEAPON_HANDGUN_SCOUT_PRIMARY; }
+ virtual void PlayWeaponShootSound( void );
+ virtual void SecondaryAttack( void );
+ virtual void ItemPostFrame();
+ virtual bool Holster( CBaseCombatWeapon *pSwitchingTo );
+ virtual void Precache( void );
+
+ void Push( void );
+
+private:
+ float m_flPushTime;
+};
+
+class CTFPistol_ScoutSecondary : public CTFPistol_Scout
+{
+public:
+ DECLARE_CLASS( CTFPistol_ScoutSecondary, CTFPistol_Scout );
+ DECLARE_NETWORKCLASS();
+ DECLARE_PREDICTABLE();
+
+ virtual int GetViewModelWeaponRole() { return TF_WPN_TYPE_SECONDARY; }
+ virtual int GetWeaponID( void ) const { return TF_WEAPON_HANDGUN_SCOUT_SECONDARY; }
+
+ virtual int GetDamageType( void ) const;
+};
+
+#endif // TF_WEAPON_PISTOL_H \ No newline at end of file