actioncraft.c 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. class ActionCraftCB : ActionContinuousBaseCB
  2. {
  3. override void CreateActionComponent()
  4. {
  5. m_ActionData.m_ActionComponent = new CAContinuousCraft(0); //default value can be set in recipes
  6. }
  7. };
  8. class ActionCraft: ActionContinuousBase
  9. {
  10. bool m_HasStarted;
  11. ItemBase m_Item1;
  12. ItemBase m_Item2;
  13. int m_RecipeID;
  14. void ActionCraft()
  15. {
  16. m_Sound = "craft_universal_0";
  17. m_CallbackClass = ActionCraftCB;
  18. m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_CRAFTING;
  19. m_FullBody = true;
  20. m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH;
  21. m_Text = "#craft";
  22. }
  23. override void CreateConditionComponents()
  24. {
  25. m_ConditionItem = new CCINonRuined;
  26. m_ConditionTarget = new CCTNone;
  27. }
  28. //override void OnStart( ActionData action_data )
  29. //{
  30. /*
  31. if( action_data.m_Player.GetCraftingMeta() )
  32. {
  33. m_Item1 = action_data.m_Player.GetCraftingMeta().GetIngredient1();
  34. m_Item2 = action_data.m_Player.GetCraftingMeta().GetIngredient2();
  35. m_RecipeID = action_data.m_Player.GetCraftingMeta().GetRecipeID();
  36. if(m_Item1 == NULL || m_Item2 == NULL || m_RecipeID < 0) return;
  37. }
  38. */
  39. //m_HasStarted = true;
  40. //}
  41. override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
  42. {
  43. /*if( !m_HasStarted )
  44. {
  45. if ( player.IsCraftingSetUp() )
  46. {
  47. return true;
  48. }
  49. return false;
  50. }
  51. else
  52. {
  53. return true;
  54. }*/
  55. }
  56. override void ApplyModifiers( ActionData action_data )
  57. {
  58. }
  59. void CancelCraft(PlayerBase player)
  60. {
  61. //action_data.m_Player.SetCraftingReady(false);
  62. //action_data.m_Player.DisableCrafting();
  63. }
  64. };