2013-11-12 22:22:52 +01:00
|
|
|
local use_moreores = minetest.get_modpath("moreores")
|
|
|
|
|
2017-03-10 19:05:16 +01:00
|
|
|
if minetest.global_exists("armor") and armor.elements then
|
|
|
|
table.insert(armor.elements, "shield")
|
2017-03-29 20:13:13 +02:00
|
|
|
local mult = armor.config.level_multiplier or 1
|
|
|
|
armor.config.level_multiplier = mult * 0.9
|
2017-03-10 19:05:16 +01:00
|
|
|
end
|
|
|
|
|
2013-06-24 20:06:19 +02:00
|
|
|
-- Regisiter Shields
|
|
|
|
|
2014-11-10 01:53:54 +01:00
|
|
|
minetest.register_tool("shields:shield_admin", {
|
|
|
|
description = "Admin Shield",
|
|
|
|
inventory_image = "shields_inv_shield_admin.png",
|
2016-05-27 20:51:04 +02:00
|
|
|
groups = {armor_shield=1000, armor_heal=100, armor_use=0, not_in_creative_inventory=1},
|
2014-11-10 01:53:54 +01:00
|
|
|
wear = 0,
|
|
|
|
})
|
|
|
|
|
2017-03-18 18:23:50 +01:00
|
|
|
if armor.materials.wood then
|
2015-02-19 20:18:34 +01:00
|
|
|
minetest.register_tool("shields:shield_wood", {
|
|
|
|
description = "Wooden Shield",
|
|
|
|
inventory_image = "shields_inv_shield_wood.png",
|
|
|
|
groups = {armor_shield=5, armor_heal=0, armor_use=2000},
|
|
|
|
wear = 0,
|
|
|
|
})
|
|
|
|
minetest.register_tool("shields:shield_enhanced_wood", {
|
|
|
|
description = "Enhanced Wood Shield",
|
|
|
|
inventory_image = "shields_inv_shield_enhanced_wood.png",
|
|
|
|
groups = {armor_shield=8, armor_heal=0, armor_use=1000},
|
|
|
|
wear = 0,
|
|
|
|
})
|
|
|
|
minetest.register_craft({
|
|
|
|
output = "shields:shield_enhanced_wood",
|
|
|
|
recipe = {
|
|
|
|
{"default:steel_ingot"},
|
|
|
|
{"shields:shield_wood"},
|
|
|
|
{"default:steel_ingot"},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
end
|
2013-06-24 20:06:19 +02:00
|
|
|
|
2017-03-18 18:23:50 +01:00
|
|
|
if armor.materials.cactus then
|
2015-02-19 20:18:34 +01:00
|
|
|
minetest.register_tool("shields:shield_cactus", {
|
|
|
|
description = "Cactus Shield",
|
|
|
|
inventory_image = "shields_inv_shield_cactus.png",
|
|
|
|
groups = {armor_shield=5, armor_heal=0, armor_use=2000},
|
|
|
|
wear = 0,
|
|
|
|
})
|
|
|
|
minetest.register_tool("shields:shield_enhanced_cactus", {
|
|
|
|
description = "Enhanced Cactus Shield",
|
|
|
|
inventory_image = "shields_inv_shield_enhanced_cactus.png",
|
|
|
|
groups = {armor_shield=8, armor_heal=0, armor_use=1000},
|
|
|
|
wear = 0,
|
|
|
|
})
|
|
|
|
minetest.register_craft({
|
|
|
|
output = "shields:shield_enhanced_cactus",
|
|
|
|
recipe = {
|
|
|
|
{"default:steel_ingot"},
|
|
|
|
{"shields:shield_cactus"},
|
|
|
|
{"default:steel_ingot"},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
end
|
2014-11-10 01:53:54 +01:00
|
|
|
|
2017-03-18 18:23:50 +01:00
|
|
|
if armor.materials.steel then
|
2015-02-19 20:18:34 +01:00
|
|
|
minetest.register_tool("shields:shield_steel", {
|
|
|
|
description = "Steel Shield",
|
|
|
|
inventory_image = "shields_inv_shield_steel.png",
|
|
|
|
groups = {armor_shield=10, armor_heal=0, armor_use=500},
|
|
|
|
wear = 0,
|
|
|
|
})
|
|
|
|
end
|
2013-06-24 20:06:19 +02:00
|
|
|
|
2017-03-18 18:23:50 +01:00
|
|
|
if armor.materials.bronze then
|
2015-02-19 20:18:34 +01:00
|
|
|
minetest.register_tool("shields:shield_bronze", {
|
|
|
|
description = "Bronze Shield",
|
|
|
|
inventory_image = "shields_inv_shield_bronze.png",
|
|
|
|
groups = {armor_shield=10, armor_heal=6, armor_use=250},
|
|
|
|
wear = 0,
|
|
|
|
})
|
|
|
|
end
|
2013-06-24 20:06:19 +02:00
|
|
|
|
2017-03-18 18:23:50 +01:00
|
|
|
if armor.materials.diamond then
|
2015-02-19 20:18:34 +01:00
|
|
|
minetest.register_tool("shields:shield_diamond", {
|
|
|
|
description = "Diamond Shield",
|
|
|
|
inventory_image = "shields_inv_shield_diamond.png",
|
|
|
|
groups = {armor_shield=15, armor_heal=12, armor_use=100},
|
|
|
|
wear = 0,
|
|
|
|
})
|
|
|
|
end
|
2013-06-24 20:06:19 +02:00
|
|
|
|
2017-03-18 18:23:50 +01:00
|
|
|
if armor.materials.gold then
|
2015-02-19 20:18:34 +01:00
|
|
|
minetest.register_tool("shields:shield_gold", {
|
|
|
|
description = "Gold Shield",
|
|
|
|
inventory_image = "shields_inv_shield_gold.png",
|
|
|
|
groups = {armor_shield=10, armor_heal=6, armor_use=250},
|
|
|
|
wear = 0,
|
|
|
|
})
|
|
|
|
end
|
2014-06-12 17:04:08 +02:00
|
|
|
|
2017-03-18 18:23:50 +01:00
|
|
|
if armor.materials.mithril then
|
2013-11-12 22:22:52 +01:00
|
|
|
minetest.register_tool("shields:shield_mithril", {
|
|
|
|
description = "Mithril Shield",
|
|
|
|
inventory_image = "shields_inv_shield_mithril.png",
|
|
|
|
groups = {armor_shield=15, armor_heal=12, armor_use=50},
|
|
|
|
wear = 0,
|
|
|
|
})
|
|
|
|
end
|
2013-06-24 20:06:19 +02:00
|
|
|
|
2017-03-18 18:23:50 +01:00
|
|
|
if armor.materials.crystal then
|
2015-05-04 18:08:40 +02:00
|
|
|
minetest.register_tool("shields:shield_crystal", {
|
|
|
|
description = "Crystal Shield",
|
|
|
|
inventory_image = "shields_inv_shield_crystal.png",
|
|
|
|
groups = {armor_shield=15, armor_heal=12, armor_use=50, armor_fire=1},
|
|
|
|
wear = 0,
|
|
|
|
})
|
|
|
|
end
|
|
|
|
|
2017-03-18 18:23:50 +01:00
|
|
|
for k, v in pairs(armor.materials) do
|
2013-06-24 20:06:19 +02:00
|
|
|
minetest.register_craft({
|
|
|
|
output = "shields:shield_"..k,
|
|
|
|
recipe = {
|
|
|
|
{v, v, v},
|
|
|
|
{v, v, v},
|
|
|
|
{"", v, ""},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
end
|