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.

128 lines
3.2 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #include "Color.h"
  7. #ifndef COMBINE_MINE_H
  8. #define COMBINE_MINE_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. class CSoundPatch;
  13. //---------------------------------------------------------
  14. //---------------------------------------------------------
  15. #define BOUNCEBOMB_HOOK_RANGE 64
  16. #define BOUNCEBOMB_WARN_RADIUS 245.0 // Must be slightly less than physcannon!
  17. #define BOUNCEBOMB_DETONATE_RADIUS 100.0
  18. #define BOUNCEBOMB_EXPLODE_RADIUS 125.0
  19. #define BOUNCEBOMB_EXPLODE_DAMAGE 150.0
  20. #include "player_pickup.h"
  21. class CBounceBomb : public CBaseAnimating, public CDefaultPlayerPickupVPhysics
  22. {
  23. DECLARE_CLASS( CBounceBomb, CBaseAnimating );
  24. public:
  25. CBounceBomb() { m_pWarnSound = NULL; m_bPlacedByPlayer = false; }
  26. void Precache();
  27. void Spawn();
  28. void OnRestore();
  29. int DrawDebugTextOverlays(void);
  30. void SetMineState( int iState );
  31. int GetMineState() { return m_iMineState; }
  32. bool IsValidLocation();
  33. void Flip( const Vector &vecForce, const AngularImpulse &torque );
  34. void SearchThink();
  35. void BounceThink();
  36. void SettleThink();
  37. void CaptiveThink();
  38. void ExplodeThink();
  39. void ExplodeTouch( CBaseEntity *pOther );
  40. void CavernBounceThink(); ///< an alternative style of bouncing used for the citizen modded bouncers
  41. bool IsAwake() { return m_bAwake; }
  42. void Wake( bool bWake );
  43. float FindNearestNPC();
  44. void SetNearestNPC( CBaseEntity *pNearest ) { m_hNearestNPC.Set( pNearest ); }
  45. int OnTakeDamage( const CTakeDamageInfo &info );
  46. bool IsFriend( CBaseEntity *pEntity );
  47. void UpdateLight( bool bTurnOn, unsigned int r, unsigned int g, unsigned int b, unsigned int a );
  48. bool IsLightOn() { return m_hSprite.Get() != NULL; }
  49. void OnPhysGunPickup( CBasePlayer *pPhysGunUser, PhysGunPickup_t reason = PICKED_UP_BY_CANNON );
  50. void OnPhysGunDrop( CBasePlayer *pPhysGunUser, PhysGunDrop_t reason );
  51. bool ForcePhysgunOpen( CBasePlayer *pPlayer ) { return true; }
  52. bool HasPreferredCarryAnglesForPlayer( CBasePlayer *pPlayer ) { return true; }
  53. virtual QAngle PreferredCarryAngles( void ) { return vec3_angle; }
  54. CBasePlayer *HasPhysicsAttacker( float dt );
  55. bool IsPlayerPlaced() { return m_bPlacedByPlayer; }
  56. bool CreateVPhysics()
  57. {
  58. VPhysicsInitNormal( SOLID_VPHYSICS, 0, false );
  59. return true;
  60. }
  61. void Pickup();
  62. void OpenHooks( bool bSilent = false );
  63. void CloseHooks();
  64. DECLARE_DATADESC();
  65. static string_t gm_iszFloorTurretClassname;
  66. static string_t gm_iszGroundTurretClassname;
  67. private:
  68. float m_flExplosionDelay;
  69. bool m_bAwake;
  70. bool m_bBounce;
  71. EHANDLE m_hNearestNPC;
  72. EHANDLE m_hSprite;
  73. Color m_LastSpriteColor;
  74. float m_flHookPositions;
  75. int m_iHookN;
  76. int m_iHookE;
  77. int m_iHookS;
  78. int m_iAllHooks;
  79. CSoundPatch *m_pWarnSound;
  80. bool m_bLockSilently;
  81. bool m_bFoeNearest;
  82. float m_flIgnoreWorldTime;
  83. bool m_bDisarmed;
  84. bool m_bPlacedByPlayer;
  85. bool m_bHeldByPhysgun;
  86. int m_iFlipAttempts;
  87. int m_iModification;
  88. CHandle<CBasePlayer> m_hPhysicsAttacker;
  89. float m_flLastPhysicsInfluenceTime;
  90. float m_flTimeGrabbed;
  91. IPhysicsConstraint *m_pConstraint;
  92. int m_iMineState;
  93. COutputEvent m_OnPulledUp;
  94. void InputDisarm( inputdata_t &inputdata );
  95. };
  96. #endif // COMBINE_MINE_H