sorcery  recipes.lua at [956134c50b]

File recipes.lua artifact 0b99f84f61 part of check-in 956134c50b


minetest.register_craft {
	type = "shapeless";
	recipe = {
		"group:water_bucket",
		"vessels:glass_bottle",
		"vessels:glass_bottle",
		"vessels:glass_bottle"
	};
	output = "sorcery:potion_water 3";
	replacements = {
		{ "group:water_bucket", "bucket:bucket_empty" }
	};
}

minetest.register_craft {
	type = "shapeless";
	recipe = {
		"bucket:bucket_empty";
		"sorcery:potion_water";
		"sorcery:potion_water";
		"sorcery:potion_water";
	};
	output = "bucket:bucket_water";
	replacements = {
		{ "sorcery:potion_water", "vessels:glass_bottle" };
		{ "sorcery:potion_water", "vessels:glass_bottle" };
		{ "sorcery:potion_water", "vessels:glass_bottle" };
	};
}

--[[
minetest.register_craft {
	type = "shapeless";
	recipe = {
		"farming:mortar_pestle",
		"farming:sugar",
		"group:food_blueberries",
		"group:food_raspberries",
		"sorcery:extract_wheat",
		"sorcery:extract_wheat",
		"xdecor:bowl"
	};
	output = "sorcery:oil_mystic";
	replacements = {
		{ "farming:mortar_pestle", "farming:mortar_pestle" },
		{ "sorcery:extract_wheat", "vessels:glass_bottle" },
		{ "sorcery:extract_wheat", "vessels:glass_bottle" }
	};
}

minetest.register_craft {
	type = "shapeless";
	recipe = {
		"farming:mortar_pestle",
		"group:food_berry",
		"group:food_berry",
		"group:food_berry",
		"xdecor:bowl"
	};
	output = "sorcery:oil_berry";
	replacements = {
		{ "farming:mortar_pestle", "farming:mortar_pestle" }
	};
}

minetest.register_craft {
	type = "shapeless";
	recipe = {
		"farming:mortar_pestle",
		"group:food_mushroom",
		"group:food_mushroom",
		"group:food_mushroom",
		"xdecor:bowl"
	};
	output = "sorcery:oil_mushroom";
	replacements = {
		{ "farming:mortar_pestle", "farming:mortar_pestle" }
	};
}
]]
--[[
minetest.register_craft {
	type = "shapeless";
	recipe = {
		"farming:mixing_bowl",
		"sorcery:grease_pine",
		"sorcery:extract_cotton",
		"sorcery:extract_cotton",
		"sorcery:extract_cotton"
	};
	output = "sorcery:oil_whisper";
	replacements = {
		{'farming:mixing_bowl', 'farming:mixing_bowl'};
		{'sorcery:extract_cotton', 'vessels:glass_bottle'};
		{'sorcery:extract_cotton', 'vessels:glass_bottle'};
		{'sorcery:extract_cotton', 'vessels:glass_bottle'};
	};
}

minetest.register_craft {
	type = "shapeless";
	recipe = {
		"farming:mixing_bowl";
		"sorcery:oil_whisper";
		"sorcery:pine_grease";
		"sorcery:extract_rye";
		"sorcery:extract_rye";
		"sorcery:extract_barley";
		"farming:salt";
	};
	output = "sorcery:oil_wind 2";
	replacements = {
		{'farming:mixing_bowl', 'farming:mixing_bowl'};
		{'sorcery:extract_rye', 'vessels:glass_bottle'};
		{'sorcery:extract_rye', 'vessels:glass_bottle'};
		{'sorcery:extract_barley', 'vessels:glass_bottle'};
	};
}

minetest.register_craft {
	type = 'shapeless';
	recipe = {
		"farming:mixing_bowl";
		'sorcery:oil_fog';
		'sorcery:oil_wind';
		'sorcery:blood';
		'sorcery:blood';
		'sorcery:blood';
	};
	output = 'sorcery:grease_storm 2';
	replacements = {
		{'farming:mixing_bowl', 'farming:mixing_bowl'};
		{'sorcery:blood', 'vessels:glass_bottle' }
	}
}

minetest.register_craft {
	type = "shapeless";
	recipe = {
		"farming:mixing_bowl";
		'sorcery:extract_rice',
		'sorcery:oil_berry',
	};
	output = 'sorcery:oil_fog';
	replacements = {
		{'farming:mixing_bowl', 'farming:mixing_bowl'};
		{ 'sorcery:extract_rice', 'vessels:glass_bottle' }
	};
}
]]

minetest.register_craft {
	recipe = {
		{"", "default:gold_ingot"},
		{"default:bronze_ingot",""}
	};
	output = "sorcery:dagger";
}

---- magitech

-- infuser
minetest.register_craftitem('sorcery:infuser_tube', {
	inventory_image = 'sorcery_infuser_tube.png';
	description = 'Infusion Tube';
	groups = {
		sorcery_magitech = 1; metal = 1;
	};
})
minetest.register_craft {
	recipe = {
		{"basic_materials:copper_strip",'sorcery:infuser_concentrator', "basic_materials:copper_strip"};
		{"", "basic_materials:copper_strip", "basic_materials:gold_wire"};
		{"", "basic_materials:copper_strip", ""};
	};
	replacements = {
		{"basic_materials:gold_wire", "basic_materials:empty_spool"}
	};
	output = "sorcery:infuser_tube";
}

