items.lua 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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. drop_chance = 10,
  57. craft = {
  58. {"default:flint", "group:stick", bows.feather}
  59. },
  60. --[[
  61. on_hit_node = function(self, pos, user, arrow_pos)
  62. minetest.add_particle({
  63. pos = pos,
  64. velocity = {x=0, y=0, z=0},
  65. acceleration = {x=0, y=0, z=0},
  66. expirationtime = 1,
  67. size = 4,
  68. collisiondetection = false,
  69. vertical = false,
  70. texture = "heart.png",
  71. })
  72. end,
  73. ]]
  74. })
  75. minetest.register_craft({
  76. type = "fuel",
  77. recipe = "bows:arrow",
  78. burntime = 1,
  79. })
  80. bows.register_arrow("arrow_steel",{
  81. description = "Steel arrow",
  82. texture = "bows_arrow_wood.png^[colorize:#FFFFFFcc",
  83. damage = 8,
  84. craft_count = 4,
  85. drop_chance = 8,
  86. craft = {
  87. {"default:steel_ingot", "group:stick", bows.feather}
  88. },
  89. on_hit_object = function(self, target, hp, user, lastpos)
  90. if target
  91. and target:get_luaentity()
  92. and target:get_luaentity().name
  93. and target:get_luaentity().name == "mob_horse:horse" then
  94. print ("--- aww da horsey!!!")
  95. end
  96. end,
  97. })
  98. bows.register_arrow("arrow_mese",{
  99. description = "Mese arrow",
  100. texture = "bows_arrow_wood.png^[colorize:#e3ff00cc",
  101. damage = 12,
  102. craft_count = 4,
  103. drop_chance = 6,
  104. craft = {
  105. {"default:mese_crystal", "group:stick", bows.feather}
  106. },
  107. on_hit_node = function(self, pos, user, arrow_pos)
  108. if self.node.name == "mesecons_switch:mesecon_switch_on"
  109. or self.node.name == "mesecons_switch:mesecon_switch_off" then
  110. local def = minetest.registered_nodes[self.node.name]
  111. -- This toggles the mesecons switch on/off
  112. if def and def.on_rightclick then
  113. def.on_rightclick(vector.round(pos), self.node, user)
  114. end
  115. end
  116. end,
  117. })
  118. bows.register_arrow("arrow_diamond",{
  119. description = "Diamond arrow",
  120. texture = "bows_arrow_wood.png^[colorize:#15d7c2cc",
  121. damage = 15,
  122. craft_count = 4,
  123. drop_chance = 4,
  124. craft = {
  125. {"default:diamond", "group:stick", bows.feather}
  126. },
  127. on_hit_node = function(self, pos, user, arrow_pos)
  128. if self.node.name == "default:glass"
  129. and not minetest.is_protected(pos, user:get_player_name()) then
  130. minetest.sound_play("default_break_glass", {
  131. pos = pos, gain = 1.0, max_hear_distance = 10})
  132. minetest.remove_node(pos)
  133. minetest.add_item(pos, "vessels:glass_fragments")
  134. end
  135. end,
  136. })