DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
PluginRecipesManager.c
См. документацию.
7
8const float ACCEPTABLE_DISTANCE = 5;
9
10const int SANITY_CHECK_ACCEPTABLE_RESULT = ERecipeSanityCheck.NOT_OWNED_BY_ANOTHER_LIVE_PLAYER | ERecipeSanityCheck.CLOSE_ENOUGH;
11
13{
16
17
20 const int MAX_CONCURENT_RECIPES = 128;
21 const int MAX_INGREDIENTS = 5;
22
25
30
32
36
38
41
44
46
48 {
49 return 2048;
50 }
51
53 {
54
57
58 myTimer1 = new Timer();
59 }
60
62 {
63 }
64
65
67 {
69 }
70
71 void SetEnableDebugCrafting(bool enable)
72 {
73 m_EnableDebugCrafting = enable;
74 }
75
76 string GetRecipeName(int recipe_id)
77 {
78 if (m_RecipeList[recipe_id])
79 return m_RecipeList[recipe_id].GetName();
80
81 return "";
82 }
83
84 string GetRecipeClassName(int recipe_id)
85 {
86 if (m_RecipeList[recipe_id])
87 return m_RecipeList[recipe_id].ClassName();
88
89 return "";
90 }
91
92 //will fill the map 'ids' with valid recipes for the 'item1' and 'item2' items, where the key is the recipe ID, and the value is the recipe name
93 int GetValidRecipes(ItemBase item1, ItemBase item2, array<int> ids, PlayerBase player)
94 {
95 if ( item1 == NULL || item2 == NULL )
96 {
97 if (ids) ids.Clear();
98 return 0;
99 }
100
101 if ( ( item1.GetInventory().IsAttachment() && item1.GetHierarchyParent().DisassembleOnLastDetach() ) || ( item2.GetInventory().IsAttachment() && item2.GetHierarchyParent().DisassembleOnLastDetach() ) )
102 {
103 if (ids) ids.Clear();
104 return 0;
105 }
106 m_Ingredients[0] = item1;
107 m_Ingredients[1] = item2;
108
109 return GetValidRecipesProper(2,m_Ingredients, ids, player);
110 }
111
112 int GetValidRecipesProper(int num_of_items, ItemBase items[], array<int> ids, PlayerBase player)
113 {
114 if (ids) ids.Clear();
115 GetRecipeIntersection(num_of_items,items);
116 int numOfRecipes = SortIngredients(num_of_items,items,m_ResolvedRecipes);
117 //will return number of cached recipes for the 2 items being considered,
118 //and save their indexes in m_ResolvedRecipes, please note the m_ResolvedRecipes is a static array,
119 //and does not clear up with each query, so the number of recipes returned is critical to make sure we don't accidentally
120 //mix in some other indexes from previous queries(and obviously loop only as far as we have to)
121 //this also saves the ingredients in the correct assignment as ingredient 1/2 into m_ingredient1/m_ingredient2 arrays, these 3 arrays
122 //therefore provide you with information per each index with: recipeid,ingredient1,ingredient2
123 if ( numOfRecipes == 0 ) return 0;
124 int found = 0;
125 RecipeBase p_recipe = NULL;
126 for (int i = 0; i < numOfRecipes; i++)
127 {
128 p_recipe = m_RecipeList[m_ResolvedRecipes[i]];
129
130 if ( p_recipe.CheckRecipe(m_ingredient1[i],m_ingredient2[i], player) == true )
131 {
132 if (ids) ids.Insert( p_recipe.GetID() );
133 found++;
134 }
135 }
136 return found;
137 }
138
139
140 float GetRecipeLengthInSecs(int recipe_id)
141 {
142 if ( m_RecipeList[recipe_id] ) return m_RecipeList[recipe_id].GetLengthInSecs();
143 return 0;
144 }
145
146 float GetRecipeSpecialty(int recipe_id)
147 {
148 if ( m_RecipeList[recipe_id] ) return m_RecipeList[recipe_id].GetSpecialty();
149 return 0;
150 }
151
152 bool GetIsInstaRecipe(int recipe_id)
153 {
154 if ( m_RecipeList[recipe_id] ) return m_RecipeList[recipe_id].IsInstaRecipe();
155 else return false;
156 }
157
158 bool GetIsRepeatable(int recipe_id)
159 {
160 if ( m_RecipeList[recipe_id] ) return m_RecipeList[recipe_id].IsRepeatable();
161 return false;
162 }
163
164 override void OnInit()
165 {
166 super.OnInit();
167 //ReadCacheFromFile(PATH_CACHE_FILE);//read the cache from a file
168 //GenerateHumanReadableRecipeList();
169 }
170
171
173 {
174 Debug.Log("CallbackGenerateCache","recipes");
176 //SaveCacheToFile(PATH_CACHE_FILE);//generate the cache and save it to a file
177 //ReadCacheFromFile(PATH_CACHE_FILE);
178 }
179
180 protected void GenerateRecipeCache()
181 {
182 g_Game.ProfilerStart("m_RecipeCache");
183
184 //m_CacheBasesMap.Clear();
185 m_CachedItems.Clear();
186 PluginRecipesManager.m_RecipeCache.Clear();
187
188 TStringArray all_config_paths = new TStringArray;
189
190 all_config_paths.Insert(CFG_VEHICLESPATH);
191 all_config_paths.Insert(CFG_WEAPONSPATH);
192 all_config_paths.Insert(CFG_MAGAZINESPATH);
193 //Debug.Log("Got here 0","caching");
194 string config_path;
195 string child_name;
196 int scope;
197 TStringArray full_path = new TStringArray;
198 WalkRecipes();
199 for (int i = 0; i < all_config_paths.Count(); i++)
200 {
201 config_path = all_config_paths.Get(i);
202 int children_count = g_Game.ConfigGetChildrenCount(config_path);
203
204 for (int x = 0; x < children_count; x++)
205 {
206 g_Game.ConfigGetChildName(config_path, x, child_name);
207 scope = g_Game.ConfigGetInt( config_path + " " + child_name + " scope" );
208
209 if ( scope == 2 )
210 {
211 g_Game.ConfigGetFullPath(config_path +" "+ child_name,/*out*/ full_path);
212 MatchItems(full_path);
213 }
214 }
215 }
216 g_Game.ProfilerStop("m_RecipeCache");
217 }
218
220 {
221 //Print("------------- WalkRecipes --------------");
222 for (int c = 0; c < m_RecipeList.Count(); c++)
223 {
224 RecipeBase recipe = m_RecipeList.Get(c);
225 if (recipe)
226 {
227 //Print(recipe.ClassName());
228 int recipe_id = recipe.GetID();
229 for (int i = 0; i < MAX_NUMBER_OF_INGREDIENTS; i++)
230 {
231 array<string> list = recipe.m_Ingredients[i];
232
233 for (int x = 0; x < list.Count(); x++)
234 {
235 string ingredient = list.Get(x);
236 int mask = Math.Pow(2,i);
237 CacheObject co = m_RecipeCache.Get(ingredient);
238
239 if (!co)
240 {
241 co = new CacheObject;
242 m_RecipeCache.Insert(ingredient,co);
243 }
244 co.AddRecipe(recipe_id, mask);
245 }
246 }
247 }
248 }
249 }
250
251
252 // moved outside method to speed things up
261
262 //this will take the item class name and resolve it against all processed recipes
263 protected void MatchItems(TStringArray full_path)
264 {
265 m_ItemName = full_path.Get(0);
267 //Print(m_ItemName);
268 if ( !m_CoItem )
269 {
270 m_CoItem = new CacheObject;
272 }
273 for (int i = 1; i < full_path.Count(); i++)
274 {
275 m_BaseName = full_path.Get(i);
277 if ( m_CoBase )//resolve new base classes
278 {
279 m_RcpsArray = m_RecipeCache.Get(m_BaseName).GetRecipes();
280
281 for ( int x = 0; x < m_RcpsArray.Count(); x++ )//base recipes
282 {
283 m_RecipeID = m_RcpsArray.Get(x);
284
285 //item_mask = m_CoItem.GetMaskByRecipeID(m_RecipeID);
286 m_BaseMask = m_CoBase.GetMaskByRecipeID(m_RecipeID);
287
288 m_CoItem.AddRecipe(m_RecipeID,m_BaseMask);
289 }
290 }
291 }
292
293
294 }
295
296 bool IsRecipePossibleToPerform(int id, ItemBase itemA, ItemBase itemB, PlayerBase player)
297 {
298 if ( !itemA || !itemB )
299 {
300 return false;
301 }
302
303 m_Ingredients[0] = itemA;
304 m_Ingredients[1] = itemB;
305
307
308 bool result = CheckRecipe(id, m_sortedIngredients[0], m_sortedIngredients[1], player);
309 if (result)
310 {
311 result = RecipeSanityCheck(2, m_sortedIngredients, player);
312 }
313
314 return result;
315 }
316
317 void PerformRecipeServer(int id, ItemBase item_a,ItemBase item_b ,PlayerBase player)
318 {
319 m_Ingredients[0] = item_a;
320 m_Ingredients[1] = item_b;
321
322 if ( !item_a || !item_b )
323 {
324 Error("PerformRecipeServer - one of the items null !!");
325 return;
326 }
327
329
330 bool is_recipe_valid = CheckRecipe(id,m_sortedIngredients[0],m_sortedIngredients[1],player);
331 bool passed_sanity_check = RecipeSanityCheck(2,m_sortedIngredients,player);
332
333 if ( !is_recipe_valid )
334 {
335 Error("PerformRecipeServer - recipe not valid !!");
336 return;
337 }
338 if ( !passed_sanity_check )
339 {
340 Error("PerformRecipeServer - recipe failed to pass sanity check !!");
341 return;
342 }
343 RecipeBase ptrRecipe = m_RecipeList[id];
344 ptrRecipe.PerformRecipe(m_sortedIngredients[0],m_sortedIngredients[1],player);
345 //player.RequestCraftingDisable();
346
347 }
348
350 {
351 set<string> testset = new set<string>;
352
353 FileHandle file = OpenFile("$profile:RecipeDump.txt", FileMode.WRITE);
354 if ( file == 0 )
355 {
356 //error message
357 PrintString("failed to open file RecipeDump");
358 return;
359 }
360 array<int> recipes = new array<int>;
361 for (int i = 0; i < PluginRecipesManager.m_RecipeCache.Count(); i++)
362 {
363 string key = PluginRecipesManager.m_RecipeCache.GetKey(i);
364 CacheObject value = PluginRecipesManager.m_RecipeCache.GetElement(i);
365
366 string line = key;
367 recipes.Clear();
368 recipes.InsertAll( value.GetRecipes() );
369
370 //PrintString("Item: " + key);
371
372 for (int x = 0; x < recipes.Count(); x++)
373 {
374 int recipe_id = recipes.Get(x);
375 string recipe_name = Widget.TranslateString(GetRecipeName(recipe_id));
376 testset.Insert(recipe_name);
377
378 line += "," +recipe_name;
379 }
380 FPrintln(file, line);
381
382 }
383
384 // generate localized list of recipe names
385 foreach ( string st : testset)
386 {
387 FPrintln(file, st);
388 }
389
390 CloseFile(file);
391 }
392
394 {
395 CacheObject co = PluginRecipesManager.m_RecipeCache.Get(itemName);
396 array<int> ids = co.GetRecipes();
397
398 array<RecipeBase> recipes = new array<RecipeBase>();
399 foreach (int recipeID : ids)
400 {
401 recipes.Insert(m_RecipeList[recipeID]);
402 }
403
404 return recipes;
405 }
406
407 protected bool RecipeSanityCheck(int num_of_ingredients, InventoryItemBase items[], PlayerBase player)
408 {
409 int check_results[MAX_INGREDIENTS];
410
411 for (int i = 0; i < num_of_ingredients;i++)
412 {
413 ItemBase item = items[i];
414 Man item_owner_player = item.GetHierarchyRootPlayer();
415 vector item_pos = item.GetPosition();
416 vector player_pos = player.GetPosition();
417
418 if (item_owner_player == player)
419 {
420 check_results[i] = check_results[i] | ERecipeSanityCheck.IS_IN_PLAYER_INVENTORY;
421 }
422
423 if ( item_owner_player == NULL || item_owner_player == player || !item_owner_player.IsAlive() )
424 {
425 check_results[i] = check_results[i] | ERecipeSanityCheck.NOT_OWNED_BY_ANOTHER_LIVE_PLAYER;
426 }
427
428 if ( vector.Distance(item_pos, player_pos ) < ACCEPTABLE_DISTANCE )
429 {
430 check_results[i] = check_results[i] | ERecipeSanityCheck.CLOSE_ENOUGH;
431 }
432 }
433 for (i = 0; i < num_of_ingredients;i++)
434 {
436 {
437 return false;
438 }
439 }
440 return true;
441 }
442
443 override protected void RegisterRecipe(RecipeBase recipe)
444 {
445
447 {
448 Error("Exceeded max. number of recipes, max set to: "+MAX_NUMBER_OF_RECIPES.ToString());
449 }
450
451 m_RegRecipeIndex = m_RecipeList.Insert(recipe);
452 recipe.SetID(m_RegRecipeIndex);
453 m_RecipeNamesList.Insert(recipe.ClassName(), m_RegRecipeIndex);
454 //Print("RegisterRecipe: " +recipe.ClassName() + ", "+ m_RegRecipeIndex.ToString());
455 }
456
457 override protected void UnregisterRecipe(string clasname)
458 {
459 int recipe_id = RecipeIDFromClassname(clasname);
460 //Print("UnregisterRecipe: " + recipe_id.ToString());
461 if (recipe_id != -1)
462 {
463 m_RecipeNamesList.Remove(clasname);
464 //Print(m_RecipeList[recipe_id]);
465 m_RecipeList[recipe_id] = null;
466 //Print(m_RecipeList[recipe_id]);
467 }
468 }
469
470 static int RecipeIDFromClassname(string classname)
471 {
472 if (m_RecipeNamesList.Contains(classname))
473 return m_RecipeNamesList.Get(classname);
474 return -1;
475 }
476
477 protected bool CheckRecipe(int id, ItemBase item1, ItemBase item2, PlayerBase player)//requires ordered items
478 {
479 RecipeBase p_recipe = m_RecipeList[id];
480 return p_recipe.CheckRecipe(item1,item2, player);
481 }
482
483 protected void PrintCache()
484 {
485 for (int i = 0; i < PluginRecipesManager.m_RecipeCache.Count(); i++)
486 {
487 string key = PluginRecipesManager.m_RecipeCache.GetKey(i);
488 CacheObject co = PluginRecipesManager.m_RecipeCache.GetElement(i);
489
490 PrintString("Item: " + key);
491 co.DebugPrint();
492 PrintString("----------------");
493 }
494 }
495
496 protected bool SortIngredientsInRecipe(int id, int num_of_ingredients, ItemBase ingredients_unsorted[], ItemBase ingredients_sorted[] )
497 {
498 ClearResults();
499
500 for (int i = 0; i < num_of_ingredients; i++)
501 {
502 CacheObject co_item = PluginRecipesManager.m_RecipeCache.Get( ingredients_unsorted[i].GetType() );
503 m_IngredientBitMask[i] = co_item.GetMaskByRecipeID(id);
504 m_IngredientBitMaskSize[i] = co_item.GetBitCountByRecipeID(id);
505 }
506
507 bool result = ResolveIngredients(num_of_ingredients);
508
509 if (result)
510 {
511 for (i = 0; i < num_of_ingredients; i++)
512 {
513 int index = Math.Log2( m_BitsResults[i]);
514 ingredients_sorted[index] = ingredients_unsorted[ i ];
515 }
516 }
517 //PrintResultMasks(num_of_ingredients);
518 return result;
519 }
520
521 protected void ClearResults()
522 {
523 for (int i = 0; i < MAX_INGREDIENTS; i++)
524 {
525 m_BitsResults[i] = 0;
526 }
527
528 }
529
530 protected bool ResolveIngredients(int num_of_ingredients, int passes = 0)
531 {
532 int rightmost_bit;
533 int smallest = 99999;
534 int smallest_index = 0;
535
536 for (int i = 0; i < num_of_ingredients; i++)
537 {
538 int count = m_IngredientBitMaskSize[i];
539 if ( count != 0 && count < smallest)
540 {
541 smallest = m_IngredientBitMaskSize[i];
542 smallest_index = i;
543 }
544 }
545
546 rightmost_bit = m_IngredientBitMask[smallest_index] & (-m_IngredientBitMask[smallest_index]);
547 m_BitsResults[smallest_index] = m_BitsResults[smallest_index] | rightmost_bit;
548
549 for (int x = 0; x < num_of_ingredients; x++)
550 {
551 m_IngredientBitMask[x] = ~rightmost_bit & m_IngredientBitMask[x];
552 m_IngredientBitMask[smallest_index] = 0;
553 m_IngredientBitMaskSize[smallest_index] = 0;
554 }
555
556 // check validity
557 int check_sum_vertical = 0;
558
559 for (int z = 0; z < num_of_ingredients; z++)
560 {
561 check_sum_vertical = check_sum_vertical | m_IngredientBitMask[z];//vertical sum
562 check_sum_vertical = check_sum_vertical | m_BitsResults[z];//vertical sum
563 if ((m_IngredientBitMask[z] | m_BitsResults[z]) == 0)
564 {
565 return false;//horizontal check
566 }
567 }
568
569 if ( check_sum_vertical != (Math.Pow(2, num_of_ingredients) - 1)) return false;//vertical check
570
571 passes++;
572
573 if (passes < num_of_ingredients)
574 {
575 if ( !ResolveIngredients(num_of_ingredients, passes) ) return false;
576 }
577 return true;
578 }
579
580
581 protected void PrintResultMasks(int num)
582 {
583 for (int i = 0; i < num; i++)
584 {
585 Debug.Log("results mask("+i.ToString()+") = " +m_BitsResults[i].ToString() );
586 }
587 }
588
590 protected int GetRecipeIntersection(int num_of_ingredients, ItemBase items[])
591 {
592 int count = 0;
593 int smallest = 9999;
594 int smallest_index = 0;
595 m_RecipesMatched.Clear();
596
597 /*
598 m_Ingredients[0] = item_a;
599 m_Ingredients[1] = item_b;
600 */
601 //find the item with smallest number of recipes
602 CacheObject co_least_recipes;
603
604 for (int i = 0; i < num_of_ingredients; i++)
605 {
606 CacheObject cobject = PluginRecipesManager.m_RecipeCache.Get( items[i].GetType() );
607 if (!cobject)
608 {
609 return 0;
610 }
611 if (cobject.GetNumberOfRecipes() < smallest)
612 {
613 smallest = cobject.GetNumberOfRecipes();
614 smallest_index = i;
615 co_least_recipes = cobject;
616 }
617 }
618
619 //look for matches
620 array<int> recipes = co_least_recipes.GetRecipes();
621 for (int x = 0; x < recipes.Count(); x++)
622 {
623 int id = recipes.Get(x);
624 for (int z = 0; z < num_of_ingredients; z++)
625 {
626 if ( z!= smallest_index)
627 {
628 CacheObject cobject2 = PluginRecipesManager.m_RecipeCache.Get( items[z].GetType() );
629 if ( cobject2.IsContainRecipe(id) )
630 {
631 m_RecipesMatched.Insert(id);
632 count++;
633 }
634 }
635 }
636 }
637 return count;
638 }
639
640 protected int SortIngredients(int num_of_ingredients, ItemBase items_unsorted[], int resolved_recipes[])
641 {
642 int count = 0;
643 for (int i = 0; i < m_RecipesMatched.Count() && i < MAX_CONCURENT_RECIPES; i++)
644 {
645 int recipe_id = m_RecipesMatched.Get(i);
646
647 if (SortIngredientsInRecipe(recipe_id, num_of_ingredients, items_unsorted, m_sortedIngredients))//...and now we need to determine which item will be which ingredient number
648 {
649 resolved_recipes[count] = recipe_id;
652 //m_ingredient3[count] = m_sortedIngredients[2];
653 count++;
654 }
655 }
656 return count;
657 }
658
659
660 protected void CreateAllRecipes()
661 {
663 }
664
665
666 string GetSoundCategory(int recipeID, ItemBase item1, ItemBase item2)
667 {
668 ItemBase unsorted[2];
669 ItemBase sorted[2];
670
671 unsorted[0] = item1;
672 unsorted[1] = item2;
673
674 SortIngredientsInRecipe(recipeID, 2,unsorted, sorted);
675
676 RecipeBase recipe = m_RecipeList[recipeID];
677 string soundCat = recipe.GetSoundCategory(0,sorted[0]);
678
679 if (!soundCat)
680 {
681 soundCat = recipe.GetSoundCategory(1,sorted[1]);
682 }
683
684 return soundCat;
685 }
686
687
689 {
690 return m_RecipeList[recipeID].GetRecipeAnimationInfo(player, mainItem, target);
691 }
692
693 int GetAnimationCommandUID(int recipeID) //obsolete
694 {
695 return m_RecipeList[recipeID].GetAnimationCommandUID();
696 }
697
698}
eBleedingSourceType GetType()
ItemBase InventoryItemBase
void CacheObject()
Определения CacheObject.c:35
DayZGame g_Game
Определения DayZGame.c:4074
Icon x
const int SANITY_CHECK_ACCEPTABLE_RESULT
Определения PluginRecipesManager.c:10
ERecipeSanityCheck
Определения PluginRecipesManager.c:2
@ CLOSE_ENOUGH
Определения PluginRecipesManager.c:5
@ IS_IN_PLAYER_INVENTORY
Определения PluginRecipesManager.c:3
@ NOT_OWNED_BY_ANOTHER_LIVE_PLAYER
Определения PluginRecipesManager.c:4
enum ERecipeSanityCheck ACCEPTABLE_DISTANCE
void RegisterRecipies()
Please do not delete commented recipes, they are usually commented out for a reason.
Определения PluginRecipesManagerBase.c:14
const int MAX_NUMBER_OF_INGREDIENTS
Определения RecipeBase.c:1
static void Log(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message with normal prio.
Определения 3_Game/DayZ/tools/Debug.c:183
Определения 3_Game/DayZ/tools/Debug.c:2
override bool DisassembleOnLastDetach()
Определения KitBase.c:34
Определения EnMath.c:7
Определения PlayerBaseClient.c:2
static int RecipeIDFromClassname(string classname)
Определения PluginRecipesManager.c:470
ref CacheObject m_CoBase
Определения PluginRecipesManager.c:260
void PluginRecipesManager()
Определения PluginRecipesManager.c:52
bool IsEnableDebugCrafting()
Определения PluginRecipesManager.c:66
void RegisterRecipe(RecipeBase recipe)
Определения PluginRecipesManager.c:443
bool IsRecipePossibleToPerform(int id, ItemBase itemA, ItemBase itemB, PlayerBase player)
Определения PluginRecipesManager.c:296
ItemBase m_sortedIngredients[MAX_NUMBER_OF_INGREDIENTS]
Определения PluginRecipesManager.c:37
static ref map< typename, bool > m_RecipesInitializedItem
Определения PluginRecipesManager.c:15
ItemBase m_ingredient1[MAX_CONCURENT_RECIPES]
Определения PluginRecipesManager.c:33
void CreateAllRecipes()
Определения PluginRecipesManager.c:660
const int MAX_NUMBER_OF_RECIPES
Определения PluginRecipesManager.c:19
string GetRecipeClassName(int recipe_id)
Определения PluginRecipesManager.c:84
ref array< int > m_RcpsArray
Определения PluginRecipesManager.c:253
void ~PluginRecipesManager()
Определения PluginRecipesManager.c:61
static ref map< string, ref CacheObject > m_RecipeCache
Определения PluginRecipesManager.c:14
void CallbackGenerateCache()
Определения PluginRecipesManager.c:172
void GenerateRecipeCache()
Определения PluginRecipesManager.c:180
const int MAX_CONCURENT_RECIPES
Определения PluginRecipesManager.c:20
ref array< ref RecipeBase > m_RecipeList
Определения PluginRecipesManager.c:42
const int MAX_INGREDIENTS
Определения PluginRecipesManager.c:21
int m_ResolvedRecipes[MAX_CONCURENT_RECIPES]
Определения PluginRecipesManager.c:24
int m_IngredientBitMaskSize[MAX_INGREDIENTS]
Определения PluginRecipesManager.c:29
static int GetMaxNumberOfRecipes()
Определения PluginRecipesManager.c:47
void GenerateHumanReadableRecipeList()
Определения PluginRecipesManager.c:349
ref Timer myTimer1
Определения PluginRecipesManager.c:45
bool GetIsRepeatable(int recipe_id)
Определения PluginRecipesManager.c:158
ref Timer m_TestTimer
Определения PluginRecipesManager.c:18
void UnregisterRecipe(string clasname)
Определения PluginRecipesManager.c:457
bool m_EnableDebugCrafting
Определения PluginRecipesManager.c:26
bool ResolveIngredients(int num_of_ingredients, int passes=0)
Определения PluginRecipesManager.c:530
void SetEnableDebugCrafting(bool enable)
Определения PluginRecipesManager.c:71
void PerformRecipeServer(int id, ItemBase item_a, ItemBase item_b, PlayerBase player)
Определения PluginRecipesManager.c:317
void PrintResultMasks(int num)
Определения PluginRecipesManager.c:581
static ref map< string, int > m_RecipeNamesList
Определения PluginRecipesManager.c:43
ref CacheObject m_CoItem
Определения PluginRecipesManager.c:259
bool GetIsInstaRecipe(int recipe_id)
Определения PluginRecipesManager.c:152
float GetRecipeSpecialty(int recipe_id)
Определения PluginRecipesManager.c:146
ItemBase m_ingredient3[MAX_CONCURENT_RECIPES]
Определения PluginRecipesManager.c:35
override void OnInit()
Определения PluginRecipesManager.c:164
int GetValidRecipesProper(int num_of_items, ItemBase items[], array< int > ids, PlayerBase player)
Определения PluginRecipesManager.c:112
ref array< int > m_RecipesMatched
Определения PluginRecipesManager.c:39
int m_BitsResults[MAX_INGREDIENTS]
Определения PluginRecipesManager.c:31
ref array< string > m_CachedItems
Определения PluginRecipesManager.c:40
int GetAnimationCommandUID(int recipeID)
Определения PluginRecipesManager.c:693
int GetRecipeIntersection(int num_of_ingredients, ItemBase items[])
fills an array with recipe IDs which 'item_a' and 'item_b' share
Определения PluginRecipesManager.c:590
array< RecipeBase > GetRecipesForItem(string itemName)
Определения PluginRecipesManager.c:393
bool CheckRecipe(int id, ItemBase item1, ItemBase item2, PlayerBase player)
Определения PluginRecipesManager.c:477
float GetRecipeLengthInSecs(int recipe_id)
Определения PluginRecipesManager.c:140
ItemBase m_ingredient2[MAX_CONCURENT_RECIPES]
Определения PluginRecipesManager.c:34
int m_IngredientBitMask[MAX_INGREDIENTS]
Определения PluginRecipesManager.c:28
bool RecipeSanityCheck(int num_of_ingredients, InventoryItemBase items[], PlayerBase player)
Определения PluginRecipesManager.c:407
ItemBase m_Ingredients[MAX_INGREDIENTS]
Определения PluginRecipesManager.c:27
string GetRecipeName(int recipe_id)
Определения PluginRecipesManager.c:76
RecipeAnimationInfo GetRecipeAnimationInfo(int recipeID, PlayerBase player, ItemBase mainItem, ItemBase target)
Определения PluginRecipesManager.c:688
string GetSoundCategory(int recipeID, ItemBase item1, ItemBase item2)
Определения PluginRecipesManager.c:666
void MatchItems(TStringArray full_path)
Определения PluginRecipesManager.c:263
bool SortIngredientsInRecipe(int id, int num_of_ingredients, ItemBase ingredients_unsorted[], ItemBase ingredients_sorted[])
sorts ingredients correctly as either first or second ingredient based on their masks
Определения PluginRecipesManager.c:496
int SortIngredients(int num_of_ingredients, ItemBase items_unsorted[], int resolved_recipes[])
Определения PluginRecipesManager.c:640
int GetValidRecipes(ItemBase item1, ItemBase item2, array< int > ids, PlayerBase player)
Определения PluginRecipesManager.c:93
Определения RecipeBase.c:6
Определения AttachHolster.c:2
Определения DayZPlayerImplement.c:39
Определения EnWidgets.c:190
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Определения Transport.c:70
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
Определения EnConvert.c:119
void Error(string err)
Messagebox with error message.
Определения EnDebug.c:90
Obsolete Managed PrintString(string s)
Helper for printing out string expression. Example: PrintString("Hello " + var);.
Определения EnScript.c:369
class array< Class T > TStringArray
FileMode
Определения EnSystem.c:383
proto void CloseFile(FileHandle file)
Close the File.
proto FileHandle OpenFile(string name, FileMode mode)
Opens File.
int[] FileHandle
Определения EnSystem.c:390
proto void FPrintln(FileHandle file, void var)
Write to file and add new line.
static proto float Log2(float x)
Returns the binary (base-2) logarithm of x.
static proto float Pow(float v, float power)
Return power of v ^ power.
const string CFG_VEHICLESPATH
Определения 3_Game/DayZ/constants.c:228
const string CFG_WEAPONSPATH
Определения 3_Game/DayZ/constants.c:229
const string CFG_MAGAZINESPATH
Определения 3_Game/DayZ/constants.c:230
proto string Get(int index)
Gets n-th character from string.