function Recipe.OnCreate.SliceBlackBread(items, result, player)
    for i=0,items:size() - 1 do
        local item = items:get(i)
        if item:getType() == "BlackBread" then
            result:setBaseHunger(item:getBaseHunger() / 3);
            result:setHungChange(item:getHungChange() / 3);
            result:setBoredomChange(item:getBoredomChangeUnmodified() / 3)
            result:setUnhappyChange(item:getUnhappyChangeUnmodified() / 3)
            result:setCalories(item:getCalories() / 3)
            result:setCarbohydrates(item:getCarbohydrates() / 3)
            result:setLipids(item:getLipids() / 3)
            result:setProteins(item:getProteins() / 3)
        end
    end
end

function Recipe.OnCreate.SliceDrSausage(items, result, player)
    for i=0,items:size() - 1 do
        local item = items:get(i)
        if item:getType() == "DrSausage" then
            result:setBaseHunger(item:getBaseHunger() / 5);
            result:setHungChange(item:getHungChange() / 5);
            result:setBoredomChange(item:getBoredomChangeUnmodified() / 5)
            result:setUnhappyChange(item:getUnhappyChangeUnmodified() / 5)
            result:setCalories(item:getCalories() / 5)
            result:setCarbohydrates(item:getCarbohydrates() / 5)
            result:setLipids(item:getLipids() / 5)
            result:setProteins(item:getProteins() / 5)
        end
    end
end

function Recipe.OnCreate.MakeBowlOfMakaroniHorns4(items, result, player)
    local addType = "Base.Pot"
    local condition = 10;
    for i=0,items:size() - 1 do
        local item = items:get(i)
        if item:getType() == "MakaroniPot" or item:getType() == "MakaroniPan" or item:getType() == "MakaroniPot"or item:getType() == "WaterPotMakaroniHorns" or item:getType() == "WaterSaucepanMakaroniHorns" then
            result:setBaseHunger(item:getBaseHunger() / 4);
            result:setHungChange(item:getHungChange() / 4);
            result:setThirstChange(item:getThirstChangeUnmodified() / 4);
            result:setBoredomChange(item:getBoredomChangeUnmodified() / 4);
            result:setUnhappyChange(item:getUnhappyChangeUnmodified() / 4);
            result:setCarbohydrates(item:getCarbohydrates() / 4);
            result:setLipids(item:getLipids() / 4);
            result:setProteins(item:getProteins() / 4);
            result:setCalories(item:getCalories() / 4);
            result:setTaintedWater(item:isTaintedWater())
            condition = item:getCondition()
            if string.contains(item:getType(), "Pan") or string.contains(item:getType(), "Saucepan") then
                addType = "Base.Saucepan"
            end
        end
    end
    local pot = player:getInventory():AddItem(addType);
    pot:setCondition(condition)
end

function Recipe.OnCreate.MakeBowlOfMakaroniHorns2(items, result, player)
    local addType = "Base.Pot"
    local condition = 10;
    for i=0,items:size() - 1 do
        local item = items:get(i)
        if item:getType() == "MakaroniPot" or item:getType() == "MakaroniPan" or item:getType() == "MakaroniPot"or item:getType() == "WaterPotMakaroniHorns" or item:getType() == "WaterSaucepanMakaroniHorns" then
            result:setBaseHunger(item:getBaseHunger() / 2);
            result:setHungChange(item:getHungChange() / 2);
            result:setThirstChange(item:getThirstChangeUnmodified() / 2);
            result:setBoredomChange(item:getBoredomChangeUnmodified() / 2);
            result:setUnhappyChange(item:getUnhappyChangeUnmodified() / 2);
            result:setCarbohydrates(item:getCarbohydrates() / 2);
            result:setLipids(item:getLipids() / 2);
            result:setProteins(item:getProteins() / 2);
            result:setCalories(item:getCalories() / 2);
            result:setTaintedWater(item:isTaintedWater())
            condition = item:getCondition()
            if string.contains(item:getType(), "Pan") or string.contains(item:getType(), "Saucepan") then
                addType = "Base.Saucepan"
            end
        end
    end
    local pot = player:getInventory():AddItem(addType);
    pot:setCondition(condition)
