Counter Strike : Global Offensive Source Code
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.

103 lines
2.9 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef WEAPON_PORTALBASE_H
  7. #define WEAPON_PORTALBASE_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "basecombatweapon_shared.h"
  12. #include "portal_weapon_parse.h"
  13. #if defined( CLIENT_DLL )
  14. #define CWeaponPortalBase C_WeaponPortalBase
  15. void UTIL_ClipPunchAngleOffset( QAngle &in, const QAngle &punch, const QAngle &clip );
  16. #endif
  17. class CPortal_Player;
  18. // These are the names of the ammo types that go in the CAmmoDefs and that the
  19. // weapon script files reference.
  20. // Given an ammo type (like from a weapon's GetPrimaryAmmoType()), this compares it
  21. // against the ammo name you specify.
  22. // MIKETODO: this should use indexing instead of searching and strcmp()'ing all the time.
  23. bool IsAmmoType( int iAmmoType, const char *pAmmoName );
  24. #include "weapons_portal.h"
  25. class CWeaponPortalBase : public CBaseCombatWeapon
  26. {
  27. public:
  28. DECLARE_CLASS( CWeaponPortalBase, CBaseCombatWeapon );
  29. DECLARE_NETWORKCLASS();
  30. DECLARE_PREDICTABLE();
  31. CWeaponPortalBase();
  32. #ifdef GAME_DLL
  33. DECLARE_DATADESC();
  34. void SendReloadSoundEvent( void );
  35. void Materialize( void );
  36. #endif
  37. // All predicted weapons need to implement and return true
  38. virtual bool IsPredicted() const;
  39. CBasePlayer* GetPlayerOwner() const;
  40. CPortal_Player* GetPortalPlayerOwner() const;
  41. // Get specific Portal weapon ID (ie: WEAPON_PORTALGUN, etc)
  42. virtual int GetWeaponID( void ) const { return WEAPON_NONE; }
  43. void WeaponSound( WeaponSound_t sound_type, float soundtime = 0.0f );
  44. CPortalSWeaponInfo const &GetPortalWpnData() const;
  45. virtual void FireBullets( const FireBulletsInfo_t &info );
  46. virtual int ObjectCaps( void ) { return BaseClass::ObjectCaps() | FCAP_FORCE_TRANSITION; }
  47. public:
  48. #if defined( CLIENT_DLL )
  49. virtual IClientModelRenderable* GetClientModelRenderable();
  50. virtual int DrawModel( int flags, const RenderableInstance_t &instance );
  51. virtual bool ShouldDrawCrosshair( void ) { return true; }
  52. virtual bool ShouldPredict();
  53. virtual void OnDataChanged( DataUpdateType_t type );
  54. virtual void DrawCrosshair();
  55. virtual void DoAnimationEvents( CStudioHdr *pStudio );
  56. virtual void GetRenderBounds( Vector& theMins, Vector& theMaxs );
  57. virtual bool OnFireEvent( C_BaseViewModel *pViewModel, const Vector& origin, const QAngle& angles, int event, const char *options );
  58. #else
  59. virtual void Spawn();
  60. #endif
  61. float m_flPrevAnimTime;
  62. float m_flNextResetCheckTime;
  63. Vector GetOriginalSpawnOrigin( void ) { return m_vOriginalSpawnOrigin; }
  64. QAngle GetOriginalSpawnAngles( void ) { return m_vOriginalSpawnAngles; }
  65. private:
  66. CWeaponPortalBase( const CWeaponPortalBase & );
  67. Vector m_vOriginalSpawnOrigin;
  68. QAngle m_vOriginalSpawnAngles;
  69. };
  70. #endif // WEAPON_PORTALBASE_H