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.

149 lines
3.6 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef C_OBJ_SENTRYGUN_H
  8. #define C_OBJ_SENTRYGUN_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "c_baseobject.h"
  13. #include "ObjectControlPanel.h"
  14. #include "c_tf_projectile_rocket.h"
  15. #include "tempent.h"
  16. #include "c_te_legacytempents.h"
  17. #include "c_tf_player.h"
  18. class C_MuzzleFlashModel;
  19. enum
  20. {
  21. SHIELD_NONE = 0,
  22. SHIELD_NORMAL, // 33% damage taken
  23. SHIELD_MAX, // 10% damage taken, no inactive period
  24. };
  25. //-----------------------------------------------------------------------------
  26. // Purpose: Sentry object
  27. //-----------------------------------------------------------------------------
  28. class C_ObjectSentrygun : public C_BaseObject
  29. {
  30. DECLARE_CLASS( C_ObjectSentrygun, C_BaseObject );
  31. public:
  32. DECLARE_CLIENTCLASS();
  33. C_ObjectSentrygun();
  34. virtual void UpdateOnRemove( void );
  35. void GetAmmoCount( int &iShells, int &iMaxShells, int &iRockets, int & iMaxRockets );
  36. virtual BuildingHudAlert_t GetBuildingAlertLevel( void );
  37. virtual const char *GetHudStatusIcon( void );
  38. int GetKills( void ) { return m_iKills; }
  39. int GetAssists( void ) { return m_iAssists; }
  40. virtual void GetShadowRenderBounds( Vector &mins, Vector &maxs, ShadowType_t shadowType );
  41. virtual CStudioHdr *OnNewModel( void );
  42. virtual void UpdateDamageEffects( BuildingDamageLevel_t damageLevel );
  43. virtual void OnPlacementStateChanged( bool bValidPlacement );
  44. void DebugDamageParticles();
  45. virtual const char* GetStatusName() const;
  46. virtual void OnPreDataChanged( DataUpdateType_t updateType );
  47. virtual void OnDataChanged( DataUpdateType_t updateType );
  48. virtual bool IsUpgrading( void ) const { return ( m_iState == SENTRY_STATE_UPGRADING ); }
  49. void CreateLaserBeam( void );
  50. void DestroyLaserBeam( void );
  51. virtual void SetDormant( bool bDormant );
  52. void CreateShield( void );
  53. void DestroyShield( void );
  54. void CreateSiren( void );
  55. void DestroySiren( void );
  56. virtual void OnGoActive( void );
  57. virtual void OnGoInactive( void );
  58. virtual void OnStartDisabled( void );
  59. virtual void OnEndDisabled( void );
  60. virtual void ClientThink( void );
  61. void CheckNearMiss( Vector vecStart, Vector vecEnd );
  62. // ITargetIDProvidesHint
  63. public:
  64. virtual void DisplayHintTo( C_BasePlayer *pPlayer );
  65. virtual void BuildTransformations( CStudioHdr *hdr, Vector *pos, Quaternion q[], const matrix3x4_t& cameraTransform, int boneMask, CBoneBitList &boneComputed );
  66. private:
  67. virtual void UpgradeLevelChanged();
  68. private:
  69. int m_iState;
  70. int m_iAmmoShells;
  71. int m_iMaxAmmoShells;
  72. int m_iAmmoRockets;
  73. int m_iKills;
  74. int m_iAssists;
  75. int m_iPlacementBodygroup;
  76. int m_iPlacementBodygroup_Mini;
  77. int m_iOldBodygroups;
  78. bool m_bPlayerControlled;
  79. bool m_bOldPlayerControlled;
  80. uint32 m_nShieldLevel;
  81. uint32 m_nOldShieldLevel;
  82. bool m_bOldCarried;
  83. bool m_bPDQSentry;
  84. int m_iOldModelIndex;
  85. bool m_bNearMiss;
  86. bool m_bRecreateShield;
  87. bool m_bRecreateLaserBeam;
  88. float m_flNextNearMissCheck;
  89. C_LocalTempEntity *m_pTempShield;
  90. HPARTICLEFFECT m_hSirenEffect;
  91. HPARTICLEFFECT m_hShieldEffect;
  92. HPARTICLEFFECT m_hLaserBeamEffect;
  93. CNetworkHandle( CBaseEntity, m_hEnemy );
  94. CNetworkHandle( C_TFPlayer, m_hAutoAimTarget );
  95. Vector m_vecLaserBeamPos;
  96. private:
  97. C_ObjectSentrygun( const C_ObjectSentrygun & ); // not defined, not accessible
  98. };
  99. class C_TFProjectile_SentryRocket : public C_TFProjectile_Rocket
  100. {
  101. DECLARE_CLASS( C_TFProjectile_SentryRocket, C_TFProjectile_Rocket );
  102. public:
  103. DECLARE_CLIENTCLASS();
  104. virtual void CreateRocketTrails( void ) {}
  105. };
  106. #endif //C_OBJ_SENTRYGUN_H