summaryrefslogtreecommitdiff
path: root/game/shared/tfc/weapon_tfcbase.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/tfc/weapon_tfcbase.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'game/shared/tfc/weapon_tfcbase.h')
-rw-r--r--game/shared/tfc/weapon_tfcbase.h126
1 files changed, 126 insertions, 0 deletions
diff --git a/game/shared/tfc/weapon_tfcbase.h b/game/shared/tfc/weapon_tfcbase.h
new file mode 100644
index 0000000..274abc4
--- /dev/null
+++ b/game/shared/tfc/weapon_tfcbase.h
@@ -0,0 +1,126 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+//=============================================================================//
+
+#ifndef WEAPON_TFCBASE_H
+#define WEAPON_TFCBASE_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+#include "tfc_playeranimstate.h"
+#include "tfc_weapon_parse.h"
+
+#if defined( CLIENT_DLL )
+ #define CWeaponTFCBase C_WeaponTFCBase
+#endif
+
+class CTFCPlayer;
+
+
+// Given an ammo type (like from a weapon's GetPrimaryAmmoType()), this compares it
+// against the ammo name you specify.
+// MIKETODO: this should use indexing instead of searching and strcmp()'ing all the time.
+bool IsAmmoType( int iAmmoType, const char *pAmmoName );
+
+
+typedef enum
+{
+ WEAPON_NONE = 0,
+
+ // Melee
+ WEAPON_CROWBAR,
+ WEAPON_SPANNER, // Engineer's wrench.
+ WEAPON_KNIFE,
+ WEAPON_MEDIKIT,
+
+ // Vector weapons
+ WEAPON_MINIGUN,
+
+ // Shotguns
+ WEAPON_SHOTGUN,
+ WEAPON_SUPER_SHOTGUN,
+
+ WEAPON_NAILGUN,
+ WEAPON_SUPER_NAILGUN,
+
+ WEAPON_MAX, // number of weapons weapon index
+
+} TFCWeaponID;
+
+
+//Class Heirarchy for tfc weapons
+
+/*
+
+ CWeaponTFCBase
+ |
+ |--> CTFCCrowbar
+ | |
+ | |--> CTFCKnife
+ | |--> CTFCMedikit
+ | |--> CTFCSpanner
+ | |--> CTFCMedikit
+ |
+ |--> CTFCMinigun
+ |
+ |--> CTFCShotgun
+ | |
+ | |--> CTFCSuperShotgun
+ |
+ |--> CTFCNailgun
+ | |
+ | |--> CTFCSuperNailgun
+
+*/
+class CWeaponTFCBase : public CBaseCombatWeapon
+{
+public:
+ DECLARE_CLASS( CWeaponTFCBase, CBaseCombatWeapon );
+ DECLARE_NETWORKCLASS();
+ DECLARE_PREDICTABLE();
+
+ CWeaponTFCBase();
+
+ virtual void Precache();
+ virtual bool IsPredicted() const;
+
+ CTFCPlayer* GetPlayerOwner() const;
+
+ // Get TFC-specific weapon data.
+ CTFCWeaponInfo const &GetTFCWpnData() const;
+
+ // Get specific TFC weapon ID (ie: WEAPON_AK47, etc)
+ virtual TFCWeaponID GetWeaponID( void ) const;
+
+ // return true if this weapon is an instance of the given weapon type (ie: "IsA" WEAPON_GLOCK)
+ bool IsA( TFCWeaponID id ) const;
+
+ // return true if this weapon has a silencer equipped
+ virtual bool IsSilenced( void ) const;
+
+
+#ifdef CLIENT_DLL
+
+#else
+
+ DECLARE_DATADESC();
+
+ virtual void Spawn();
+ virtual bool DefaultReload( int iClipSize1, int iClipSize2, int iActivity );
+ void SendReloadSoundEvent();
+
+ virtual Vector GetSoundEmissionOrigin() const;
+
+#endif
+
+
+private:
+
+ CWeaponTFCBase( const CWeaponTFCBase & );
+};
+
+
+#endif // WEAPON_TFCBASE_H