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.

60 lines
1.8 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Play VCD on taunt prop
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #include "cbase.h"
  8. #include "c_basecombatcharacter.h"
  9. #include "choreoevent.h"
  10. #include "c_sceneentity.h"
  11. #include "c_tf_taunt_prop.h"
  12. // memdbgon must be the last include file in a .cpp file!!!
  13. #include "tier0/memdbgon.h"
  14. IMPLEMENT_CLIENTCLASS_DT( C_TFTauntProp, DT_TFTauntProp, CTFTauntProp )
  15. END_RECV_TABLE()
  16. //-----------------------------------------------------------------------------
  17. // Purpose:
  18. //-----------------------------------------------------------------------------
  19. bool C_TFTauntProp::StartSceneEvent( CSceneEventInfo *info, CChoreoScene *scene, CChoreoEvent *event, CChoreoActor *actor, CBaseEntity *pTarget )
  20. {
  21. switch ( event->GetType() )
  22. {
  23. case CChoreoEvent::SEQUENCE:
  24. case CChoreoEvent::GESTURE:
  25. {
  26. // Get the (gesture) sequence.
  27. info->m_nSequence = LookupSequence( event->GetParameters() );
  28. if ( info->m_nSequence < 0 )
  29. return false;
  30. SetSequence( info->m_nSequence );
  31. SetPlaybackRate( 1.0f );
  32. SetCycle( scene->GetTime() / scene->GetDuration() );
  33. }
  34. return true;
  35. default:
  36. return BaseClass::StartSceneEvent( info, scene, event, actor, pTarget );
  37. }
  38. }
  39. //-----------------------------------------------------------------------------
  40. // Purpose:
  41. //-----------------------------------------------------------------------------
  42. bool C_TFTauntProp::ClearSceneEvent( CSceneEventInfo *info, bool fastKill, bool canceled )
  43. {
  44. switch ( info->m_pEvent->GetType() )
  45. {
  46. case CChoreoEvent::SEQUENCE:
  47. case CChoreoEvent::GESTURE:
  48. //return StopGestureSceneEvent( info, fastKill, canceled );
  49. default:
  50. return BaseClass::ClearSceneEvent( info, fastKill, canceled );
  51. }
  52. }