shield.lua 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. -- Register Shields
  2. minetest.register_tool("lottarmor:shield_wood", {
  3. description = "Training Shield",
  4. inventory_image = "lottarmor_inv_shield_wood.png",
  5. groups = {armor_shield=2.5, armor_heal=0, armor_use=2000, armor_healing=0, physics_speed=0.2},
  6. wear = 0,
  7. })
  8. minetest.register_tool("lottarmor:shield_tin", {
  9. description = "Tin Shield",
  10. inventory_image = "lottarmor_inv_shield_tin.png",
  11. groups = {armor_shield=5, armor_heal=0, armor_use=1750, armor_healing=0},
  12. wear = 0,
  13. })
  14. minetest.register_tool("lottarmor:shield_copper", {
  15. description = "Copper Shield",
  16. inventory_image = "lottarmor_inv_shield_copper.png",
  17. groups = {armor_shield=5, armor_heal=0, armor_use=1750, armor_healing=0},
  18. wear = 0,
  19. })
  20. minetest.register_tool("lottarmor:shield_steel", {
  21. description = "Steel Shield",
  22. inventory_image = "lottarmor_inv_shield_steel.png",
  23. groups = {armor_shield=10, armor_heal=0, armor_use=1250, armor_healing=0},
  24. wear = 0,
  25. })
  26. minetest.register_tool("lottarmor:shield_bronze", {
  27. description = "Bronze Shield",
  28. inventory_image = "lottarmor_inv_shield_bronze.png",
  29. groups = {armor_shield=12, armor_heal=6, armor_use=750, armor_healing=0},
  30. wear = 0,
  31. })
  32. minetest.register_tool("lottarmor:shield_silver", {
  33. description = "Silver Shield",
  34. inventory_image = "lottarmor_inv_shield_silver.png",
  35. groups = {armor_shield=15, armor_heal=6, armor_use=1000, armor_healing=0, physics_speed=-0.05},
  36. wear = 0,
  37. })
  38. minetest.register_tool("lottarmor:shield_gold", {
  39. description = "Gold Shield",
  40. inventory_image = "lottarmor_inv_shield_gold.png",
  41. groups = {armor_shield=15, armor_heal=12, armor_use=500, armor_healing=0, physics_speed=-0.05},
  42. wear = 0,
  43. })
  44. minetest.register_tool("lottarmor:shield_galvorn", {
  45. description = "Galvorn Shield",
  46. inventory_image = "lottarmor_inv_shield_galvorn.png",
  47. groups = {armor_shield=15, armor_heal=12, armor_use=250, armor_healing=0, physics_speed=-0.1, physics_sneak=-1, forbidden=1},
  48. wear = 0,
  49. })
  50. minetest.register_tool("lottarmor:shield_mithril", {
  51. description = "Mithril Shield",
  52. inventory_image = "lottarmor_inv_shield_mithril.png",
  53. groups = {armor_shield=25, armor_heal=12, armor_use=100, armor_healing=0, physics_speed=-0.1, physics_sneak=-1},
  54. wear = 0,
  55. })
  56. local craft_ingreds = {
  57. wood = "group:wood",
  58. tin = "lottores:tin_ingot",
  59. copper = "default:copper_ingot",
  60. steel = "default:steel_ingot",
  61. bronze = "default:bronze_ingot",
  62. silver = "lottores:silver_ingot",
  63. gold = "default:gold_ingot",
  64. galvorn = "lottores:galvorn_ingot",
  65. mithril = "lottores:mithril_ingot",
  66. }
  67. for k, v in pairs(craft_ingreds) do
  68. minetest.register_craft({
  69. output = "lottarmor:shield_"..k,
  70. recipe = {
  71. {v, v, v},
  72. {v, v, v},
  73. {"", v, ""},
  74. },
  75. })
  76. minetest.register_craft({
  77. type = "cooking",
  78. cooktime = 30,
  79. output = v.." 4",
  80. recipe = "lottarmor:shield_"..k,
  81. })
  82. end
  83. minetest.after(0, function()
  84. table.insert(armor.elements, "shield")
  85. end)