Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

87 lines
2.3 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: PDA Weapon
  4. //
  5. //=============================================================================
  6. #ifndef TF_WEAPON_INVIS_H
  7. #define TF_WEAPON_INVIS_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "tf_shareddefs.h"
  12. #include "tf_weaponbase.h"
  13. #include "tf_gamerules.h"
  14. // Client specific.
  15. #if defined( CLIENT_DLL )
  16. #define CTFWeaponInvis C_TFWeaponInvis
  17. #endif
  18. enum invis_weapontypes_t
  19. {
  20. INVIS_BASE = 0,
  21. INVIS_FEIGN_DEATH,
  22. INVIS_MOTION_CLOAK,
  23. };
  24. class CTFWeaponInvis : public CTFWeaponBase
  25. {
  26. public:
  27. DECLARE_CLASS( CTFWeaponInvis, CTFWeaponBase );
  28. DECLARE_NETWORKCLASS();
  29. DECLARE_PREDICTABLE();
  30. #if !defined( CLIENT_DLL )
  31. DECLARE_DATADESC();
  32. #endif
  33. CTFWeaponInvis() {}
  34. virtual void Spawn();
  35. virtual void OnActiveStateChanged( int iOldState );
  36. virtual void PrimaryAttack( void );
  37. virtual void SecondaryAttack();
  38. virtual bool Deploy( void );
  39. virtual void HideThink( void );
  40. virtual bool Holster( CBaseCombatWeapon *pSwitchingTo );
  41. virtual int GetWeaponID( void ) const { return TF_WEAPON_INVIS; }
  42. virtual bool ShouldDrawCrosshair( void ) { return false; }
  43. virtual bool HasPrimaryAmmo() { return true; }
  44. virtual bool CanBeSelected() { return true; }
  45. virtual bool VisibleInWeaponSelection( void ) { return false; }
  46. virtual bool ShouldShowControlPanels( void ) { return true; }
  47. virtual void SetWeaponVisible( bool visible );
  48. virtual void ItemBusyFrame( void );
  49. int GetInvisType( void ) { int iMode = 0; CALL_ATTRIB_HOOK_INT( iMode, set_weapon_mode ); return iMode; };
  50. virtual bool HasFeignDeath( void ) { return (GetInvisType() == INVIS_FEIGN_DEATH); }
  51. virtual bool HasMotionCloak( void ) { return (GetInvisType() == INVIS_MOTION_CLOAK); }
  52. virtual void SetFeignDeathState( bool bEnabled );
  53. virtual void SetCloakRates( void );
  54. virtual bool ActivateInvisibilityWatch( void );
  55. virtual void CleanupInvisibilityWatch( void );
  56. virtual bool AllowsAutoSwitchTo( void ) { return false; }
  57. virtual bool CanDeploy( void ) { return false; }
  58. virtual const char *GetViewModel( int viewmodelindex ) const;
  59. #ifndef CLIENT_DLL
  60. virtual void GetControlPanelInfo( int nPanelIndex, const char *&pPanelName );
  61. #endif
  62. private:
  63. CTFWeaponInvis( const CTFWeaponInvis & ) {}
  64. };
  65. #endif // TF_WEAPON_INVIS_H