diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/shared/tf/tf_weapon_laser_pointer.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'game/shared/tf/tf_weapon_laser_pointer.h')
| -rw-r--r-- | game/shared/tf/tf_weapon_laser_pointer.h | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/game/shared/tf/tf_weapon_laser_pointer.h b/game/shared/tf/tf_weapon_laser_pointer.h new file mode 100644 index 0000000..e878dda --- /dev/null +++ b/game/shared/tf/tf_weapon_laser_pointer.h @@ -0,0 +1,98 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: Engineer's Laser Pointer +// +//=============================================================================// +#ifndef TF_WEAPON_LASER_POINTER_H +#define TF_WEAPON_LASER_POINTER_H +#ifdef _WIN32 +#pragma once +#endif + +#include "tf_weaponbase_gun.h" +#include "tf_weapon_sniperrifle.h" +#include "Sprite.h" + +#if defined( CLIENT_DLL ) +#define CTFLaserPointer C_TFLaserPointer +#define CLaserDot C_LaserDot +#endif + +//============================================================================= +// +// Laser Dot +// +class CLaserDot : public CSniperDot +{ +public: + DECLARE_CLASS( CLaserDot, CSniperDot ); + DECLARE_NETWORKCLASS(); + DECLARE_DATADESC(); + + // Creation/Destruction. + CLaserDot( void ); + ~CLaserDot( void ); + + static CLaserDot *Create( const Vector &origin, CBaseEntity *pOwner = NULL, bool bVisibleDot = true ); +#ifdef CLIENT_DLL + virtual int DrawModel( int flags ); + virtual bool ShouldDraw( void ) { return false; } +#endif +}; + +//============================================================================= +// +// Laser Pointer +// +class CTFLaserPointer : public CTFWeaponBaseGun +{ +public: + + DECLARE_CLASS( CTFLaserPointer, CTFWeaponBaseGun ); + DECLARE_NETWORKCLASS(); + DECLARE_PREDICTABLE(); + + CTFLaserPointer(); + ~CTFLaserPointer(); + + virtual int GetWeaponID( void ) const { return TF_WEAPON_LASER_POINTER; } + + virtual void Precache(); + virtual bool Deploy( void ); + virtual bool Holster( CBaseCombatWeapon *pSwitchingTo ); + virtual void ItemPostFrame( void ); + virtual void PrimaryAttack( void ); + virtual void SecondaryAttack( void ); + + virtual void WeaponIdle( void ); + + virtual bool UsesClipsForAmmo1( void ) const { return false; } + virtual bool UsesClipsForAmmo2( void ) const { return false; } + +#ifdef GAME_DLL + CLaserDot* GetLaserDot() { return m_hLaserDot.Get(); } + bool HasLaserDot() { return GetLaserDot()?true:false; } +#endif + +private: + + void CreateLaserDot( void ); + void DestroyLaserDot( void ); + void UpdateLaserDot( void ); + +private: + +#ifdef GAME_DLL + CHandle<CLaserDot> m_hLaserDot; +#endif + + float m_flNextAttack; + float m_flStartedFiring; + bool m_bDoHandIdle; + + bool m_bDeployed; + + CTFLaserPointer( const CTFLaserPointer & ); +}; + +#endif // TF_WEAPON_LASER_POINTER_H |