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.

42 lines
832 B

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. // tf_bot_body.cpp
  3. // Team Fortress NextBot body interface
  4. // Michael Booth, May 2010
  5. #include "cbase.h"
  6. #include "tf_bot.h"
  7. #include "tf_bot_body.h"
  8. //
  9. // Return how often we should sample our target's position and
  10. // velocity to update our aim tracking, to allow realistic slop in tracking
  11. //
  12. float CTFBotBody::GetHeadAimTrackingInterval( void ) const
  13. {
  14. CTFBot *me = (CTFBot *)GetBot();
  15. // don't let Spies in MvM mode aim too precisely
  16. if ( TFGameRules()->IsMannVsMachineMode() && me->IsPlayerClass( TF_CLASS_SPY ) )
  17. {
  18. return 0.25f;
  19. }
  20. switch( me->GetDifficulty() )
  21. {
  22. case CTFBot::EXPERT:
  23. return 0.05f;
  24. case CTFBot::HARD:
  25. return 0.1f;
  26. case CTFBot::NORMAL:
  27. return 0.25f;
  28. case CTFBot::EASY:
  29. return 1.0f;
  30. }
  31. return 0.0f;
  32. }