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

◆ ApplyModificationsIngredients()

void RecipeBase::ApplyModificationsIngredients ( ItemBase sorted[],
PlayerBase player )
inlineprotected

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

350 {
351 //---------------------- ingredients ----------------------
352 for (int i = 0; i < MAX_NUMBER_OF_INGREDIENTS; i++)
353 {
354 ItemBase ingredient = sorted[i];
355
356 if (m_IngredientDestroy[i] == 1)//<------m_IngredientDestroy
357 {
358 if (ingredient) m_IngredientsToBeDeleted.Insert(ingredient);
359 }
360 else
361 {
362 if (m_IngredientAddHealth[i] != 0)//<------m_IngredientAddHealth
363 {
364 float health_delta = m_IngredientAddHealth[i];
365 ingredient.AddHealth("","",health_delta);
366 }
367 else if (m_IngredientSetHealth[i] != -1)//<------m_IngredientSetHealth
368 {
369 float new_health = m_IngredientSetHealth[i];
370 ingredient.SetHealth("","",new_health);
371 }
372 if (m_IngredientAddQuantity[i] != 0)//<------m_IngredientAddQuantity
373 {
374 float quantity_delta = m_IngredientAddQuantity[i];
375
376 if (!ingredient.IsMagazine())
377 {
378 ItemBase obj = ingredient;
379 bool isDestroyed = obj.AddQuantity(quantity_delta, true);
380 if (isDestroyed)
381 {
382 continue;
383 }
384 }
385 else
386 {
387 Magazine mag = Magazine.Cast(ingredient);
388 int newQuantity = mag.GetAmmoCount() + quantity_delta;
389 if (newQuantity <= 0)
390 {
391 if (mag) m_IngredientsToBeDeleted.Insert(mag);
392 continue;
393 }
394 else
395 {
396 mag.ServerSetAmmoCount(newQuantity);
397 }
398 }
399 }
400 }
401 }
402 }
class GP5GasMask extends MaskBase ItemBase
const int MAX_NUMBER_OF_INGREDIENTS
Определения RecipeBase.c:1
bool m_IngredientDestroy[MAX_NUMBER_OF_INGREDIENTS]
Определения RecipeBase.c:36
float m_IngredientAddHealth[MAX_NUMBER_OF_INGREDIENTS]
Определения RecipeBase.c:33
float m_IngredientSetHealth[MAX_NUMBER_OF_INGREDIENTS]
Определения RecipeBase.c:35
float m_IngredientAddQuantity[MAX_NUMBER_OF_INGREDIENTS]
Определения RecipeBase.c:34
ref array< ItemBase > m_IngredientsToBeDeleted
Определения RecipeBase.c:16

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

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