actionuserangefinder.c 885 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. class ActionUseRangefinderCB : ActionContinuousBaseCB
  2. {
  3. override void CreateActionComponent()
  4. {
  5. m_ActionData.m_ActionComponent = new CAContinuousTime( 1.0 );
  6. }
  7. };
  8. //!DEPRECATED
  9. class ActionUseRangefinder : ActionContinuousBase
  10. {
  11. void ActionUseRangefinder()
  12. {
  13. m_CallbackClass = ActionUseRangefinderCB;
  14. m_CommandUID = DayZPlayerConstants.CMD_GESTUREFB_LOOKOPTICS;
  15. m_SpecialtyWeight = UASoftSkillsWeight.PRECISE_LOW;
  16. m_Text = "#use_range_finder";
  17. }
  18. override void CreateConditionComponents()
  19. {
  20. m_ConditionItem = new CCINonRuined;
  21. m_ConditionTarget = new CCTNone;
  22. }
  23. override bool IsFullBody(PlayerBase player)
  24. {
  25. return true;
  26. }
  27. override bool HasTarget()
  28. {
  29. return false;
  30. }
  31. override bool ActionCondition ( PlayerBase player, ActionTarget target, ItemBase item )
  32. {
  33. return item.GetCompEM().CanWork() && Rangefinder.Cast( item ).IsInOptics();
  34. }
  35. }