items.lua 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. minetest.register_craft({output = "default:flint",recipe = {{"default:gravel"},}})
  2. minetest.register_craft({output = "farming:cotton 4",recipe = {{"group:wool"},}})
  3. bows.register_bow("bow_wood",{
  4. description = "Wooden bow",
  5. texture = "bows_bow.png",
  6. texture_loaded = "bows_bow_loaded.png",
  7. uses = 50,
  8. level = 1,
  9. craft = {
  10. {"", "group:stick", "farming:string"},
  11. {"group:stick", "", "farming:string"},
  12. {"", "group:stick", "farming:string"}
  13. },
  14. })
  15. minetest.register_craft({
  16. type = "fuel",
  17. recipe = "bows:bow_wood",
  18. burntime = 3,
  19. })
  20. bows.register_bow("bow_steel",{
  21. description = "Steel bow",
  22. texture = "bows_bow_steel.png",
  23. texture_loaded = "bows_bow_loaded_steel.png",
  24. uses = 280, --140,
  25. level = 5, --8,
  26. craft = {
  27. {"", "default:steel_ingot", "farming:string"},
  28. {"default:steel_ingot", "", "farming:string"},
  29. {"", "default:steel_ingot", "farming:string"}
  30. },
  31. })
  32. bows.register_bow("bow_bronze",{
  33. description = "Bronze bow",
  34. texture = "bows_bow_bronze.png",
  35. texture_loaded = "bows_bow_loaded_bronze.png",
  36. uses = 140, --280,
  37. level = 3, --10,
  38. craft = {
  39. {"", "default:bronze_ingot", "farming:string"},
  40. {"default:bronze_ingot", "", "farming:string"},
  41. {"", "default:bronze_ingot", "farming:string"}
  42. },
  43. })
  44. bows.register_bow("bow_bowie",{
  45. description = "David BOWie",
  46. texture = "bows_bow_bowie.png",
  47. texture_loaded = "bows_bow_loaded_bowie.png",
  48. uses = 500,
  49. level = 7,
  50. })
  51. bows.register_arrow("arrow",{
  52. description = "Arrow",
  53. texture = "bows_arrow_wood.png",
  54. damage = 5,
  55. craft_count = 4,
  56. craft = {
  57. {"default:flint", "group:stick", bows.feather}
  58. },
  59. --[[
  60. on_hit_node = function(self, pos, user, arrow_pos)
  61. minetest.add_particle({
  62. pos = pos,
  63. velocity = {x=0, y=0, z=0},
  64. acceleration = {x=0, y=0, z=0},
  65. expirationtime = 1,
  66. size = 4,
  67. collisiondetection = false,
  68. vertical = false,
  69. texture = "heart.png",
  70. })
  71. end,
  72. ]]
  73. })
  74. minetest.register_craft({
  75. type = "fuel",
  76. recipe = "bows:arrow",
  77. burntime = 1,
  78. })
  79. bows.register_arrow("arrow_steel",{
  80. description = "Steel arrow",
  81. texture = "bows_arrow_wood.png^[colorize:#FFFFFFcc",
  82. damage = 8,
  83. craft_count = 4,
  84. craft = {
  85. {"default:steel_ingot", "group:stick", bows.feather}
  86. },
  87. on_hit_object = function(self, target, hp, user, lastpos)
  88. if target and target:get_luaentity().name == "mob_horse:horse" then
  89. print ("--- aww da horsey!!!")
  90. end
  91. end,
  92. })
  93. bows.register_arrow("arrow_mese",{
  94. description = "Mese arrow",
  95. texture = "bows_arrow_wood.png^[colorize:#e3ff00cc",
  96. damage = 12,
  97. craft_count = 4,
  98. craft = {
  99. {"default:mese_crystal", "group:stick", bows.feather}
  100. },
  101. on_hit_node = function(self, pos, user, arrow_pos)
  102. if self.node.name == "mesecons_switch:mesecon_switch_on"
  103. or self.node.name == "mesecons_switch:mesecon_switch_off" then
  104. local def = minetest.registered_nodes[self.node.name]
  105. -- This toggles the mesecons switch on/off
  106. if def and def.on_rightclick then
  107. def.on_rightclick(vector.round(pos), self.node, user)
  108. end
  109. end
  110. end,
  111. })
  112. bows.register_arrow("arrow_diamond",{
  113. description = "Diamond arrow",
  114. texture = "bows_arrow_wood.png^[colorize:#15d7c2cc",
  115. damage = 15,
  116. craft_count = 4,
  117. craft = {
  118. {"default:diamond", "group:stick", bows.feather}
  119. },
  120. on_hit_node = function(self, pos, user, arrow_pos)
  121. if self.node.name == "default:glass"
  122. and not minetest.is_protected(pos, user:get_player_name()) then
  123. minetest.sound_play("default_break_glass", {
  124. pos = pos, gain = 1.0, max_hear_distance = 10})
  125. minetest.remove_node(pos)
  126. minetest.add_item(pos, "vessels:glass_fragments")
  127. end
  128. end,
  129. })