public void BrewPotion() { if (_ingredientToggle.isOn) { if (CheckComplete(_selectedID)) { foreach (Ingredient ingredient in _potionShop.GetRecipes()[_selectedID]._ingredients) { _persistent.DecreaseItemCount(ingredient._id, ingredient._quantity); } } else { return; } } else if (_essenceToggle.isOn) { if (_persistent._magic < _potionShop.GetRecipes()[_selectedID]._cost) { return; } else { _persistent._magic -= _potionShop.GetRecipes()[_selectedID]._cost; } } _persistent.AddInvenotryItem(_potionShop.GetRecipes()[_selectedID]._id, 1); _potionShop.OpenClosePotionShop(); }
void CreateItem(List <Ingredient> ingredients, string itemID) { foreach (Ingredient ingredient in ingredients) { _persistent.DecreaseItemCount(ingredient._id, ingredient._quantity); } _persistent.AddInvenotryItem(itemID, 1); }