DayZ 1.28
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ ApplyModificationsIngredients()

void ApplyModificationsIngredients ( ItemBase sorted[],
PlayerBase player )
protected

См. определение в файле RecipeBase.c строка 373

374 {
375 //---------------------- ingredients ----------------------
376 for (int i = 0; i < MAX_NUMBER_OF_INGREDIENTS; i++)
377 {
378 ItemBase ingredient = sorted[i];
379
380 if (m_IngredientDestroy[i] == 1)//<------m_IngredientDestroy
381 {
382 if (ingredient) m_IngredientsToBeDeleted.Insert(ingredient);
383 }
384 else
385 {
386 if (m_IngredientAddHealth[i] != 0)//<------m_IngredientAddHealth
387 {
388 float health_delta = m_IngredientAddHealth[i];
389 ingredient.AddHealth("","",health_delta);
390 }
391 else if (m_IngredientSetHealth[i] != -1)//<------m_IngredientSetHealth
392 {
393 float new_health = m_IngredientSetHealth[i];
394 ingredient.SetHealth("","",new_health);
395 }
396 if (m_IngredientAddQuantity[i] != 0)//<------m_IngredientAddQuantity
397 {
398 float quantity_delta = m_IngredientAddQuantity[i];
399
400 if (!ingredient.IsMagazine())
401 {
402 ItemBase obj = ingredient;
403 bool isDestroyed = obj.AddQuantity(quantity_delta, true);
404 if (isDestroyed)
405 {
406 continue;
407 }
408 }
409 else
410 {
411 Magazine mag = Magazine.Cast(ingredient);
412 int newQuantity = mag.GetAmmoCount() + quantity_delta;
413 if (newQuantity <= 0)
414 {
415 if (mag) m_IngredientsToBeDeleted.Insert(mag);
416 continue;
417 }
418 else
419 {
420 mag.ServerSetAmmoCount(newQuantity);
421 }
422 }
423 }
424 }
425 }
426 }
float m_IngredientAddHealth[MAX_NUMBER_OF_INGREDIENTS]
Определения RecipeBase.c:49
float m_IngredientSetHealth[MAX_NUMBER_OF_INGREDIENTS]
Определения RecipeBase.c:51
ref array< ItemBase > m_IngredientsToBeDeleted
Определения RecipeBase.c:32
float m_IngredientAddQuantity[MAX_NUMBER_OF_INGREDIENTS]
Определения RecipeBase.c:50
bool m_IngredientDestroy[MAX_NUMBER_OF_INGREDIENTS]
Определения RecipeBase.c:52
const int MAX_NUMBER_OF_INGREDIENTS
Определения RecipeBase.c:1

Перекрестные ссылки m_IngredientAddHealth, m_IngredientAddQuantity, m_IngredientDestroy, m_IngredientSetHealth, m_IngredientsToBeDeleted и MAX_NUMBER_OF_INGREDIENTS.

Используется в PerformRecipe().