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.

102 lines
3.2 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #include "cbase.h"
  7. #include "weapon_dodbaserpg.h"
  8. #ifndef CLIENT_DLL
  9. #include "rocket_pschreck.h"
  10. #endif
  11. #if defined( CLIENT_DLL )
  12. #define CWeaponPschreck C_WeaponPschreck
  13. #endif
  14. class CWeaponPschreck : public CDODBaseRocketWeapon
  15. {
  16. public:
  17. DECLARE_CLASS( CWeaponPschreck, CDODBaseRocketWeapon );
  18. DECLARE_NETWORKCLASS();
  19. DECLARE_PREDICTABLE();
  20. DECLARE_ACTTABLE();
  21. CWeaponPschreck() {}
  22. virtual DODWeaponID GetWeaponID( void ) const { return WEAPON_PSCHRECK; }
  23. virtual void FireRocket( void );
  24. private:
  25. CWeaponPschreck( const CWeaponPschreck & );
  26. };
  27. IMPLEMENT_NETWORKCLASS_ALIASED( WeaponPschreck, DT_WeaponPschreck )
  28. BEGIN_NETWORK_TABLE( CWeaponPschreck, DT_WeaponPschreck )
  29. END_NETWORK_TABLE()
  30. BEGIN_PREDICTION_DATA( CWeaponPschreck )
  31. END_PREDICTION_DATA()
  32. LINK_ENTITY_TO_CLASS( weapon_pschreck, CWeaponPschreck );
  33. PRECACHE_WEAPON_REGISTER( weapon_pschreck );
  34. acttable_t CWeaponPschreck::m_acttable[] =
  35. {
  36. { ACT_PRONE_IDLE, ACT_DOD_PRONE_AIM_PSCHRECK, false },
  37. { ACT_PRONE_FORWARD, ACT_DOD_PRONEWALK_IDLE_PSCHRECK, false },
  38. { ACT_DOD_STAND_IDLE, ACT_DOD_STAND_IDLE_PSCHRECK, false },
  39. { ACT_DOD_CROUCH_IDLE, ACT_DOD_CROUCH_IDLE_PSCHRECK, false },
  40. { ACT_DOD_CROUCHWALK_IDLE, ACT_DOD_CROUCHWALK_IDLE_PSCHRECK, false },
  41. { ACT_DOD_WALK_IDLE, ACT_DOD_WALK_IDLE_PSCHRECK, false },
  42. { ACT_DOD_RUN_IDLE, ACT_DOD_RUN_IDLE_PSCHRECK, false },
  43. { ACT_SPRINT, ACT_DOD_SPRINT_IDLE_PSCHRECK, false },
  44. // Zoomed Aim
  45. { ACT_DOD_IDLE_ZOOMED, ACT_DOD_STAND_ZOOM_PSCHRECK, false },
  46. { ACT_DOD_CROUCH_ZOOMED, ACT_DOD_CROUCH_ZOOM_PSCHRECK, false },
  47. { ACT_DOD_CROUCHWALK_ZOOMED, ACT_DOD_CROUCHWALK_ZOOM_PSCHRECK, false },
  48. { ACT_DOD_WALK_ZOOMED, ACT_DOD_WALK_ZOOM_PSCHRECK, false },
  49. { ACT_DOD_PRONE_ZOOMED, ACT_DOD_PRONE_ZOOM_PSCHRECK, false },
  50. { ACT_DOD_PRONE_FORWARD_ZOOMED, ACT_DOD_PRONE_ZOOM_FORWARD_PSCHRECK, false },
  51. // Attack ( must be zoomed )
  52. { ACT_RANGE_ATTACK1, ACT_DOD_PRIMARYATTACK_PSCHRECK, false },
  53. { ACT_DOD_PRIMARYATTACK_CROUCH, ACT_DOD_PRIMARYATTACK_PSCHRECK, false },
  54. { ACT_DOD_PRIMARYATTACK_PRONE, ACT_DOD_PRIMARYATTACK_PRONE_PSCHRECK, false },
  55. // Reload ( zoomed or not, prone or not )
  56. { ACT_RELOAD, ACT_DOD_RELOAD_PSCHRECK, false },
  57. { ACT_DOD_RELOAD_CROUCH, ACT_DOD_RELOAD_CROUCH_PSCHRECK, false },
  58. { ACT_DOD_RELOAD_PRONE, ACT_DOD_RELOAD_PRONE_PSCHRECK, false },
  59. { ACT_DOD_RELOAD_DEPLOYED, ACT_DOD_ZOOMLOAD_PSCHRECK, false },
  60. { ACT_DOD_RELOAD_PRONE_DEPLOYED, ACT_DOD_ZOOMLOAD_PRONE_PSCHRECK, false },
  61. // Hand Signals
  62. { ACT_DOD_HS_IDLE, ACT_DOD_HS_IDLE_PSCHRECK, false },
  63. { ACT_DOD_HS_CROUCH, ACT_DOD_HS_CROUCH_PSCHRECK, false },
  64. };
  65. IMPLEMENT_ACTTABLE( CWeaponPschreck );
  66. void CWeaponPschreck::FireRocket( void )
  67. {
  68. #ifndef CLIENT_DLL
  69. CBasePlayer *pPlayer = GetPlayerOwner();
  70. #ifdef DBGFLAG_ASSERT
  71. CPschreckRocket *pRocket =
  72. #endif //DEBUG
  73. CPschreckRocket::Create( pPlayer->Weapon_ShootPosition(), pPlayer->GetAbsAngles(), pPlayer );
  74. Assert( pRocket );
  75. #endif
  76. }