actioncollectsampletarget.c 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. class ActionCollectSampleTargetCB : ActionContinuousBaseCB
  2. {
  3. override void CreateActionComponent()
  4. {
  5. m_ActionData.m_ActionComponent = new CAContinuousTime(UATimeSpent.COLLECT_SAMPLE);
  6. }
  7. };
  8. class ActionCollectSampleTarget : ActionContinuousBase
  9. {
  10. void ActionCollectSampleTarget()
  11. {
  12. m_CallbackClass = ActionCollectSampleTargetCB;
  13. m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_SALINEBLOODBAGTARGET;
  14. m_FullBody = true;
  15. m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT | DayZPlayerConstants.STANCEMASK_CROUCH;
  16. m_SpecialtyWeight = UASoftSkillsWeight.PRECISE_MEDIUM;
  17. m_Text = "#collect_persons_sample";
  18. }
  19. override void CreateConditionComponents()
  20. {
  21. m_ConditionItem = new CCINonRuined;
  22. m_ConditionTarget = new CCTMan(UAMaxDistances.DEFAULT);
  23. }
  24. override void OnEndServer( ActionData action_data )
  25. {
  26. super.OnEndServer(action_data);
  27. PlayerBase ntarget = PlayerBase.Cast( action_data.m_Target.GetObject() );
  28. Param1<float> nacdata;
  29. Class.CastTo(nacdata, action_data.m_ActionComponent.GetACData() );
  30. float delta = 0;
  31. if(nacdata)
  32. delta = (nacdata.param1 / UATimeSpent.COLLECT_SAMPLE);
  33. if(delta > 0)
  34. {
  35. ActionCollectBloodTargetLambda lambda = new ActionCollectBloodTargetLambda(action_data.m_MainItem, "BloodSyringe", action_data.m_Player, m_SpecialtyWeight, ntarget, delta);
  36. action_data.m_Player.ServerReplaceItemInHandsWithNew(lambda);
  37. }
  38. }
  39. };