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.

91 lines
3.0 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #include "cbase.h"
  7. #include "weapon_riflegrenade.h"
  8. #if defined( CLIENT_DLL )
  9. #include "c_dod_player.h"
  10. #define CWeaponRifleGrenadeGER C_WeaponRifleGrenadeGER
  11. #else
  12. #include "dod_riflegrenade_ger.h"
  13. #include "dod_player.h"
  14. #endif
  15. class CWeaponRifleGrenadeGER : public CWeaponBaseRifleGrenade
  16. {
  17. public:
  18. DECLARE_CLASS( CWeaponRifleGrenadeGER, CWeaponBaseRifleGrenade );
  19. DECLARE_NETWORKCLASS();
  20. DECLARE_PREDICTABLE();
  21. DECLARE_ACTTABLE();
  22. CWeaponRifleGrenadeGER() {}
  23. virtual DODWeaponID GetWeaponID( void ) const { return WEAPON_RIFLEGREN_GER; }
  24. #ifndef CLIENT_DLL
  25. virtual void EmitGrenade( Vector vecSrc, QAngle vecAngles, Vector vecVel, AngularImpulse angImpulse, CBasePlayer *pPlayer, float flLifeTime = GRENADE_FUSE_LENGTH )
  26. {
  27. CDODRifleGrenadeGER::Create( vecSrc, vecAngles, vecVel, angImpulse, pPlayer, flLifeTime, GetWeaponID() );
  28. }
  29. #endif
  30. virtual const char *GetCompanionWeaponName( void )
  31. {
  32. return "weapon_k98";
  33. }
  34. private:
  35. CWeaponRifleGrenadeGER( const CWeaponRifleGrenadeGER & );
  36. };
  37. IMPLEMENT_NETWORKCLASS_ALIASED( WeaponRifleGrenadeGER, DT_WeaponRifleGrenadeGER )
  38. BEGIN_NETWORK_TABLE( CWeaponRifleGrenadeGER, DT_WeaponRifleGrenadeGER )
  39. END_NETWORK_TABLE()
  40. BEGIN_PREDICTION_DATA( CWeaponRifleGrenadeGER )
  41. END_PREDICTION_DATA()
  42. LINK_ENTITY_TO_CLASS( weapon_riflegren_ger, CWeaponRifleGrenadeGER );
  43. PRECACHE_WEAPON_REGISTER( weapon_riflegren_ger );
  44. acttable_t CWeaponRifleGrenadeGER::m_acttable[] =
  45. {
  46. { ACT_DOD_STAND_AIM, ACT_DOD_STAND_AIM_RIFLE, false },
  47. { ACT_DOD_CROUCH_AIM, ACT_DOD_CROUCH_AIM_RIFLE, false },
  48. { ACT_DOD_CROUCHWALK_AIM, ACT_DOD_CROUCHWALK_AIM_RIFLE, false },
  49. { ACT_DOD_WALK_AIM, ACT_DOD_WALK_AIM_RIFLE, false },
  50. { ACT_DOD_RUN_AIM, ACT_DOD_RUN_AIM_RIFLE, false },
  51. { ACT_PRONE_IDLE, ACT_DOD_PRONE_AIM_RIFLE, false },
  52. { ACT_PRONE_FORWARD, ACT_DOD_PRONEWALK_IDLE_RIFLE, false },
  53. { ACT_DOD_STAND_IDLE, ACT_DOD_STAND_IDLE_RIFLE, false },
  54. { ACT_DOD_CROUCH_IDLE, ACT_DOD_CROUCH_IDLE_RIFLE, false },
  55. { ACT_DOD_CROUCHWALK_IDLE, ACT_DOD_CROUCHWALK_IDLE_RIFLE, false },
  56. { ACT_DOD_WALK_IDLE, ACT_DOD_WALK_IDLE_RIFLE, false },
  57. { ACT_DOD_RUN_IDLE, ACT_DOD_RUN_IDLE_RIFLE, false },
  58. { ACT_SPRINT, ACT_DOD_SPRINT_IDLE_RIFLE, false },
  59. // Attack ( prone? deployed? )
  60. { ACT_RANGE_ATTACK1, ACT_DOD_PRIMARYATTACK_RIFLE, false },
  61. { ACT_DOD_PRIMARYATTACK_CROUCH, ACT_DOD_PRIMARYATTACK_RIFLE, false },
  62. { ACT_DOD_PRIMARYATTACK_PRONE, ACT_DOD_PRIMARYATTACK_PRONE_RIFLE, false },
  63. { ACT_RELOAD, ACT_DOD_RELOAD_RIFLEGRENADE, false },
  64. { ACT_DOD_RELOAD_CROUCH, ACT_DOD_RELOAD_CROUCH_RIFLEGRENADE, false },
  65. { ACT_DOD_RELOAD_PRONE, ACT_DOD_RELOAD_PRONE_RIFLEGRENADE, false },
  66. // Hand Signals
  67. { ACT_DOD_HS_IDLE, ACT_DOD_HS_IDLE_K98, false },
  68. { ACT_DOD_HS_CROUCH, ACT_DOD_HS_CROUCH_K98, false },
  69. };
  70. IMPLEMENT_ACTTABLE( CWeaponRifleGrenadeGER );