local DST = GLOBAL.TheSim and GLOBAL.TheSim:GetGameID()=="DST"
local ROG = DST or GLOBAL.IsDLCEnabled(GLOBAL.REIGN_OF_GIANTS)
local RECIPETABS = GLOBAL.RECIPETABS
local TECH = GLOBAL.TECH
local MakeRecipe = DST and AddRecipe or function(name,ingr,tab,tech,placer,spacing,nounlock,num,_,atlas,image)
local rec = GLOBAL.Recipe(name,ingr,tab,tech,placer,spacing,nounlock,num,_)
rec.atlas = atlas
rec.image = image
end
--local Ingredient = GLOBAL.Ingredient --already in environment

--variable ingredients
local function steelwool(num)
	return DST and Ingredient("steelwool", num) or Ingredient("flint", 15* num)
end

if GetModConfigData("woodenbatrecipe") then
local woodenrecipe = MakeRecipe("woodenmace",
{Ingredient("log", 2), Ingredient("twigs", 2)},
RECIPETABS.WAR,
TECH.NONE,
nil,
nil,
nil,
nil,
nil,
"images/inventoryimages/woodenmace.xml",
"woodenmace.tex")
woodenrecipe.sortkey = -10
end

if GetModConfigData("flyswatterrecipe") then
MakeRecipe("flyswatter",
{Ingredient("twigs", 2), Ingredient("silk", 2)},
RECIPETABS.WAR,
TECH.SCIENCE_ONE,
nil,
nil,
nil,
nil,
nil,
"images/inventoryimages/flyswatter.xml",
"flyswatter.tex")
end

if GetModConfigData("fryingpanrecipe") then
MakeRecipe("fryingpan",
{steelwool(1), Ingredient("twigs", 2), Ingredient("charcoal", 3)},
RECIPETABS.WAR,
TECH.SCIENCE_ONE,
nil,
nil,
nil,
nil,
nil,
"images/inventoryimages/fryingpan.xml",
"fryingpan.tex")
end

if GetModConfigData("spartanhelmetrecipe") then
MakeRecipe("spartahelmut",
{Ingredient("goldnugget", 4), Ingredient("cutstone", 1), Ingredient("feather_robin", 4) },
RECIPETABS.WAR,
TECH.SCIENCE_TWO,
nil,
nil,
nil,
nil,
nil,
"images/inventoryimages/spartahelmut1.xml",
"spartahelmut.tex")
end

if GetModConfigData("spartanswordrecipe") then
MakeRecipe("spartaswurd",
{Ingredient("goldnugget", 2), Ingredient("redgem", 1), Ingredient("flint", 3) },
RECIPETABS.WAR,
TECH.SCIENCE_TWO,
nil,
nil,
nil,
nil,
nil,
"images/inventoryimages/spartaswurd1.xml",
"spartaswurd.tex")
end

if GetModConfigData("knightrecipe") then
MakeRecipe("ewecushat",
{steelwool(5), Ingredient("hammer", 1), Ingredient("feather_crow", 5)},
RECIPETABS.WAR,
TECH.SCIENCE_TWO,
nil,
nil,
nil,
nil,
nil,
"images/inventoryimages/ewecushat.xml",
"ewecushat.tex")
end

if GetModConfigData("bandanarecipe") then
MakeRecipe("summerbandana",
{Ingredient("papyrus", 2)},
RECIPETABS.DRESS,
TECH.SCIENCE_ONE,
nil,
nil,
nil,
nil,
nil,
"images/inventoryimages/summerbandana.xml",
"summerbandana.tex")
end

if GetModConfigData("baronrecipe") then
MakeRecipe("baronsuit",
{Ingredient("houndstooth", 2), Ingredient("silk", 12), Ingredient("goldnugget", 6)},
RECIPETABS.DRESS,
TECH.SCIENCE_TWO,
nil,
nil,
nil,
nil,
nil,
"images/inventoryimages/baronsuit.xml",
"baronsuit.tex")
end

