actiondecraftropebelt.c 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. class ActionDeCraftRopeBeltCB : ActionContinuousBaseCB
  2. {
  3. override void CreateActionComponent()
  4. {
  5. m_ActionData.m_ActionComponent = new CAContinuousTime(UATimeSpent.DEFAULT_DECRAFT);
  6. }
  7. //! DEPRECATED
  8. private const float TIME_TO_CRAFT_CLOTHES = 5.0;
  9. }
  10. class ActionDeCraftRopeBelt : ActionContinuousBase
  11. {
  12. void ActionDeCraftRopeBelt()
  13. {
  14. m_CallbackClass = ActionDeCraftRopeBeltCB;
  15. m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_CRAFTING;
  16. m_FullBody = true;
  17. m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH | DayZPlayerConstants.STANCEMASK_ERECT;
  18. m_SpecialtyWeight = UASoftSkillsWeight.ROUGH_HIGH;
  19. m_Text = "#STR_DeCraftRopeBelt";
  20. }
  21. override void CreateConditionComponents()
  22. {
  23. m_ConditionItem = new CCINonRuined();
  24. m_ConditionTarget = new CCTNone();
  25. }
  26. override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
  27. {
  28. return item.GetInventory().AttachmentCount() == 0;
  29. }
  30. override bool HasTarget()
  31. {
  32. return false;
  33. }
  34. override void OnFinishProgressServer(ActionData action_data)
  35. {
  36. EntityAI ropebelt = action_data.m_MainItem;
  37. EntityAI rope = action_data.m_Player.SpawnEntityOnGroundRaycastDispersed("Rope");
  38. action_data.m_MainItem.Delete();
  39. MiscGameplayFunctions.TransferItemProperties(ropebelt, rope);
  40. }
  41. }