music.lua 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. minetest.register_node("lottblocks:dwarf_harp", {
  2. description = "Dwarvern Harp",
  3. tiles = {"lottblocks_harp1.png", "lottblocks_harp2.png", "lottblocks_harp3.png", "lottblocks_harp4.png", "lottblocks_harp5.png", "lottblocks_harp6.png"},
  4. drawtype = "nodebox",
  5. paramtype = "light",
  6. paramtype2 = "facedir",
  7. on_punch = function(pos)
  8. minetest.sound_play("lottblocks_harp", {
  9. pos=pos,
  10. max_hear_distance = 12,
  11. gain = 1,
  12. })
  13. end,
  14. node_box = {
  15. type = "fixed",
  16. fixed = {
  17. {-0.3125, -0.5, -0.0625, 0.125, -0.375, 0.125}, -- NodeBox1
  18. {-0.1875, -0.375, -0.0625, 0.1875, -0.25, 0.125}, -- NodeBox2
  19. {-0.0625, -0.25, -0.0625, 0.25, -0.125, 0.125}, -- NodeBox3
  20. {0.0625, -0.125, -0.0625, 0.3125, 0, 0.125}, -- NodeBox4
  21. {0.1875, -0.0625, -0.0625, 0.375, 0.125, 0.125}, -- NodeBox5
  22. {0.3125, 0.0625, -0.0625, 0.4375, 0.25, 0.125}, -- NodeBox6
  23. {0.4375, 0.25, -0.0625, 0.5, 0.375, 0.125}, -- NodeBox7
  24. {0.375, 0.375, -0.0625, 0.4375, 0.4375, 0.125}, -- NodeBox8
  25. {-0.1875, 0.4375, -0.0625, 0.375, 0.5, 0.125}, -- NodeBox9
  26. {-0.375, -0.375, -0.0625, -0.3125, -0.3125, 0.125}, -- NodeBox10
  27. {-0.4375, -0.3125, -0.0625, -0.375, 0.25, 0.125}, -- NodeBox11
  28. {-0.375, 0.25, -0.0625, -0.3125, 0.3125, 0.125}, -- NodeBox12
  29. {-0.3125, 0.3125, -0.0625, -0.25, 0.375, 0.125}, -- NodeBox13
  30. {-0.25, 0.375, -0.0625, -0.1875, 0.4375, 0.125}, -- NodeBox14
  31. {-0.3125, -0.375, 0, -0.25, 0.3125, 0.0625}, -- NodeBox15
  32. {-0.1875, -0.25, 0, -0.125, 0.4375, 0.0625}, -- NodeBox16
  33. {-0.0625, -0.125, 0, 0, 0.4375, 0.0625}, -- NodeBox17
  34. {0.0625, 0, 0, 0.125, 0.4375, 0.0625}, -- NodeBox18
  35. {0.1875, 0.09375, 0, 0.25, 0.4375, 0.0625}, -- NodeBox19
  36. {0.3125, 0.25, 0, 0.375, 0.4375, 0.0625}, -- NodeBox20
  37. }
  38. },
  39. selection_box = {
  40. type = "fixed",
  41. fixed = {
  42. {-0.5, -0.5, -0.0625, 0.5, 0.5, 0.125}, -- NodeBox1
  43. }
  44. },
  45. groups = {instrument=1, cracky=1}
  46. })
  47. minetest.register_craftitem("lottblocks:dwarf_harp_strings", {
  48. description = "Dwarvern Harp Strings",
  49. inventory_image = "lottblocks_harp_strings.png",
  50. })
  51. minetest.register_craft({
  52. output = "lottblocks:dwarf_harp_strings",
  53. recipe = {
  54. {"farming:string", "lottores:silver_ingot", "farming:string"},
  55. {"farming:string", "lottores:silver_ingot", "farming:string"},
  56. {"farming:string", "lottores:silver_ingot", "farming:string"}
  57. }
  58. })
  59. minetest.register_craft({
  60. output = "lottblocks:dwarf_harp",
  61. recipe = {
  62. {"", "default:gold_ingot", ""},
  63. {"default:gold_ingot", "lottblocks:dwarf_harp_strings", "default:gold_ingot"},
  64. {"default:gold_ingot", "default:gold_ingot", ""}
  65. }
  66. })
  67. local whistle = {
  68. {"birch", "D", "lottplants:birchwood"},
  69. {"mallorn", "Eb", "lottplants:mallornwood"},
  70. {"wood", "C", "default:wood"},
  71. {"jungle", "G", "default:junglewood"},
  72. {"pine", "Bb", "lottplants:pinewood"},
  73. {"lebethron", "A", "lottplants:lebethronwood"},
  74. {"alder", "F", "lottplants:alderwood"},
  75. }
  76. for _, row in ipairs(whistle) do
  77. local wood = row[1]
  78. local note = row[2]
  79. local craftwood = row[3]
  80. minetest.register_craftitem("lottblocks:whistle_" .. wood, {
  81. description = wood:gsub("^%l", string.upper) .. " (Note " .. note .. ") Whistle",
  82. inventory_image = "lottblocks_" .. wood .. "_whistle.png",
  83. on_use = function(itemstack, user)
  84. minetest.sound_play(note, {
  85. pos = user:getpos(),
  86. max_hear_distance = 7,
  87. gain = 1,
  88. })
  89. end,
  90. groups = {instrument=1}
  91. })
  92. minetest.register_craft({
  93. output = "lottblocks:whistle_" .. wood,
  94. recipe = {
  95. {craftwood, "", ""},
  96. {"", craftwood, ""},
  97. {"", "", "lottores:silver_ingot"}
  98. }
  99. })
  100. end
  101. --Gong
  102. minetest.register_node("lottblocks:gong", {
  103. description = "Gong",
  104. tiles = {"default_bronze_block.png"},
  105. drawtype = "nodebox",
  106. paramtype = "light",
  107. paramtype2 = "facedir",
  108. on_punch = function(pos)
  109. minetest.sound_play("gong", {
  110. pos=pos,
  111. max_hear_distance = 48,
  112. gain = 1,
  113. })
  114. end,
  115. node_box = {
  116. type = "fixed",
  117. fixed = {
  118. {-0.5, 0.4375, -0.0625, 0.5, 0.5, 0.0625}, -- NodeBox1
  119. {0.4375, -0.5, -0.0625, 0.5, 0.5, 0.0625}, -- NodeBox2
  120. {-0.5, -0.5, -0.0625, -0.4375, 0.5, 0.0625}, -- NodeBox3
  121. {-0.1875, -0.1875, -0.0625, 0.1875, 0.1875, 0}, -- NodeBox5
  122. {-0.375, -0.3125, 0, -0.1875, 0.3125, 0.0625}, -- NodeBox6
  123. {0.125, -0.3125, 0, 0.3125, 0.3125, 0.0625}, -- NodeBox7
  124. {-0.3125, 0.125, 0, 0.3125, 0.3125, 0.0625}, -- NodeBox8
  125. {-0.375, -0.3125, 0, 0.3125, -0.125, 0.0625}, -- NodeBox9
  126. {-0.3125, 0.25, 0, -0.25, 0.5, 0.0625}, -- NodeBox10
  127. {0.1875, 0.25, 0, 0.25, 0.5, 0.0625}, -- NodeBox11
  128. }
  129. },
  130. selection_box = {
  131. type = "fixed",
  132. fixed = {
  133. {-0.5, -0.5, -0.0625, 0.5, 0.5, 0.125}, -- NodeBox1
  134. }
  135. },
  136. groups = {instrument=1, cracky=1}
  137. })
  138. minetest.register_craftitem("lottblocks:bronze_gong", {
  139. description = "Bronze Gong",
  140. inventory_image = "lottblocks_gong.png",
  141. })
  142. minetest.register_craft({
  143. output = "lottblocks:bronze_gong",
  144. recipe = {
  145. {"", "default:bronze_ingot", ""},
  146. {"default:bronze_ingot", "default:bronze_ingot", "default:bronze_ingot"},
  147. {"", "default:bronze_ingot", ""}
  148. }
  149. })
  150. minetest.register_craft({
  151. output = "lottblocks:gong",
  152. recipe = {
  153. {"default:stick", "default:stick", "default:stick"},
  154. {"default:stick", "lottblocks:bronze_gong", "default:stick"},
  155. {"default:stick", "", "default:stick"}
  156. }
  157. })