-- support for i18n
local S = armor_i18n.gettext

if armor.materials.wood then
   armor:register_armor("3d_armor:helmet_wood", {
      description = S("Wood Helmet"),
      inventory_image = "3d_armor_inv_helmet_wood.png",
      groups = {armor_head=1, armor_block=1, armor_use=2000, flammable=1},
      armor_groups = {fleshy=5},
      damage_groups = {cracky=3, snappy=2, choppy=3, crumbly=2, level=1},
   })
   armor:register_armor("3d_armor:chestplate_wood", {
      description = S("Wood Chestplate"),
      inventory_image = "3d_armor_inv_chestplate_wood.png",
      groups = {armor_torso=1, armor_block=2, armor_use=2000, flammable=1},
      armor_groups = {fleshy=10},
      damage_groups = {cracky=3, snappy=2, choppy=3, crumbly=2, level=1},
   })
   armor:register_armor("3d_armor:leggings_wood", {
      description = S("Wood Leggings"),
      inventory_image = "3d_armor_inv_leggings_wood.png",
      groups = {armor_legs=1, armor_block=2, armor_use=2000, flammable=1},
      armor_groups = {fleshy=10},
      damage_groups = {cracky=3, snappy=2, choppy=3, crumbly=2, level=1},
   })
   armor:register_armor("3d_armor:boots_wood", {
      description = S("Wood Boots"),
      inventory_image = "3d_armor_inv_boots_wood.png",
      groups = {armor_feet=1, armor_block=1, armor_use=2000, flammable=1},
      armor_groups = {fleshy=5},
      damage_groups = {cracky=3, snappy=2, choppy=3, crumbly=2, level=1},
   })
end

--Steel
armor:register_armor("3d_armor:helmet_steel", {
   description = S("Steel Helmet"),
   inventory_image = "3d_armor_inv_helmet_steel.png",
   groups = {armor_head=1, armor_block=5, armor_use=800,
      physics_speed=-0.01, physics_gravity=0.01},
   armor_groups = {fleshy=9},
   damage_groups = {cracky=2, snappy=3, choppy=2, crumbly=1, level=2},
})
armor:register_armor("3d_armor:chestplate_steel", {
   description = S("Steel Chestplate"),
   inventory_image = "3d_armor_inv_chestplate_steel.png",
   groups = {armor_torso=1, armor_block=7, armor_use=800,
      physics_speed=-0.04, physics_gravity=0.04},
   armor_groups = {fleshy=12},
   damage_groups = {cracky=2, snappy=3, choppy=2, crumbly=1, level=2},
})
armor:register_armor("3d_armor:leggings_steel", {
   description = S("Steel Leggings"),
   inventory_image = "3d_armor_inv_leggings_steel.png",
   groups = {armor_legs=1, armor_block=7, armor_use=800,
      physics_speed=-0.03, physics_gravity=0.03},
   armor_groups = {fleshy=12},
   damage_groups = {cracky=2, snappy=3, choppy=2, crumbly=1, level=2},
})
armor:register_armor("3d_armor:boots_steel", {
   description = S("Steel Boots"),
   inventory_image = "3d_armor_inv_boots_steel.png",
   groups = {armor_feet=1, armor_block=5, armor_use=800,
      physics_speed=-0.01, physics_gravity=0.01},
   armor_groups = {fleshy=9},
   damage_groups = {cracky=2, snappy=3, choppy=2, crumbly=1, level=2},
})

--Bronze
armor:register_armor("3d_armor:helmet_bronze", {
   description = S("Bronze Helmet"),
   inventory_image = "3d_armor_inv_helmet_bronze.png",
   groups = {armor_head=1, armor_block=8, armor_use=400,
      physics_speed=-0.01, physics_gravity=0.01},
   armor_groups = {fleshy=10},
   damage_groups = {cracky=3, snappy=2, choppy=2, crumbly=1, level=2},
})
armor:register_armor("3d_armor:chestplate_bronze", {
   description = S("Bronze Chestplate"),
   inventory_image = "3d_armor_inv_chestplate_bronze.png",
   groups = {armor_torso=1, armor_block=10, armor_use=400,
      physics_speed=-0.04, physics_gravity=0.04},
   armor_groups = {fleshy=15},
   damage_groups = {cracky=3, snappy=2, choppy=2, crumbly=1, level=2},
})
armor:register_armor("3d_armor:leggings_bronze", {
   description = S("Bronze Leggings"),
   inventory_image = "3d_armor_inv_leggings_bronze.png",
   groups = {armor_legs=1, armor_block=10, armor_use=400,
      physics_speed=-0.03, physics_gravity=0.03},
   armor_groups = {fleshy=15},
   damage_groups = {cracky=3, snappy=2, choppy=2, crumbly=1, level=2},
})
armor:register_armor("3d_armor:boots_bronze", {
   description = S("Bronze Boots"),
   inventory_image = "3d_armor_inv_boots_bronze.png",
   groups = {armor_feet=1, armor_block=8, armor_use=400,
      physics_speed=-0.01, physics_gravity=0.01},
   armor_groups = {fleshy=10},
   damage_groups = {cracky=3, snappy=2, choppy=2, crumbly=1, level=2},
})

