actioncollectsampleself.c 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. class ActionCollectSampleSelfCB : ActionContinuousBaseCB
  2. {
  3. override void CreateActionComponent()
  4. {
  5. m_ActionData.m_ActionComponent = new CAContinuousTime(UATimeSpent.COLLECT_SAMPLE);
  6. }
  7. };
  8. class ActionCollectSampleSelf: ActionContinuousBase
  9. {
  10. void ActionCollectSampleSelf()
  11. {
  12. m_CallbackClass = ActionCollectSampleSelfCB;
  13. m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_COLLECTBLOODSELF;
  14. m_FullBody = true;
  15. m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT | DayZPlayerConstants.STANCEMASK_CROUCH;
  16. m_SpecialtyWeight = UASoftSkillsWeight.PRECISE_MEDIUM;
  17. m_Text = "#collect_sample";
  18. }
  19. override void CreateConditionComponents()
  20. {
  21. m_ConditionItem = new CCINonRuined;
  22. m_ConditionTarget = new CCTSelf;
  23. }
  24. override bool HasTarget()
  25. {
  26. return false;
  27. }
  28. override void OnEndServer( ActionData action_data )
  29. {
  30. super.OnEndServer(action_data);
  31. Param1<float> nacdata;
  32. Class.CastTo(nacdata, action_data.m_ActionComponent.GetACData() );
  33. float delta = 0;
  34. if(nacdata)
  35. delta = (nacdata.param1 / UATimeSpent.COLLECT_SAMPLE);
  36. if(delta > 0)
  37. {
  38. ActionCollectBloodTargetLambda lambda = new ActionCollectBloodTargetLambda(action_data.m_MainItem, "BloodSyringe", action_data.m_Player, m_SpecialtyWeight, action_data.m_Player, delta);
  39. action_data.m_Player.ServerReplaceItemInHandsWithNew(lambda);
  40. }
  41. }
  42. };