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.

44 lines
1.4 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef PASSTIME_BALLCONTROLLER_HOMING_H
  8. #define PASSTIME_BALLCONTROLLER_HOMING_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "passtime_ballcontroller.h"
  13. //-----------------------------------------------------------------------------
  14. class CPasstimeBallControllerHoming : public CPasstimeBallController
  15. {
  16. public:
  17. CPasstimeBallControllerHoming();
  18. ~CPasstimeBallControllerHoming();
  19. void SetTargetSpeed( float f );
  20. void SetMaxBounces( int i ) { m_iMaxBounces = i; }
  21. void StartHoming( CPasstimeBall *pBall, CTFPlayer *pTarget, bool isCharged );
  22. private:
  23. CHandle<CTFPlayer> m_hTarget;
  24. CHandle<CPasstimeBall> m_hBall;
  25. float m_fTargetSpeed;
  26. bool m_bIsHoming;
  27. float m_fHomingStrength;
  28. int m_iMaxBounces;
  29. void StopHoming();
  30. virtual bool IsActive() const OVERRIDE;
  31. virtual bool Apply( CPasstimeBall *ball ) OVERRIDE;
  32. virtual void OnBallCollision( CPasstimeBall *ball, int index, gamevcollisionevent_t *ev ) OVERRIDE;
  33. virtual void OnBallPickedUp( CPasstimeBall *ball, CTFPlayer *catcher ) OVERRIDE;
  34. virtual void OnBallDamaged( CPasstimeBall *ball ) OVERRIDE;
  35. virtual void OnBallSpawned( CPasstimeBall *ball ) OVERRIDE;
  36. virtual void OnDisabled() OVERRIDE;
  37. };
  38. #endif // PASSTIME_BALLCONTROLLER_HOMING_H