summaryrefslogtreecommitdiff
path: root/game/shared/tf/tf_weapon_smg.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_smg.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_smg.h')
-rw-r--r--game/shared/tf/tf_weapon_smg.h93
1 files changed, 93 insertions, 0 deletions
diff --git a/game/shared/tf/tf_weapon_smg.h b/game/shared/tf/tf_weapon_smg.h
new file mode 100644
index 0000000..e2c2683
--- /dev/null
+++ b/game/shared/tf/tf_weapon_smg.h
@@ -0,0 +1,93 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+//
+//=============================================================================
+#ifndef TF_WEAPON_SMG_H
+#define TF_WEAPON_SMG_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+#include "tf_weaponbase_gun.h"
+
+// Client specific.
+#ifdef CLIENT_DLL
+#define CTFSMG C_TFSMG
+#define CTFChargedSMG C_TFChargedSMG
+#endif
+
+//=============================================================================
+//
+// TF Weapon Sub-machine gun.
+//
+class CTFSMG : public CTFWeaponBaseGun
+{
+public:
+
+ DECLARE_CLASS( CTFSMG, CTFWeaponBaseGun );
+ DECLARE_NETWORKCLASS();
+ DECLARE_PREDICTABLE();
+
+// Server specific.
+#ifdef GAME_DLL
+ DECLARE_DATADESC();
+#endif
+
+ CTFSMG() {}
+ ~CTFSMG() {}
+
+ virtual int GetWeaponID( void ) const { return TF_WEAPON_SMG; }
+
+ virtual int GetDamageType( void ) const;
+ virtual bool CanFireCriticalShot( bool bIsHeadshot );
+
+ bool CanHeadshot( void ) const { int iMode = 0; CALL_ATTRIB_HOOK_INT( iMode, set_weapon_mode ); return (iMode == 1); };
+
+private:
+
+ CTFSMG( const CTFSMG & ) {}
+};
+
+//=============================================================================
+//
+// TF Weapon Charged Sub-machine gun.
+//
+class CTFChargedSMG : public CTFSMG
+{
+public:
+ DECLARE_CLASS( CTFChargedSMG, CTFSMG );
+ DECLARE_NETWORKCLASS();
+ DECLARE_PREDICTABLE();
+
+ // Server specific.
+#ifdef GAME_DLL
+ DECLARE_DATADESC();
+#endif
+
+ CTFChargedSMG() {}
+ ~CTFChargedSMG() {}
+
+ virtual int GetWeaponID( void ) const { return TF_WEAPON_CHARGED_SMG; }
+
+ const char* GetEffectLabelText( void ) { return "#TF_SmgCharge"; }
+ float GetProgress( void );
+ bool ShouldFlashChargeBar();
+ void SecondaryAttack() OVERRIDE;
+ bool CanPerformSecondaryAttack() const OVERRIDE;
+ void WeaponReset() OVERRIDE;
+
+#ifdef GAME_DLL
+ void ApplyOnHitAttributes( CBaseEntity *pVictimBaseEntity, CTFPlayer *pAttacker, const CTakeDamageInfo &info ) OVERRIDE;
+#endif
+
+protected:
+ CNetworkVar( float, m_flMinicritCharge );
+
+ float m_flMinicritStartTime;
+
+private:
+ CTFChargedSMG( const CTFChargedSMG & ) {}
+};
+
+
+#endif // TF_WEAPON_SMG_H \ No newline at end of file