nssm_armor.lua 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. --Armors
  2. local stats = {
  3. wolf = {name="Werewolf", armor=2.8, heal=0, use=800},
  4. whitewolf = {name="White Werewolf", armor=2.8, heal=0, use=800},
  5. bloco = {name="Bloco", armor=3.2, heal=0, use=500},
  6. croco = {name="Crocodile", armor=3, heal=0, use=450},
  7. ant = {name="Ant", armor=3, heal=0, use=400},
  8. ice = {name="Ice Teeth", armor=3.2, heal=0, use=410},
  9. felucco = {name="Felucco", armor=2.8, heal=0, use=800},
  10. manticore = {name="Manticore", armor=3.4, heal=0, use=440},
  11. duck = {name="Duck", armor=1.5, heal=0, use=1000},
  12. black_duck = {name="Black Duck", armor=1.5, heal=0, use=900},
  13. mor = {name="Morlu", armor=5.3, heal=0, use=30},
  14. sky = {name="Sky", armor=4.2, heal=0, use=100},
  15. sandworm = {name="Sandworm", armor=3.4, heal=0, use=400},
  16. sandbloco = {name="Sand Bloco", armor=3.2, heal=0, use=500},
  17. web = {name="Cobweb String", armor=2.4, heal=0, use=900},
  18. denseweb = {name="Dense Cobweb String", armor=3.5, heal=0, use=400},
  19. }
  20. local materials = {
  21. wolf="nssm:wolf_fur",
  22. whitewolf="nssm:white_wolf_fur",
  23. bloco="nssm:bloco_skin",
  24. croco="nssm:crocodile_skin",
  25. ant="nssm:ant_hard_skin",
  26. ice="nssm:little_ice_tooth",
  27. felucco="nssm:felucco_fur",
  28. manticore="nssm:manticore_fur",
  29. duck="nssm:duck_feather",
  30. black_duck="nssm:black_duck_feather",
  31. mor= "nssm:lustful_moranga",
  32. sandbloco= "nssm:sand_bloco_skin",
  33. sandworm="nssm:sandworm_skin",
  34. sky="nssm:sky_iron",
  35. web="nssm:web_string",
  36. denseweb="nssm:dense_web_string",
  37. }
  38. for k, v in pairs(stats) do
  39. minetest.register_tool("nssm:helmet_"..k, {
  40. description = v.name.." Helmet",
  41. inventory_image ="inv_helmet_"..k..".png",
  42. groups = {armor_head=math.floor(4*v.armor), armor_heal=v.heal, armor_use=v.use},
  43. wear = 0,
  44. })
  45. minetest.register_tool("nssm:chestplate_"..k, {
  46. description = v.name.." Chestplate",
  47. inventory_image ="inv_chestplate_"..k..".png",
  48. groups = {armor_torso=math.floor(6*v.armor), armor_heal=v.heal, armor_use=v.use},
  49. wear = 0,
  50. })
  51. minetest.register_tool("nssm:leggings_"..k, {
  52. description = v.name.." Leggings",
  53. inventory_image = "inv_leggings_"..k..".png",
  54. groups = {armor_legs=math.floor(5*v.armor), armor_heal=v.heal, armor_use=v.use},
  55. wear = 0,
  56. })
  57. minetest.register_tool("nssm:boots_"..k, {
  58. description = v.name.." Boots",
  59. inventory_image ="inv_boots_"..k..".png",
  60. groups = {armor_feet=math.floor(3*v.armor), armor_heal=v.heal, armor_use=v.use},
  61. wear = 0,
  62. })
  63. end
  64. for k, v in pairs(materials) do
  65. minetest.register_craft({
  66. output = "nssm:helmet_"..k,
  67. recipe = {
  68. {v, v, v},
  69. {v, "", v},
  70. {"", "", ""},
  71. },
  72. })
  73. minetest.register_craft({
  74. output = "nssm:chestplate_"..k,
  75. recipe = {
  76. {v, "", v},
  77. {v, v, v},
  78. {v, v, v},
  79. },
  80. })
  81. minetest.register_craft({
  82. output = "nssm:leggings_"..k,
  83. recipe = {
  84. {v, v, v},
  85. {v, "", v},
  86. {v, "", v},
  87. },
  88. })
  89. minetest.register_craft({
  90. output = "nssm:boots_"..k,
  91. recipe = {
  92. {v, "", v},
  93. {v, "", v},
  94. },
  95. })
  96. end
  97. --shields
  98. if minetest.get_modpath("shields") then
  99. local stats = {
  100. crab = {name="Crab", armor=4, heal=0, use=500},
  101. ice ={name="Ice Teeth", armor=3.5, heal=0, use=600},
  102. mor ={name="Morlu", armor=5, use=100},
  103. masticone ={name="Masticone", armor=4.5, use=300},
  104. mantis ={name="Mantis", armor=3, use=500},
  105. }
  106. local materials = {
  107. crab="nssm:crab_carapace_fragment",
  108. ice="nssm:little_ice_tooth",
  109. mor="nssm:lustful_moranga",
  110. masticone="nssm:masticone_skull_fragments",
  111. mantis="nssm:mantis_skin",
  112. }
  113. for k, v in pairs(stats) do
  114. minetest.register_tool("nssm:shield_"..k, {
  115. description = v.name.." Shield",
  116. inventory_image ="inv_shield_"..k..".png",
  117. groups = {armor_head=math.floor(5*v.armor), armor_heal=v.heal, armor_use=v.use},
  118. wear = 0,
  119. })
  120. local m = materials[k]
  121. minetest.register_craft({
  122. output = "nssm:shield_"..k,
  123. recipe = {
  124. {m, m, m},
  125. {m, m, m},
  126. {"", m, ""},
  127. },
  128. })
  129. end
  130. end
  131. --Special objects (pumpking helmet, masticone helmet, crowned masticone helmet, crown,)
  132. local stats = {
  133. pumpking = {name="Pumpking Head", armor=4, heal=0, use=100},
  134. masticone ={name="Masticone Head", armor=4, heal=0, use=100},
  135. crown ={name="Dukking Crown", armor=2, heal=0, use=50},
  136. masticone_crowned ={name="Masticone Crowned Head", armor=6, heal=0, use=20},
  137. }
  138. for k, v in pairs(stats) do
  139. minetest.register_tool("nssm:helmet_"..k, {
  140. description = v.name.." ",
  141. inventory_image ="inv_helmet_"..k..".png",
  142. groups = {armor_shield=math.floor(5*v.armor), armor_heal=v.heal, armor_use=v.use},
  143. wear = 0,
  144. })
  145. minetest.register_tool("nssm:chestplate_snake", {
  146. description = "Snake Scute Chestplate",
  147. inventory_image ="inv_chestplate_snake.png",
  148. groups = {armor_torso=40, armor_heal=0, armor_use=100},
  149. wear = 0,
  150. })
  151. end
  152. minetest.register_craft({
  153. output = "nssm:chestplate_snake",
  154. recipe = {
  155. {"default:steel_ingot", "", "default:steel_ingot"},
  156. {"default:steel_ingot", "nssm:snake_scute", "default:steel_ingot"},
  157. {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
  158. },
  159. })
  160. minetest.register_craft({
  161. output = "nssm:helmet_masticone",
  162. recipe = {
  163. {"nssm:masticone_skull_fragments", "nssm:masticone_skull_fragments", "nssm:masticone_skull_fragments"},
  164. {"nssm:masticone_skull_fragments", "nssm:masticone_skull_fragments", "nssm:masticone_skull_fragments"},
  165. {"nssm:masticone_skull_fragments", "nssm:masticone_skull_fragments", "nssm:masticone_skull_fragments"},
  166. },
  167. })
  168. minetest.register_craft({
  169. output = "nssm:helmet_masticone_crowned",
  170. recipe = {
  171. {"", "nssm:helmet_crown", ""},
  172. {"", "nssm:helmet_masticone", ""},
  173. {"", "", ""},
  174. },
  175. })