3 float m_PercentageUsed = 0.05;
8 m_Name =
"#STR_CraftTannedLeather0";
9 m_IsInstaRecipe =
false;
10 m_AnimationLength = 1;
13 m_AnywhereInInventory =
true;
15 m_MinDamageIngredient[0] = -1;
16 m_MaxDamageIngredient[0] = 3;
18 m_MinQuantityIngredient[0] = -1;
19 m_MaxQuantityIngredient[0] = -1;
21 m_MinDamageIngredient[1] = -1;
22 m_MaxDamageIngredient[1] = 3;
24 m_MinQuantityIngredient[1] = -1;
25 m_MaxQuantityIngredient[1] = -1;
29 InsertIngredient(0,
"Pelt_Base");
31 m_IngredientAddHealth[0] = 0;
32 m_IngredientSetHealth[0] = -1;
33 m_IngredientAddQuantity[0] = -1;
34 m_IngredientDestroy[0] =
true;
35 m_IngredientUseSoftSkills[0] =
false;
38 InsertIngredient(1,
"GardenLime");
40 m_IngredientAddHealth[1] = 0;
41 m_IngredientSetHealth[1] = -1;
42 m_IngredientAddQuantity[1] = 0;
43 m_IngredientDestroy[1] =
false;
44 m_IngredientUseSoftSkills[1] =
false;
49 AddResult(
"TannedLeather");
51 m_ResultSetFullQuantity[0] =
false;
52 m_ResultSetQuantity[0] = -1;
53 m_ResultSetHealth[0] = -1;
54 m_ResultInheritsHealth[0] = -2;
55 m_ResultInheritsColor[0] = -1;
56 m_ResultToInventory[0] = -2;
57 m_ResultUseSoftSkills[0] =
false;
58 m_ResultReplacesIngredient[0] = -1;
66 ItemBase ingredient2 = ingredients[1];
69 float yieldQuantity = ingredient1.ConfigGetFloat(
"leatherYield");
70 float qtyModifier = (4 - ingredient1.GetHealthLevel(
""))/4;
71 yieldQuantity = yieldQuantity * qtyModifier;
73 float m_NeededQuantity = (ingredient2.GetQuantityMax() * m_PercentageUsed) * yieldQuantity;
74 if( ingredient1.ConfigGetFloat(
"leatherYield") >= 0 && ingredient2.GetQuantity() >= m_NeededQuantity)
88 Debug.Log(
"Craft Tanned Leather",
"recipes");
91 Class.CastTo(result, results.Get(0));
92 ItemBase ingredient1 = ingredients[0];
95 int quantity = ingredient1.ConfigGetFloat(
"leatherYield");
96 float qtyModifier = (4 - ingredient1.GetHealthLevel(
""))/4;
97 quantity = quantity * qtyModifier;
99 result.SetQuantity(quantity);
102 ItemBase gardenLime = ingredients[1];
103 float usedLime = (gardenLime.GetQuantityMax() * m_PercentageUsed) * quantity;
104 gardenLime.SetQuantity(gardenLime.GetQuantity() - usedLime);
106 result.SetHealthMax(
"",
"");
109 if (quantity > result.GetQuantityMax())
112 MiscGameplayFunctions.CreateItemBasePiles(
"TannedLeather", player.GetPosition(), (quantity - 8), result.GetMaxHealth() ,
false);