end

function Recipe.OnCreate.MakeBowlOfBuckwheat4(items, result, player)
    local addType = "Base.Pot"
    local condition = 10;
    for i=0,items:size() - 1 do
        local item = items:get(i)
        if item:getType() == "MakaroniPot" or item:getType() == "BuckwheatPan" or item:getType() == "BuckwheatPot"or item:getType() == "WaterPotBuckwheat" or item:getType() == "WaterSaucepanBuckwheat" then
            result:setBaseHunger(item:getBaseHunger() / 4);
            result:setHungChange(item:getHungChange() / 4);
            result:setThirstChange(item:getThirstChangeUnmodified() / 4);
            result:setBoredomChange(item:getBoredomChangeUnmodified() / 4);
            result:setUnhappyChange(item:getUnhappyChangeUnmodified() / 4);
            result:setCarbohydrates(item:getCarbohydrates() / 4);
            result:setLipids(item:getLipids() / 4);
            result:setProteins(item:getProteins() / 4);
            result:setCalories(item:getCalories() / 4);
            result:setTaintedWater(item:isTaintedWater())
            condition = item:getCondition()
            if string.contains(item:getType(), "Pan") or string.contains(item:getType(), "Saucepan") then
                addType = "Base.Saucepan"
            end
        end
    end
    local pot = player:getInventory():AddItem(addType);
    pot:setCondition(condition)
end

function Recipe.OnCreate.MakeBowlOfBuckwheat2(items, result, player)
    local addType = "Base.Pot"
    local condition = 10;
    for i=0,items:size() - 1 do
        local item = items:get(i)
        if item:getType() == "MakaroniPot" or item:getType() == "BuckwheatPan" or item:getType() == "BuckwheatPot"or item:getType() == "WaterPotBuckwheat" or item:getType() == "WaterSaucepanBuckwheat" then
            result:setBaseHunger(item:getBaseHunger() / 2);
            result:setHungChange(item:getHungChange() / 2);
            result:setThirstChange(item:getThirstChangeUnmodified() / 2);
            result:setBoredomChange(item:getBoredomChangeUnmodified() / 2);
            result:setUnhappyChange(item:getUnhappyChangeUnmodified() / 2);
            result:setCarbohydrates(item:getCarbohydrates() / 2);
            result:setLipids(item:getLipids() / 2);
            result:setProteins(item:getProteins() / 2);
            result:setCalories(item:getCalories() / 2);
            result:setTaintedWater(item:isTaintedWater())
            condition = item:getCondition()
            if string.contains(item:getType(), "Pan") or string.contains(item:getType(), "Saucepan") then
                addType = "Base.Saucepan"
            end
        end
    end
    local pot = player:getInventory():AddItem(addType);
    pot:setCondition(condition)
end

function OnUnpackRation(items, result, player)
	player:getInventory():AddItems("Base.ArmyCrackers",4);
	player:getInventory():AddItems("Base.ArmySugar",4);
	player:getInventory():AddItems("Base.ArmyTea",2);
	player:getInventory():AddItems("Base.ArmyJam",2);
	player:getInventory():AddItems("Base.ArmyJuice",1);
	player:getInventory():AddItems("Base.ArmyFat",1);
	player:getInventory():AddItems("Base.ArmyBuckwheat",1);
	player:getInventory():AddItems("Base.ArmyPate",1);
	player:getInventory():AddItems("Base.DryFuel",1);
	player:getInventory():AddItems("Base.Matches",1);
end

function OnUnpackAI(items, result, player)
	player:getInventory():AddItems("Base.AI2Painkiller",1);
	player:getInventory():AddItems("Base.AI2Antibiotics",2);
	player:getInventory():AddItems("Base.AI2Instructions",1);
end

function Stacks_GiveRubberband(items, result, player)
	player:getInventory():AddItems("Base.RubberBand",1);
end