--Diamond
armor:register_armor("3d_armor:helmet_diamond", {
   description = S("Diamond Helmet"),
   inventory_image = "3d_armor_inv_helmet_diamond.png",
   groups = {armor_head=1, armor_block=15, armor_use=200},
   armor_groups = {fleshy=15},
   damage_groups = {cracky=2, snappy=1, choppy=1, level=3},
})
armor:register_armor("3d_armor:chestplate_diamond", {
   description = S("Diamond Chestplate"),
   inventory_image = "3d_armor_inv_chestplate_diamond.png",
   groups = {armor_torso=1, armor_block=15, armor_use=200},
   armor_groups = {fleshy=20},
   damage_groups = {cracky=2, snappy=1, choppy=1, level=3},
})
armor:register_armor("3d_armor:leggings_diamond", {
   description = S("Diamond Leggings"),
   inventory_image = "3d_armor_inv_leggings_diamond.png",
   groups = {armor_legs=1, armor_block=15, armor_use=200},
   armor_groups = {fleshy=20},
   damage_groups = {cracky=2, snappy=1, choppy=1, level=3},
})
armor:register_armor("3d_armor:boots_diamond", {
   description = S("Diamond Boots"),
   inventory_image = "3d_armor_inv_boots_diamond.png",
   groups = {armor_feet=1, armor_block=15, armor_use=200},
   armor_groups = {fleshy=15},
   damage_groups = {cracky=2, snappy=1, choppy=1, level=3},
})

--Gold
armor:register_armor("3d_armor:helmet_gold", {
   description = S("Gold Helmet"),
   inventory_image = "3d_armor_inv_helmet_gold.png",
   groups = {armor_head=1, armor_block=10, armor_use=300,
      physics_speed=-0.04, physics_gravity=0.02},
   armor_groups = {fleshy=11},
   damage_groups = {cracky=1, snappy=2, choppy=2, crumbly=3, level=2},
})
armor:register_armor("3d_armor:chestplate_gold", {
   description = S("Gold Chestplate"),
   inventory_image = "3d_armor_inv_chestplate_gold.png",
   groups = {armor_torso=1, armor_block=12, armor_use=300,
      physics_speed=-0.1, physics_gravity=0.05},
   armor_groups = {fleshy=16},
   damage_groups = {cracky=1, snappy=2, choppy=2, crumbly=3, level=2},
})
armor:register_armor("3d_armor:leggings_gold", {
   description = S("Gold Leggings"),
   inventory_image = "3d_armor_inv_leggings_gold.png",
   groups = {armor_legs=1, armor_block=12, armor_use=300,
      physics_speed=-0.08, physics_gravity=0.04},
   armor_groups = {fleshy=16},
   damage_groups = {cracky=1, snappy=2, choppy=2, crumbly=3, level=2},
})
armor:register_armor("3d_armor:boots_gold", {
   description = S("Gold Boots"),
   inventory_image = "3d_armor_inv_boots_gold.png",
   groups = {armor_feet=1, armor_block=10, armor_use=300,
      physics_speed=-0.04, physics_gravity=0.02},
   armor_groups = {fleshy=11},
   damage_groups = {cracky=1, snappy=2, choppy=2, crumbly=3, level=2},
})

for k, v in pairs(armor.materials) do
   minetest.register_craft({
      output = "3d_armor:helmet_"..k,
      recipe = {
         {v, v, v},
         {v, "", v},
         {"", "", ""},
      },
   })
   minetest.register_craft({
      output = "3d_armor:chestplate_"..k,
      recipe = {
         {v, "", v},
         {v, v, v},
         {v, v, v},
      },
   })
   minetest.register_craft({
      output = "3d_armor:leggings_"..k,
      recipe = {
         {v, v, v},
         {v, "", v},
         {v, "", v},
      },
   })
   minetest.register_craft({
      output = "3d_armor:boots_"..k,
      recipe = {
         {v, "", v},
         {v, "", v},
      },
   })
end