if GetModConfigData("growstaffrecipe") then
MakeRecipe("growthstaff",
{Ingredient("purplegem", 1), Ingredient("spear", 1), Ingredient("lureplantbulb", 1)},
RECIPETABS.MAGIC,
TECH.MAGIC_THREE,
nil,
nil,
nil,
nil,
nil,
"images/inventoryimages/growthstaff.xml",
"growthstaff.tex")
end

if GetModConfigData("darkaxerecipe") then
MakeRecipe("dark_axe",
{Ingredient("axe", 1), Ingredient("nightmarefuel", 2)},
RECIPETABS.TOOLS,
TECH.MAGIC_THREE,
nil,
nil,
nil,
nil,
nil,
"images/inventoryimages/dark_axe.xml",
"dark_axe.tex")
end

if GetModConfigData("darkpickaxerecipe") then
MakeRecipe("dark_pickaxe",
{Ingredient("pickaxe", 1), Ingredient("nightmarefuel", 2)},
RECIPETABS.TOOLS,
TECH.MAGIC_THREE,
nil,
nil,
nil,
nil,
nil,
"images/inventoryimages/dark_pickaxe.xml",
"dark_pickaxe.tex")
end

if ROG then

	if GetModConfigData("birchhatrecipe") then
	MakeRecipe("birchnuthat",
	{Ingredient("acorn", 5), Ingredient("log", 2), Ingredient("rope", 1)},
	RECIPETABS.WAR,
	TECH.SCIENCE_ONE,
	nil,
	nil,
	nil,
	nil,
	nil,
	"images/inventoryimages/birchnuthat.xml",
	"birchnuthat.tex")
	end

	if GetModConfigData("cactusbatrecipe") then
	MakeRecipe("cactusmace",
	{Ingredient("cactus_meat", 4), Ingredient("twigs", 2), Ingredient("stinger", 4)},
	RECIPETABS.WAR,
	TECH.SCIENCE_TWO,
	nil,
	nil,
	nil,
	nil,
	nil,
	"images/inventoryimages/cactusmace.xml",
	"cactusmace.tex")
	end

	if GetModConfigData("skullrecipe") then
	MakeRecipe("hollowhat",
	{Ingredient("nightmarefuel", 1), Ingredient("boneshard", 1), Ingredient("houndstooth", 1)},
	RECIPETABS.DRESS,
	TECH.MAGIC_TWO,
	nil,
	nil,
	nil,
	nil,
	nil,
	"images/inventoryimages/hollowhat.xml",
	"hollowhat.tex")
	end

end

if not DST and GLOBAL.IsDLCEnabled(GLOBAL.CAPY_DLC) then

if GetModConfigData("mosquitosuitrecipe") then
MakeRecipe("armormosquito",
{Ingredient("mosquito_poison", 4), Ingredient("rope", 2)},
RECIPETABS.WAR,
TECH.SCIENCE_ONE,
nil,
nil,
nil,
nil,
nil,
"images/inventoryimages/armormosquito.xml",
"armormosquito.tex")
end

else

if GetModConfigData("mosquitosuitrecipe") then
MakeRecipe("armormosquito",
{Ingredient("mosquito", 4),Ingredient("spidergland", 1), Ingredient("rope", 2)},
RECIPETABS.WAR,
TECH.SCIENCE_ONE,
nil,
nil,
nil,
nil,
nil,
"images/inventoryimages/armormosquito.xml",
"armormosquito.tex")
end

if GetModConfigData("lightnecklacerecipe") then
MakeRecipe("lightnecklace",
{Ingredient("lightbulb", 6), Ingredient("silk", 2)},
RECIPETABS.LIGHT,
TECH.NONE,
nil,
nil,
nil,
nil,
nil,
"images/inventoryimages/lightnecklace1.xml",
"lightnecklace.tex")
end

end
