actioncraftropebelt.c 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. class ActionCraftRopeBeltCB : ActionContinuousBaseCB
  2. {
  3. override void CreateActionComponent()
  4. {
  5. m_ActionData.m_ActionComponent = new CAContinuousTime(3);
  6. }
  7. };
  8. class ActionCraftRopeBelt: ActionContinuousBase
  9. {
  10. void ActionCraftRopeBelt()
  11. {
  12. m_CallbackClass = ActionCraftRopeBeltCB;
  13. m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_CRAFTING;
  14. m_FullBody = true;
  15. m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH;
  16. m_SpecialtyWeight = UASoftSkillsWeight.ROUGH_HIGH;
  17. m_Text = "#STR_CraftRopeBelt";
  18. }
  19. override void CreateConditionComponents()
  20. {
  21. m_ConditionItem = new CCINonRuined;
  22. m_ConditionTarget = new CCTNone;
  23. }
  24. override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
  25. {
  26. return true;
  27. }
  28. override bool HasTarget()
  29. {
  30. return false;
  31. }
  32. override void OnFinishProgressServer( ActionData action_data )
  33. {
  34. EntityAI item_ingredient = action_data.m_MainItem;
  35. EntityAI belt;
  36. belt = action_data.m_Player.SpawnEntityOnGroundPos("RopeBelt", action_data.m_Player.GetPosition());
  37. action_data.m_MainItem.Delete();
  38. MiscGameplayFunctions.TransferItemProperties(item_ingredient, belt);
  39. }
  40. };