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.

85 lines
2.2 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef PORTAL_PLAYERANIMSTATE_H
  7. #define PORTAL_PLAYERANIMSTATE_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "convar.h"
  12. #include "multiplayer_animstate.h"
  13. #if defined( CLIENT_DLL )
  14. class C_Portal_Player;
  15. #define CPortal_Player C_Portal_Player
  16. #else
  17. class CPortal_Player;
  18. #endif
  19. //enum PlayerAnimEvent_t
  20. //{
  21. // PLAYERANIMEVENT_FIRE_GUN=0,
  22. // PLAYERANIMEVENT_THROW_GRENADE,
  23. // PLAYERANIMEVENT_ROLL_GRENADE,
  24. // PLAYERANIMEVENT_JUMP,
  25. // PLAYERANIMEVENT_RELOAD,
  26. // PLAYERANIMEVENT_SECONDARY_ATTACK,
  27. //
  28. // PLAYERANIMEVENT_HS_NONE,
  29. // PLAYERANIMEVENT_CANCEL_GESTURES, // cancel current gesture
  30. //
  31. // PLAYERANIMEVENT_COUNT
  32. //};
  33. // ------------------------------------------------------------------------------------------------ //
  34. // CPlayerAnimState declaration.
  35. // ------------------------------------------------------------------------------------------------ //
  36. class CPortalPlayerAnimState : public CMultiPlayerAnimState
  37. {
  38. public:
  39. DECLARE_CLASS( CPortalPlayerAnimState, CMultiPlayerAnimState );
  40. CPortalPlayerAnimState();
  41. CPortalPlayerAnimState( CBasePlayer *pPlayer, MultiPlayerMovementData_t &movementData );
  42. ~CPortalPlayerAnimState();
  43. void InitPortal( CPortal_Player *pPlayer );
  44. CPortal_Player *GetPortalPlayer( void ) { return m_pPortalPlayer; }
  45. virtual void ClearAnimationState();
  46. virtual Activity TranslateActivity( Activity actDesired );
  47. void DoAnimationEvent( PlayerAnimEvent_t event, int nData = 0 );
  48. void Teleport( const Vector *pNewOrigin, const QAngle *pNewAngles, CPortal_Player* pPlayer );
  49. bool HandleMoving( Activity &idealActivity );
  50. bool HandleJumping( Activity &idealActivity );
  51. bool HandleDucking( Activity &idealActivity );
  52. private:
  53. CPortal_Player *m_pPortalPlayer;
  54. bool m_bInAirWalk;
  55. float m_flHoldDeployedPoseUntilTime;
  56. };
  57. CPortalPlayerAnimState* CreatePortalPlayerAnimState( CPortal_Player *pPlayer );
  58. // If this is set, then the game code needs to make sure to send player animation events
  59. // to the local player if he's the one being watched.
  60. extern ConVar cl_showanimstate;
  61. #endif // PORTAL_PLAYERANIMSTATE_H