DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
CraftMortarMix.c
См. документацию.
1class CraftMortarMix extends RecipeBase
2{
3 private const float REQUIRED_QUANTITY = 1000.0;
4
5 override void Init()
6 {
7
8 m_Name = "#STR_CraftMortarMix0";
9 m_IsInstaRecipe = false;//should this recipe be performed instantly without animation
11 m_Specialty = 0.02;// value > 0 for roughness, value < 0 for precision
12
13 //conditions
14 m_MinDamageIngredient[0] = -1;//-1 = disable check
15 m_MaxDamageIngredient[0] = 3;//-1 = disable check
16
17 m_MinQuantityIngredient[0] = 1;//-1 = disable check
18 m_MaxQuantityIngredient[0] = -1;//-1 = disable check
19
20 m_MinDamageIngredient[1] = -1;//-1 = disable check
21 m_MaxDamageIngredient[1] = 3;//-1 = disable check
22
23 m_MinQuantityIngredient[1] = -1;//-1 = disable check
24 m_MaxQuantityIngredient[1] = -1;//-1 = disable check
25 //----------------------------------------------------------------------------------------------------------------------
26
27 //INGREDIENTS
28 //ingredient 1
29 InsertIngredient(0,"MortarMix",DayZPlayerConstants.CMD_ACTIONFB_MIX_MORTAR, true);//you can insert multiple ingredients this way
30
31 m_IngredientAddHealth[0] = 0;// 0 = do nothing
32 m_IngredientSetHealth[0] = -1; // -1 = do nothing
33 m_IngredientAddQuantity[0] = 0;// 0 = do nothing
34 m_IngredientDestroy[0] = true;//true = destroy, false = do nothing
35 m_IngredientUseSoftSkills[0] = false;// set 'true' to allow modification of the values by softskills on this ingredient
36
37 //ingredient 2
38 InsertIngredient(1,"Pot", DayZPlayerConstants.CMD_ACTIONFB_MIX_MORTAR);//you can insert multiple ingredients this way
39 InsertIngredient(1,"CanisterGasoline", DayZPlayerConstants.CMD_ACTIONFB_MIX_MORTAR);//you can insert multiple ingredients this way
40 InsertIngredient(1,"Canteen", DayZPlayerConstants.CMD_ACTIONFB_MIX_MORTAR);//you can insert multiple ingredients this way
41 InsertIngredient(1,"WaterBottle", DayZPlayerConstants.CMD_ACTIONFB_MIX_MORTAR);//you can insert multiple ingredients this way
42 InsertIngredient(1,"FilteringBottle", DayZPlayerConstants.CMD_ACTIONFB_MIX_MORTAR);//you can insert multiple ingredients this way
43 InsertIngredient(1,"GlassBottle", DayZPlayerConstants.CMD_ACTIONFB_MIX_MORTAR);//you can insert multiple ingredients this way
44 InsertIngredient(1,"WineBottle", DayZPlayerConstants.CMD_ACTIONFB_MIX_MORTAR);//you can insert multiple ingredients this way
45 InsertIngredient(1,"WaterPouch_ColorBase", DayZPlayerConstants.CMD_ACTIONFB_MIX_MORTAR);//you can insert multiple ingredients this way
46 InsertIngredient(1,"Barrel_ColorBase", DayZPlayerConstants.CMD_ACTIONFB_MIX_MORTAR);//you can insert multiple ingredients this way
47 InsertIngredient(1,"AyranBottle", DayZPlayerConstants.CMD_ACTIONFB_MIX_MORTAR);//you can insert multiple ingredients this way
48
49
50 m_IngredientAddHealth[1] = 0;// 0 = do nothing
51 m_IngredientSetHealth[1] = -1; // -1 = do nothing
52 m_IngredientAddQuantity[1] = 0;// 0 = do nothing
53 m_IngredientDestroy[1] = false;// false = do nothing
54 m_IngredientUseSoftSkills[1] = false;// set 'true' to allow modification of the values by softskills on this ingredient
55 //----------------------------------------------------------------------------------------------------------------------
56
57 //result1
58 AddResult("MortarMix_Opened");//add results here
59
60 m_ResultSetFullQuantity[0] = false;//true = set full quantity, false = do nothing
61 m_ResultSetQuantity[0] = -1;//-1 = do nothing
62 m_ResultSetHealth[0] = -1;//-1 = do nothing
63 m_ResultInheritsHealth[0] = 0;// (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)
64 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)
65 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)
66 m_ResultUseSoftSkills[0] = false;// set 'true' to allow modification of the values by softskills on this result
67 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
68 }
69
70 override bool CanDo(ItemBase ingredients[], PlayerBase player)
71 {
72 ItemBase container;
73
74 if (!ItemBase.CastTo(container, ingredients[1]))
75 return false;
76
77 // Must not be frozen
78 if (container.GetIsFrozen())
79 return false;
80
81 // Must contain water (pure water type)
82 int liquidType = container.GetLiquidType();
83 if ((liquidType & LIQUID_WATER) == 0)
84 return false;
85
86 // Require at least 1 liter (1000 units)
87 float qty = container.GetQuantity();
88 if (qty < REQUIRED_QUANTITY)
89 return false;
90
91 return true;
92 }
93
94 override void Do(ItemBase ingredients[], PlayerBase player, array<ItemBase> results, float specialty_weight)
95 {
96 ItemBase container = ingredients[1];
97
98 // Consume exactly 1 liter (1000 units)
99 float required = REQUIRED_QUANTITY;
100 float current = container.GetQuantity();
101
102 if (current >= required)
103 {
104 container.AddQuantity(-required);
105 }
106 else
107 {
108 // Fallback: if somehow less than required got through, consume what remains
109 container.SetQuantity(0);
110 }
111 }
112};
string m_Name
Определения 3_Game/DayZ/InventoryItemType.c:34
int m_ResultReplacesIngredient[MAXIMUM_RESULTS]
Определения RecipeBase.c:62
int m_ResultToInventory[MAXIMUM_RESULTS]
Определения RecipeBase.c:59
bool m_IngredientUseSoftSkills[MAX_NUMBER_OF_INGREDIENTS]
Определения RecipeBase.c:48
float m_IngredientAddHealth[MAX_NUMBER_OF_INGREDIENTS]
Определения RecipeBase.c:49
bool m_IsInstaRecipe
Определения RecipeBase.c:40
float m_IngredientSetHealth[MAX_NUMBER_OF_INGREDIENTS]
Определения RecipeBase.c:51
int m_ResultInheritsHealth[MAXIMUM_RESULTS]
Определения RecipeBase.c:60
float m_Specialty
Определения RecipeBase.c:39
void AddResult(string item)
Определения RecipeBase.c:198
int m_ResultInheritsColor[MAXIMUM_RESULTS]
Определения RecipeBase.c:61
float m_MinDamageIngredient[MAX_NUMBER_OF_INGREDIENTS]
Определения RecipeBase.c:45
float m_MaxQuantityIngredient[MAX_NUMBER_OF_INGREDIENTS]
Определения RecipeBase.c:44
float m_ResultSetQuantity[MAXIMUM_RESULTS]
Определения RecipeBase.c:56
bool m_ResultSetFullQuantity[MAXIMUM_RESULTS]
Определения RecipeBase.c:55
void InsertIngredient(int index, string ingredient, DayZPlayerConstants uid=BASE_CRAFT_ANIMATION_ID, bool showItem=false)
Определения RecipeBase.c:159
float m_ResultSetHealth[MAXIMUM_RESULTS]
Определения RecipeBase.c:57
float m_AnimationLength
Определения RecipeBase.c:38
float m_MaxDamageIngredient[MAX_NUMBER_OF_INGREDIENTS]
Определения RecipeBase.c:46
float m_IngredientAddQuantity[MAX_NUMBER_OF_INGREDIENTS]
Определения RecipeBase.c:50
float m_MinQuantityIngredient[MAX_NUMBER_OF_INGREDIENTS]
Определения RecipeBase.c:43
bool m_IngredientDestroy[MAX_NUMBER_OF_INGREDIENTS]
Определения RecipeBase.c:52
bool m_ResultUseSoftSkills[MAXIMUM_RESULTS]
Определения RecipeBase.c:63
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
Определения PileOfBricks.c:64
Определения PlayerBaseClient.c:2
override bool CanDo(ItemBase ingredients[], PlayerBase player)
Определения CraftMortarMix.c:70
override void Do(ItemBase ingredients[], PlayerBase player, array< ItemBase > results, float specialty_weight)
Определения CraftMortarMix.c:94
override void Init()
Определения CraftMortarMix.c:5
const float REQUIRED_QUANTITY
Определения CraftMortarMix.c:3
Определения AttachHolster.c:2
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
DayZPlayerConstants
defined in C++
Определения dayzplayer.c:602
const int LIQUID_WATER
Определения 3_Game/DayZ/constants.c:578