DayZ 1.24
Loading...
Searching...
No Matches
CraftRag.c
Go to the documentation of this file.
1class CraftRag extends RecipeBase
2{
3 override void Init()
4 {
5 m_Name = "#STR_CraftRag0";
6 m_IsInstaRecipe = false;//should this recipe be performed instantly without animation
7 m_AnimationLength = 1;//animation length in relative time units
8 m_Specialty = 0.01;// value > 0 for roughness, value < 0 for precision
9
10
11 //conditions
12 m_MinDamageIngredient[0] = -1;//-1 = disable check
13 m_MaxDamageIngredient[0] = 3;//-1 = disable check
14
15 m_MinQuantityIngredient[0] = -1;//-1 = disable check
16 m_MaxQuantityIngredient[0] = -1;//-1 = disable check
17
18 m_MinDamageIngredient[1] = -1;//-1 = disable check
19 m_MaxDamageIngredient[1] = 3;//-1 = disable check
20
21 m_MinQuantityIngredient[1] = -1;//-1 = disable check
22 m_MaxQuantityIngredient[1] = -1;//-1 = disable check
23 //----------------------------------------------------------------------------------------------------------------------
24
25 //INGREDIENTS
26 //ingredient 1
27 InsertIngredient(0, "Sickle"); //you can insert multiple ingredients this way
28 InsertIngredient(0, "Hacksaw");
29 InsertIngredient(0, "HandSaw");
30 InsertIngredient(0, "KitchenKnife");
31 InsertIngredient(0, "SteakKnife");
32 InsertIngredient(0, "HayHook");
33 InsertIngredient(0, "StoneKnife");
34 InsertIngredient(0, "Cleaver");
35 InsertIngredient(0, "CombatKnife");
36 InsertIngredient(0, "HuntingKnife");
37 InsertIngredient(0, "KukriKnife");
38 InsertIngredient(0, "FangeKnife");
39 InsertIngredient(0, "Machete");
40 InsertIngredient(0, "CrudeMachete");
41 InsertIngredient(0, "OrientalMachete");
42 InsertIngredient(0, "Screwdriver");
43 InsertIngredient(0, "Crowbar");
44 InsertIngredient(0, "Pickaxe");
45 InsertIngredient(0, "WoodAxe");
46 InsertIngredient(0, "Hatchet");
47 InsertIngredient(0, "FirefighterAxe");
48 InsertIngredient(0, "Sword");
49 InsertIngredient(0, "AK_Bayonet");
50 InsertIngredient(0, "M9A1_Bayonet");
51 InsertIngredient(0, "Mosin_Bayonet");
52 InsertIngredient(0, "SKS_Bayonet");
53 InsertIngredient(0, "FarmingHoe");
54 InsertIngredient(0, "Shovel");
55 InsertIngredient(0, "FieldShovel");
56 InsertIngredient(0, "BoneKnife");
57
58 m_IngredientAddHealth[0] = -10;// 0 = do nothing
59 m_IngredientSetHealth[0] = -1; // -1 = do nothing
60 m_IngredientAddQuantity[0] = 0;// 0 = do nothing
61 m_IngredientDestroy[0] = false;//true = destroy, false = do nothing
62 m_IngredientUseSoftSkills[0] = true;// set 'true' to allow modification of the values by softskills on this ingredient
63
64 //ingredient 2
65
66 InsertIngredientEx(1, "Inventory_Base", "Rags_craft");//you can insert multiple ingredients this way
67
68 m_IngredientAddHealth[1] = 0;// 0 = do nothing
69 m_IngredientSetHealth[1] = -1; // -1 = do nothing
70 m_IngredientAddQuantity[1] = 0;// 0 = do nothing
71 m_IngredientDestroy[1] = true;// false = do nothing
72 m_IngredientUseSoftSkills[1] = false;// set 'true' to allow modification of the values by softskills on this ingredient
73 //----------------------------------------------------------------------------------------------------------------------
74
75 //result1
76 AddResult("Rag");//add results here
77
78 m_ResultSetFullQuantity[0] = false;//true = set full quantity, false = do nothing
79 m_ResultSetQuantity[0] = -1;//-1 = do nothing
80 m_ResultSetHealth[0] = -1;//-1 = do nothing
81 m_ResultInheritsHealth[0] = 1;// (value) == -1 means do nothing; a (value) >= 0 means this result will inherit health from ingredient number (value);(value) == -2 means this result will inherit health from all ingredients averaged(result_health = combined_health_of_ingredients / number_of_ingredients)
82 m_ResultInheritsColor[0] = -1;// (value) == -1 means do nothing; a (value) >= 0 means this result classname will be a composite of the name provided in AddResult method and config value "color" of ingredient (value)
83 m_ResultToInventory[0] = -2;//(value) == -2 spawn result on the ground;(value) == -1 place anywhere in the players inventory, (value) >= 0 means switch position with ingredient number(value)
84 m_ResultUseSoftSkills[0] = false;// set 'true' to allow modification of the values by softskills on this result
85 m_ResultReplacesIngredient[0] = -1;// value == -1 means do nothing; a value >= 0 means this result will transfer item propertiesvariables, attachments etc.. from an ingredient value
86 }
87
88 override bool CanDo(ItemBase ingredients[], PlayerBase player)//final check for recipe's validity
89 {
91 if (ingredient2.ConfigGetFloat("ragQuantity") > 0 && ingredient2.IsEmpty())
92 return true;
93 else
94 return false;
95 }
96
97 override void Do(ItemBase ingredients[], PlayerBase player, array<ItemBase> results, float specialty_weight) //gets called upon recipe's completion
98 {
100 Class.CastTo(result, results.Get(0));
102 int quantity = ingredient2.ConfigGetFloat("ragQuantity");
103
104 result.SetQuantity(quantity);
105 }
106};
string m_Name
Super root of all classes in Enforce script.
Definition EnScript.c:11
override bool CanDo(ItemBase ingredients[], PlayerBase player)
Definition CraftRag.c:88
override void Do(ItemBase ingredients[], PlayerBase player, array< ItemBase > results, float specialty_weight)
Definition CraftRag.c:97
override void Init()
Definition CraftRag.c:3
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.