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.

111 lines
2.6 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef TF_WEAPON_WRENCH_H
  7. #define TF_WEAPON_WRENCH_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "tf_weaponbase_melee.h"
  12. #include "tf_item_wearable.h"
  13. #ifdef CLIENT_DLL
  14. #define CTFWrench C_TFWrench
  15. #define CTFRobotArm C_TFRobotArm
  16. #define CTFWearableRobotArm C_TFWearableRobotArm
  17. #endif
  18. //=============================================================================
  19. //
  20. // Wrench class.
  21. //
  22. class CTFWrench : public CTFWeaponBaseMelee
  23. {
  24. public:
  25. DECLARE_CLASS( CTFWrench, CTFWeaponBaseMelee );
  26. DECLARE_NETWORKCLASS();
  27. DECLARE_PREDICTABLE();
  28. CTFWrench();
  29. virtual void Spawn();
  30. virtual int GetWeaponID( void ) const { return TF_WEAPON_WRENCH; }
  31. virtual void Smack( void );
  32. virtual bool Holster( CBaseCombatWeapon *pSwitchingTo );
  33. bool IsPDQ( void ) { int iMode = 0; CALL_ATTRIB_HOOK_INT( iMode, wrench_builds_minisentry ); return iMode==1; };
  34. float GetConstructionValue( void );
  35. float GetRepairValue( void );
  36. #ifdef GAME_DLL
  37. virtual void Equip( CBaseCombatCharacter *pOwner );
  38. virtual void Detach();
  39. void ApplyBuildingHealthUpgrade( void );
  40. void OnFriendlyBuildingHit( CBaseObject *pObject, CTFPlayer *pPlayer, Vector hitLoc );
  41. #else
  42. virtual void ItemPostFrame();
  43. #endif
  44. private:
  45. bool m_bReloadDown;
  46. CTFWrench( const CTFWrench & ) {}
  47. };
  48. //=============================================================================
  49. //
  50. // Robot Arm class.
  51. //
  52. class CTFRobotArm : public CTFWrench
  53. {
  54. public:
  55. DECLARE_CLASS( CTFRobotArm, CTFWrench );
  56. DECLARE_NETWORKCLASS();
  57. DECLARE_PREDICTABLE();
  58. CTFRobotArm();
  59. virtual void Precache();
  60. #ifdef GAME_DLL
  61. virtual void Equip( CBaseCombatCharacter *pOwner );
  62. virtual void Drop( const Vector &vecVelocity );
  63. virtual void UpdateOnRemove( void );
  64. void RemoveRobotArm();
  65. virtual void OnActiveStateChanged( int iOldState );
  66. virtual int GetDamageCustom();
  67. virtual float GetForceScale( void );
  68. virtual bool HideAttachmentsAndShowBodygroupsWhenPerformingWeaponIndependentTaunt() const OVERRIDE { return false; }
  69. #endif
  70. virtual void PrimaryAttack();
  71. virtual void Smack( void );
  72. virtual void WeaponIdle( void );
  73. virtual void DoViewModelAnimation( void );
  74. private:
  75. CNetworkHandle( CTFWearable, m_hRobotArm );
  76. int m_iComboCount;
  77. float m_flLastComboHit;
  78. bool m_bBigIdle;
  79. bool m_bBigHit;
  80. };
  81. class CTFWearableRobotArm : public CTFWearable
  82. {
  83. public:
  84. DECLARE_CLASS( CTFWearableRobotArm, CTFWearable );
  85. DECLARE_NETWORKCLASS();
  86. };
  87. #endif // TF_WEAPON_WRENCH_H