minetest.register_craftitem('sorcery:infuser_chamber', {
	inventory_image = 'sorcery_infuser_chamber.png';
	description = 'Infusion Chamber';
	groups = {
		sorcery_magitech = 1;
	};
})
minetest.register_craft {
	recipe = {
		{'default:clay_brick','sorcery:grease_sealant','default:clay_brick'};
		{'default:clay_brick','stairs:slab_steelblock','default:clay_brick'};
	};
	replacements = {
		{'sorcery:grease_sealant','xdecor:bowl'};
	};
	output = "sorcery:infuser_chamber";
}

minetest.register_craftitem('sorcery:infuser_concentrator', {
	inventory_image = 'sorcery_infuser_concentrator.png';
	description = 'Infusion Concentrator';
	groups = {
		sorcery_magitech = 1;
	};
})

minetest.register_craft {
	recipe = {
		{'basic_materials:steel_wire'};
		{'default:obsidian_shard'};
		{'basic_materials:copper_wire'};
	};
	replacements = {
		{'basic_materials:steel_wire', 'basic_materials:empty_spool'};
		{'basic_materials:copper_wire', 'basic_materials:empty_spool'};
	};
	output = "sorcery:infuser_concentrator";
}

minetest.register_craft {
	type = 'shapeless';
	recipe = {
		'basic_materials:empty_spool';
		'basic_materials:empty_spool';
		'sorcery:infuser_concentrator';
	};
	replacements = {
		{'basic_materials:empty_spool', 'basic_materials:steel_wire'};
		{'basic_materials:empty_spool', 'basic_materials:copper_wire'};
	};
	output = "default:obsidian_shard";
}

minetest.register_craft {
	type = 'shapeless';
	recipe = {
		'xdecor:honey';
		'xdecor:bowl';
		'basic_materials:oil_extract';
	};
	output = "sorcery:grease_sealant";
}

minetest.register_craft {
	recipe = {
		{ 'default:tin_ingot', 'bucket:bucket_empty', 'default:tin_ingot'};
		{ 'default:bronze_ingot', 'sorcery:infuser_chamber', 'default:copper_ingot'};
		{ 'sorcery:infuser_tube', 'sorcery:infuser_tube', 'sorcery:infuser_tube' };
	};
	output = "sorcery:infuser";
}


---- altar
-- candles
minetest.register_craftitem('sorcery:candle', {
	-- TODO make candle node
	inventory_image = 'sorcery_candle.png';
	description = 'Votive Candle';
	groups = {
		candle = 1;
	};
})

minetest.register_craft {
	recipe = {
		{'farming:string'};
		{'basic_materials:paraffin'};
		{'basic_materials:paraffin'};
	};
	output = "sorcery:candle";
}

minetest.register_craft {
	recipe = {
		{'sorcery:candle','sorcery:candle','sorcery:candle'};
		{'sorcery:coin_gold','stairs:slab_stone','sorcery:coin_bronze'};
		{'','sorcery:coin_tin',''};
	};
	output = "sorcery:altar";
}
minetest.clear_craft { output = 'morelights:bulb'; }
minetest.register_craft {
	recipe = {
		{'xpanes:pane_flat', 'sorcery:gem_luxite_shard', 'xpanes:pane_flat'};
		{'sorcery:gem_luxite_shard', 'default:mese_crystal_fragment','sorcery:gem_luxite_shard'};
		{'xpanes:pane_flat', 'basic_materials:copper_wire', 'xpanes:pane_flat'};
	};
	replacements = {
		{'basic_materials:copper_wire', 'basic_materials:empty_spool'};
	};
	output = 'morelights:bulb 4';
}

local potion_auto_recipe = function(id, substance, tools, container)
	local recipe = tools
	local replace = {}
	local batches = 1
	for _,v in pairs(tools) do
		replace[#replace + 1] = {v,v}
	end

	if substance.core and #substance.core > 0 then
		batches = #substance.core
		recipe = sorcery.lib.tbl.append(recipe, substance.core)
	elseif container then
		recipe[#recipe + 1] = container
	end
	if substance.mix and #substance.mix > 0 then
		recipe = sorcery.lib.tbl.append(recipe, substance.mix)
		for _,r in pairs(substance.mix) do
			if sorcery.data.infusion_leftovers[r] then
				replace[#replace + 1] = {
					r, sorcery.data.infusion_leftovers[r]
				}
			end
		end
	end

	minetest.register_craft {
		type = 'shapeless';
		recipe = recipe;
		replacements = replace;
		output = id .. ' ' .. batches;
	}
end
-- auto-generate recipes for potionmaking oils
for n,v in pairs(sorcery.data.oils) do
	if (v.core and #v.core > 0) or (v.mix and #v.mix > 0) then
		local id = 'sorcery:oil_' .. n
		potion_auto_recipe(id,v,{'farming:mortar_pestle'},'xdecor:bowl')
	end
end

for n,v in pairs(sorcery.data.greases) do
	if (v.core and #v.core > 0) or (v.mix and #v.mix > 0) then
		local id = 'sorcery:grease_' .. n
		potion_auto_recipe(id,v,{'farming:mixing_bowl'},'xdecor:bowl')
	end
end