armor.lua 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373
  1. -- support for i18n
  2. local S = armor.get_translator
  3. armor:register_armor("3d_armor:helmet_admin", {
  4. description = S("Admin Helmet"),
  5. inventory_image = "3d_armor_inv_helmet_admin.png",
  6. armor_groups = {fleshy=100},
  7. groups = {armor_head=1, armor_heal=100, armor_use=0, armor_water=1,
  8. not_in_creative_inventory=1},
  9. on_drop = function(itemstack, dropper, pos)
  10. return
  11. end,
  12. })
  13. armor:register_armor("3d_armor:chestplate_admin", {
  14. description = S("Admin Chestplate"),
  15. inventory_image = "3d_armor_inv_chestplate_admin.png",
  16. armor_groups = {fleshy=100},
  17. groups = {armor_torso=1, armor_heal=100, armor_use=0,
  18. not_in_creative_inventory=1},
  19. on_drop = function(itemstack, dropper, pos)
  20. return
  21. end,
  22. })
  23. armor:register_armor("3d_armor:leggings_admin", {
  24. description = S("Admin Leggings"),
  25. inventory_image = "3d_armor_inv_leggings_admin.png",
  26. armor_groups = {fleshy=100},
  27. groups = {armor_legs=1, armor_heal=100, armor_use=0,
  28. not_in_creative_inventory=1},
  29. on_drop = function(itemstack, dropper, pos)
  30. return
  31. end,
  32. })
  33. armor:register_armor("3d_armor:boots_admin", {
  34. description = S("Admin Boots"),
  35. inventory_image = "3d_armor_inv_boots_admin.png",
  36. armor_groups = {fleshy=100},
  37. groups = {armor_feet=1, armor_heal=100, armor_use=0,
  38. not_in_creative_inventory=1},
  39. on_drop = function(itemstack, dropper, pos)
  40. return
  41. end,
  42. })
  43. minetest.register_alias("adminboots", "3d_armor:boots_admin")
  44. minetest.register_alias("adminhelmet", "3d_armor:helmet_admin")
  45. minetest.register_alias("adminchestplate", "3d_armor:chestplate_admin")
  46. minetest.register_alias("adminleggings", "3d_armor:leggings_admin")
  47. if armor.materials.wood then
  48. armor:register_armor("3d_armor:helmet_wood", {
  49. description = S("Wood Helmet"),
  50. inventory_image = "3d_armor_inv_helmet_wood.png",
  51. groups = {armor_head=1, armor_heal=0, armor_use=2000, flammable=1},
  52. armor_groups = {fleshy=5},
  53. damage_groups = {cracky=3, snappy=2, choppy=3, crumbly=2, level=1},
  54. })
  55. armor:register_armor("3d_armor:chestplate_wood", {
  56. description = S("Wood Chestplate"),
  57. inventory_image = "3d_armor_inv_chestplate_wood.png",
  58. groups = {armor_torso=1, armor_heal=0, armor_use=2000, flammable=1},
  59. armor_groups = {fleshy=10},
  60. damage_groups = {cracky=3, snappy=2, choppy=3, crumbly=2, level=1},
  61. })
  62. armor:register_armor("3d_armor:leggings_wood", {
  63. description = S("Wood Leggings"),
  64. inventory_image = "3d_armor_inv_leggings_wood.png",
  65. groups = {armor_legs=1, armor_heal=0, armor_use=2000, flammable=1},
  66. armor_groups = {fleshy=10},
  67. damage_groups = {cracky=3, snappy=2, choppy=3, crumbly=2, level=1},
  68. })
  69. armor:register_armor("3d_armor:boots_wood", {
  70. description = S("Wood Boots"),
  71. inventory_image = "3d_armor_inv_boots_wood.png",
  72. armor_groups = {fleshy=5},
  73. damage_groups = {cracky=3, snappy=2, choppy=3, crumbly=2, level=1},
  74. groups = {armor_feet=1, armor_heal=0, armor_use=2000, flammable=1},
  75. })
  76. local wood_armor_fuel = {
  77. helmet = 6,
  78. chestplate = 8,
  79. leggings = 7,
  80. boots = 5
  81. }
  82. for armor, burn in pairs(wood_armor_fuel) do
  83. minetest.register_craft({
  84. type = "fuel",
  85. recipe = "3d_armor:" .. armor .. "_wood",
  86. burntime = burn,
  87. })
  88. end
  89. end
  90. if armor.materials.cactus then
  91. armor:register_armor("3d_armor:helmet_cactus", {
  92. description = S("Cactus Helmet"),
  93. inventory_image = "3d_armor_inv_helmet_cactus.png",
  94. groups = {armor_head=1, armor_heal=0, armor_use=1000},
  95. armor_groups = {fleshy=5},
  96. damage_groups = {cracky=3, snappy=3, choppy=2, crumbly=2, level=1},
  97. })
  98. armor:register_armor("3d_armor:chestplate_cactus", {
  99. description = S("Cactus Chestplate"),
  100. inventory_image = "3d_armor_inv_chestplate_cactus.png",
  101. groups = {armor_torso=1, armor_heal=0, armor_use=1000},
  102. armor_groups = {fleshy=10},
  103. damage_groups = {cracky=3, snappy=3, choppy=2, crumbly=2, level=1},
  104. })
  105. armor:register_armor("3d_armor:leggings_cactus", {
  106. description = S("Cactus Leggings"),
  107. inventory_image = "3d_armor_inv_leggings_cactus.png",
  108. groups = {armor_legs=1, armor_heal=0, armor_use=1000},
  109. armor_groups = {fleshy=10},
  110. damage_groups = {cracky=3, snappy=3, choppy=2, crumbly=2, level=1},
  111. })
  112. armor:register_armor("3d_armor:boots_cactus", {
  113. description = S("Cactus Boots"),
  114. inventory_image = "3d_armor_inv_boots_cactus.png",
  115. groups = {armor_feet=1, armor_heal=0, armor_use=1000},
  116. armor_groups = {fleshy=5},
  117. damage_groups = {cracky=3, snappy=3, choppy=2, crumbly=2, level=1},
  118. })
  119. local cactus_armor_fuel = {
  120. helmet = 14,
  121. chestplate = 16,
  122. leggings = 15,
  123. boots = 13
  124. }
  125. for armor, burn in pairs(cactus_armor_fuel) do
  126. minetest.register_craft({
  127. type = "fuel",
  128. recipe = "3d_armor:" .. armor .. "_cactus",
  129. burntime = burn,
  130. })
  131. end
  132. end
  133. if armor.materials.steel then
  134. armor:register_armor("3d_armor:helmet_steel", {
  135. description = S("Steel Helmet"),
  136. inventory_image = "3d_armor_inv_helmet_steel.png",
  137. groups = {armor_head=1, armor_heal=0, armor_use=800,
  138. physics_speed=-0.01, physics_gravity=0.01},
  139. armor_groups = {fleshy=10},
  140. damage_groups = {cracky=2, snappy=3, choppy=2, crumbly=1, level=2},
  141. })
  142. armor:register_armor("3d_armor:chestplate_steel", {
  143. description = S("Steel Chestplate"),
  144. inventory_image = "3d_armor_inv_chestplate_steel.png",
  145. groups = {armor_torso=1, armor_heal=0, armor_use=800,
  146. physics_speed=-0.04, physics_gravity=0.04},
  147. armor_groups = {fleshy=15},
  148. damage_groups = {cracky=2, snappy=3, choppy=2, crumbly=1, level=2},
  149. })
  150. armor:register_armor("3d_armor:leggings_steel", {
  151. description = S("Steel Leggings"),
  152. inventory_image = "3d_armor_inv_leggings_steel.png",
  153. groups = {armor_legs=1, armor_heal=0, armor_use=800,
  154. physics_speed=-0.03, physics_gravity=0.03},
  155. armor_groups = {fleshy=15},
  156. damage_groups = {cracky=2, snappy=3, choppy=2, crumbly=1, level=2},
  157. })
  158. armor:register_armor("3d_armor:boots_steel", {
  159. description = S("Steel Boots"),
  160. inventory_image = "3d_armor_inv_boots_steel.png",
  161. groups = {armor_feet=1, armor_heal=0, armor_use=800,
  162. physics_speed=-0.01, physics_gravity=0.01},
  163. armor_groups = {fleshy=10},
  164. damage_groups = {cracky=2, snappy=3, choppy=2, crumbly=1, level=2},
  165. })
  166. end
  167. if armor.materials.bronze then
  168. armor:register_armor("3d_armor:helmet_bronze", {
  169. description = S("Bronze Helmet"),
  170. inventory_image = "3d_armor_inv_helmet_bronze.png",
  171. groups = {armor_head=1, armor_heal=6, armor_use=400,
  172. physics_speed=-0.01, physics_gravity=0.01},
  173. armor_groups = {fleshy=10},
  174. damage_groups = {cracky=3, snappy=2, choppy=2, crumbly=1, level=2},
  175. })
  176. armor:register_armor("3d_armor:chestplate_bronze", {
  177. description = S("Bronze Chestplate"),
  178. inventory_image = "3d_armor_inv_chestplate_bronze.png",
  179. groups = {armor_torso=1, armor_heal=6, armor_use=400,
  180. physics_speed=-0.04, physics_gravity=0.04},
  181. armor_groups = {fleshy=15},
  182. damage_groups = {cracky=3, snappy=2, choppy=2, crumbly=1, level=2},
  183. })
  184. armor:register_armor("3d_armor:leggings_bronze", {
  185. description = S("Bronze Leggings"),
  186. inventory_image = "3d_armor_inv_leggings_bronze.png",
  187. groups = {armor_legs=1, armor_heal=6, armor_use=400,
  188. physics_speed=-0.03, physics_gravity=0.03},
  189. armor_groups = {fleshy=15},
  190. damage_groups = {cracky=3, snappy=2, choppy=2, crumbly=1, level=2},
  191. })
  192. armor:register_armor("3d_armor:boots_bronze", {
  193. description = S("Bronze Boots"),
  194. inventory_image = "3d_armor_inv_boots_bronze.png",
  195. groups = {armor_feet=1, armor_heal=6, armor_use=400,
  196. physics_speed=-0.01, physics_gravity=0.01},
  197. armor_groups = {fleshy=10},
  198. damage_groups = {cracky=3, snappy=2, choppy=2, crumbly=1, level=2},
  199. })
  200. end
  201. if armor.materials.diamond then
  202. armor:register_armor("3d_armor:helmet_diamond", {
  203. description = S("Diamond Helmet"),
  204. inventory_image = "3d_armor_inv_helmet_diamond.png",
  205. groups = {armor_head=1, armor_heal=12, armor_use=200},
  206. armor_groups = {fleshy=15},
  207. damage_groups = {cracky=2, snappy=1, choppy=1, level=3},
  208. })
  209. armor:register_armor("3d_armor:chestplate_diamond", {
  210. description = S("Diamond Chestplate"),
  211. inventory_image = "3d_armor_inv_chestplate_diamond.png",
  212. groups = {armor_torso=1, armor_heal=12, armor_use=200},
  213. armor_groups = {fleshy=20},
  214. damage_groups = {cracky=2, snappy=1, choppy=1, level=3},
  215. })
  216. armor:register_armor("3d_armor:leggings_diamond", {
  217. description = S("Diamond Leggings"),
  218. inventory_image = "3d_armor_inv_leggings_diamond.png",
  219. groups = {armor_legs=1, armor_heal=12, armor_use=200},
  220. armor_groups = {fleshy=20},
  221. damage_groups = {cracky=2, snappy=1, choppy=1, level=3},
  222. })
  223. armor:register_armor("3d_armor:boots_diamond", {
  224. description = S("Diamond Boots"),
  225. inventory_image = "3d_armor_inv_boots_diamond.png",
  226. groups = {armor_feet=1, armor_heal=12, armor_use=200},
  227. armor_groups = {fleshy=15},
  228. damage_groups = {cracky=2, snappy=1, choppy=1, level=3},
  229. })
  230. end
  231. if armor.materials.gold then
  232. armor:register_armor("3d_armor:helmet_gold", {
  233. description = S("Gold Helmet"),
  234. inventory_image = "3d_armor_inv_helmet_gold.png",
  235. groups = {armor_head=1, armor_heal=6, armor_use=300,
  236. physics_speed=-0.02, physics_gravity=0.02},
  237. armor_groups = {fleshy=10},
  238. damage_groups = {cracky=1, snappy=2, choppy=2, crumbly=3, level=2},
  239. })
  240. armor:register_armor("3d_armor:chestplate_gold", {
  241. description = S("Gold Chestplate"),
  242. inventory_image = "3d_armor_inv_chestplate_gold.png",
  243. groups = {armor_torso=1, armor_heal=6, armor_use=300,
  244. physics_speed=-0.05, physics_gravity=0.05},
  245. armor_groups = {fleshy=15},
  246. damage_groups = {cracky=1, snappy=2, choppy=2, crumbly=3, level=2},
  247. })
  248. armor:register_armor("3d_armor:leggings_gold", {
  249. description = S("Gold Leggings"),
  250. inventory_image = "3d_armor_inv_leggings_gold.png",
  251. groups = {armor_legs=1, armor_heal=6, armor_use=300,
  252. physics_speed=-0.04, physics_gravity=0.04},
  253. armor_groups = {fleshy=15},
  254. damage_groups = {cracky=1, snappy=2, choppy=2, crumbly=3, level=2},
  255. })
  256. armor:register_armor("3d_armor:boots_gold", {
  257. description = S("Gold Boots"),
  258. inventory_image = "3d_armor_inv_boots_gold.png",
  259. groups = {armor_feet=1, armor_heal=6, armor_use=300,
  260. physics_speed=-0.02, physics_gravity=0.02},
  261. armor_groups = {fleshy=10},
  262. damage_groups = {cracky=1, snappy=2, choppy=2, crumbly=3, level=2},
  263. })
  264. end
  265. if armor.materials.mithril then
  266. armor:register_armor("3d_armor:helmet_mithril", {
  267. description = S("Mithril Helmet"),
  268. inventory_image = "3d_armor_inv_helmet_mithril.png",
  269. groups = {armor_head=1, armor_heal=12, armor_use=100},
  270. armor_groups = {fleshy=15},
  271. damage_groups = {cracky=2, snappy=1, level=3},
  272. })
  273. armor:register_armor("3d_armor:chestplate_mithril", {
  274. description = S("Mithril Chestplate"),
  275. inventory_image = "3d_armor_inv_chestplate_mithril.png",
  276. groups = {armor_torso=1, armor_heal=12, armor_use=100},
  277. armor_groups = {fleshy=20},
  278. damage_groups = {cracky=2, snappy=1, level=3},
  279. })
  280. armor:register_armor("3d_armor:leggings_mithril", {
  281. description = S("Mithril Leggings"),
  282. inventory_image = "3d_armor_inv_leggings_mithril.png",
  283. groups = {armor_legs=1, armor_heal=12, armor_use=100},
  284. armor_groups = {fleshy=20},
  285. damage_groups = {cracky=2, snappy=1, level=3},
  286. })
  287. armor:register_armor("3d_armor:boots_mithril", {
  288. description = S("Mithril Boots"),
  289. inventory_image = "3d_armor_inv_boots_mithril.png",
  290. groups = {armor_feet=1, armor_heal=12, armor_use=100},
  291. armor_groups = {fleshy=15},
  292. damage_groups = {cracky=2, snappy=1, level=3},
  293. })
  294. end
  295. if armor.materials.crystal then
  296. armor:register_armor("3d_armor:helmet_crystal", {
  297. description = S("Crystal Helmet"),
  298. inventory_image = "3d_armor_inv_helmet_crystal.png",
  299. groups = {armor_head=1, armor_heal=12, armor_use=100, armor_fire=1},
  300. armor_groups = {fleshy=15},
  301. damage_groups = {cracky=2, snappy=1, level=3},
  302. })
  303. armor:register_armor("3d_armor:chestplate_crystal", {
  304. description = S("Crystal Chestplate"),
  305. inventory_image = "3d_armor_inv_chestplate_crystal.png",
  306. groups = {armor_torso=1, armor_heal=12, armor_use=100, armor_fire=1},
  307. armor_groups = {fleshy=20},
  308. damage_groups = {cracky=2, snappy=1, level=3},
  309. })
  310. armor:register_armor("3d_armor:leggings_crystal", {
  311. description = S("Crystal Leggings"),
  312. inventory_image = "3d_armor_inv_leggings_crystal.png",
  313. groups = {armor_legs=1, armor_heal=12, armor_use=100, armor_fire=1},
  314. armor_groups = {fleshy=20},
  315. damage_groups = {cracky=2, snappy=1, level=3},
  316. })
  317. armor:register_armor("3d_armor:boots_crystal", {
  318. description = S("Crystal Boots"),
  319. inventory_image = "3d_armor_inv_boots_crystal.png",
  320. groups = {armor_feet=1, armor_heal=12, armor_use=100, physics_speed=1,
  321. physics_jump=0.5, armor_fire=1},
  322. armor_groups = {fleshy=15},
  323. damage_groups = {cracky=2, snappy=1, level=3},
  324. })
  325. end
  326. for k, v in pairs(armor.materials) do
  327. minetest.register_craft({
  328. output = "3d_armor:helmet_"..k,
  329. recipe = {
  330. {v, v, v},
  331. {v, "", v},
  332. {"", "", ""},
  333. },
  334. })
  335. minetest.register_craft({
  336. output = "3d_armor:chestplate_"..k,
  337. recipe = {
  338. {v, "", v},
  339. {v, v, v},
  340. {v, v, v},
  341. },
  342. })
  343. minetest.register_craft({
  344. output = "3d_armor:leggings_"..k,
  345. recipe = {
  346. {v, v, v},
  347. {v, "", v},
  348. {v, "", v},
  349. },
  350. })
  351. minetest.register_craft({
  352. output = "3d_armor:boots_"..k,
  353. recipe = {
  354. {v, "", v},
  355. {v, "", v},
  356. },
  357. })
  358. end