Minetest mod that adds scifi themed nodes https://content.minetest.net/packages/D00Med/scifi_nodes/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

175 lines
8.2 KiB

  1. --some code taken from moreblocks(the collision and selection boxes), license below:
  2. --Copyright (c) 2011-2015 Calinou and contributors.
  3. --Licensed under the zlib license.
  4. function scifi_nodes.register_slope(name, desc, texture, light)
  5. minetest.register_node("scifi_nodes:slope_"..name, {
  6. description = desc.." Slope",
  7. sunlight_propagates = false,
  8. drawtype = "mesh",
  9. mesh = "scifi_nodes_slope.obj",
  10. tiles = texture,
  11. selection_box = {
  12. type = "fixed",
  13. fixed = {
  14. {-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
  15. {-0.5, -0.25, -0.25, 0.5, 0, 0.5},
  16. {-0.5, 0, 0, 0.5, 0.25, 0.5},
  17. {-0.5, 0.25, 0.25, 0.5, 0.5, 0.5}
  18. }
  19. },
  20. collision_box = {
  21. type = "fixed",
  22. fixed = {
  23. {-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
  24. {-0.5, -0.25, -0.25, 0.5, 0, 0.5},
  25. {-0.5, 0, 0, 0.5, 0.25, 0.5},
  26. {-0.5, 0.25, 0.25, 0.5, 0.5, 0.5}
  27. }
  28. },
  29. paramtype = "light",
  30. paramtype2 = "facedir",
  31. light_source = light,
  32. groups = {cracky=1},
  33. on_place = minetest.rotate_node
  34. })
  35. end
  36. -- register some blocks in stairsplus if available (part of moreblocks)
  37. scifi_nodes.register_slope("white2", "Plastic", {"scifi_nodes_white2.png",}, 0)
  38. scifi_nodes.register_slope("super_white", "Super Plastic", {"scifi_nodes_super_white.png",}, 11)
  39. scifi_nodes.register_slope("ultra_white", "Super Plastic", {"scifi_nodes_ultra_white.png",}, default.LIGHT_MAX)
  40. scifi_nodes.register_slope("black", "Black", {"scifi_nodes_black.png",}, 0)
  41. scifi_nodes.register_slope("white", "White", {"scifi_nodes_white.png",}, 0)
  42. scifi_nodes.register_slope("grey", "Grey", {"scifi_nodes_grey.png",}, 0)
  43. scifi_nodes.register_slope("bluebars", "Blue bars", {"scifi_nodes_bluebars.png",}, 0)
  44. scifi_nodes.register_slope("mesh2", "Metal floormesh", {"scifi_nodes_mesh2.png",}, 0)
  45. scifi_nodes.register_slope("mesh", "Metal mesh", {"scifi_nodes_mesh.png",}, 0)
  46. scifi_nodes.register_slope("vent", "Vent", {"scifi_nodes_vent2.png",}, 0)
  47. scifi_nodes.register_slope("rlight", "Red light", {"scifi_nodes_redlight.png",}, 10)
  48. scifi_nodes.register_slope("blight", "Blue light", {"scifi_nodes_light.png",}, 10)
  49. scifi_nodes.register_slope("glight", "Green light", {"scifi_nodes_greenlight.png",}, 10)
  50. scifi_nodes.register_slope("holes", "Holes", {"scifi_nodes_holes.png",}, 0)
  51. scifi_nodes.register_slope("pipe", "Pipe", {"scifi_nodes_pipe.png",}, 0)
  52. scifi_nodes.register_slope("stripes", "Stripes", {"scifi_nodes_stripes.png",}, 0)
  53. scifi_nodes.register_slope("screen", "Screen", {"scifi_nodes_screen3.png",}, 5)
  54. scifi_nodes.register_slope("lightstripe", "Lightstripe", {"scifi_nodes_lightstripe.png",}, default.LIGHT_MAX)
  55. scifi_nodes.register_slope("blight2", "Blue Light 2", {"scifi_nodes_capsule3.png",}, default.LIGHT_MAX)
  56. scifi_nodes.register_slope("wallpipe", "Alien Pipe", {"scifi_nodes_wallpipe.png",}, 0)
  57. scifi_nodes.register_slope("alien", "Alien Wall", {"scifi_nodes_alnslp.png",}, 0)
  58. scifi_nodes.register_slope("purple", "Purple", {"scifi_nodes_purple.png",}, 0)
  59. scifi_nodes.register_slope("gblock", "Gblock", {"scifi_nodes_gblock2_front1.png",}, 0)
  60. scifi_nodes.register_slope("greenmetal", "Green metal", {"scifi_nodes_greenmetal.png",}, 0)
  61. scifi_nodes.register_slope("bluemetal", "Blue metal", {"scifi_nodes_bluemetal.png",}, 0)
  62. scifi_nodes.register_slope("wall", "Metal wall", {"scifi_nodes_wall.png",}, 0)
  63. scifi_nodes.register_slope("rough", "Rough metal", {"scifi_nodes_rough.png",}, 0)
  64. scifi_nodes.register_slope("blklt2", "Black stripe light", {"scifi_nodes_black_light2.png",}, 10)
  65. -- Register Nodes for Stairsplus
  66. local node = {}
  67. node.types = {
  68. {"blue", "blue lines", "blue"},
  69. {"holes", "metal with holes","holes"},
  70. {"white2", "plastic", "white2"},
  71. {"super_white", "Super Plastic", "super_white", 11},
  72. {"ultra_white", "Ultra Plastic", "ultra_white", default.LIGHT_MAX},
  73. -- {"engine", "engine", "engine"},
  74. {"wall", "metal wall", "wall"},
  75. {"white", "plastic wall", "white"},
  76. {"stripes2top", "dirty metal block","metal2"},
  77. {"rough", "rough metal", "rough"},
  78. {"lighttop", "metal block", "metal"},
  79. {"red", "red lines", "red"},
  80. {"green", "green lines", "green"},
  81. {"vent2", "vent", "vent"},
  82. {"stripes", "hazard stripes", "stripes"},
  83. {"rust", "rusty metal", "rust"},
  84. {"mesh", "metal mesh", "mesh"},
  85. {"black", "black wall", "black"},
  86. {"blackoct", "black octagon", "blackoct"},
  87. {"blackpipe", "black pipe", "blackpipe"},
  88. {"blacktile", "black tile", "blktl"},
  89. {"blacktile2", "black tile 2", "blktl2"},
  90. {"blackvent", "black vent", "blkvnt"},
  91. {"bluebars", "blue bars", "bluebars"},
  92. {"bluemetal", "blue metal", "blumtl"},
  93. {"bluetile", "blue tile", "blutl"},
  94. {"greytile", "grey tile", "grytl"},
  95. {"mesh2", "metal floormesh", "mesh2"},
  96. {"white", "plastic wall", "white"},
  97. {"pipe", "wall pipe", "pipe2"},
  98. {"pipeside", "side pipe", "pipe3"},
  99. {"tile", "white tile", "tile"},
  100. {"whiteoct", "white octagon", "whiteoct"},
  101. {"whitetile", "white tile2", "whttl"},
  102. {"black_detail", "black detail", "blckdtl"},
  103. {"green_square", "green metal block", "grnblck"},
  104. {"red_square", "red metal block", "redblck"},
  105. {"grey_square", "grey metal block", "greyblck"},
  106. {"blue_square", "blue metal block", "blublck"},
  107. {"black_mesh", "black vent block", "blckmsh"},
  108. {"dent", "dented metal block", "dent"},
  109. {"greenmetal", "green metal wall", "grnmetl"},
  110. {"greenmetal2", "green metal wall2", "grnmetl2"},
  111. {"greenlights", "green wall lights", "grnlt", 10},
  112. {"greenlights2", "green wall lights2", "grnlt2", 10},
  113. {"greenbar", "green light bar", "grnlghtbr", 10},
  114. {"green2", "green wall panel", "grn2"},
  115. {"greentubes", "green pipes", "grntubes"},
  116. {"grey", "grey wall", "gry"},
  117. {"greybolts", "grey wall bolts", "gryblts"},
  118. {"greybars", "grey bars", "grybrs"},
  119. {"greydots", "grey wall dots", "grydts"},
  120. {"greygreenbar", "gray power pipe", "grygrnbr", 10},
  121. {"octofloor", "Doom floor", "octofloor"},
  122. {"octofloor2", "Brown Doom floor", "octofloor2"},
  123. {"doomwall1", "Doom wall 1", "doomwall1"},
  124. {"doomwall2", "Doom wall 2", "doomwall2"},
  125. {"doomwall3", "Doom wall 3", "doomwall3"},
  126. {"doomwall4", "Doom wall 4", "doomwall4"},
  127. {"doomwall41", "Doom wall 4.1", "doomwall4.1"},
  128. {"doomwall42", "Doom wall 4.2", "doomwall4.2"},
  129. {"doomwall43", "Doom wall 4.3", "doomwall4.3"},
  130. {"doomwall431", "Doom wall 4.3.1", "doomwall4.3.1"},
  131. {"doomwall44", "Doom wall 4.4", "doomwall4.4"},
  132. {"blackdmg", "Damaged black wall", "blckdmg"},
  133. {"blackdmgstripe", "Damaged black wall(stripes)", "blckdmgstripe"},
  134. {"doomengine", "Doom engine wall", "doomengine"},
  135. -- {"monitorwall", "Wall monitors", "monitorwall"},
  136. {"screen3", "Wall monitor", "screen3"},
  137. {"doomlight", "Doom light", "doomlight", 12},
  138. {"bluwllight", "Blue wall light", "capsule3", default.LIGHT_MAX},
  139. {"bluegrid", "Blue Grid", "bluegrid", 5},
  140. {"fan", "Fan", "fan"},
  141. {"ppllght", "Purple wall light", "", default.LIGHT_MAX},
  142. {"pplwll", "Purple wall", "", 0},
  143. {"pplwll2", "Purple wall2", "", 0},
  144. {"pplwll3", "Purple wall3", "", 0},
  145. {"pplwll4", "Purple wall4", "", 0},
  146. {"pplblk", "Purple tile", "", 0},
  147. {"purple", "Purple node", "", 0},
  148. {"rock", "Moonstone", "", 0},
  149. {"rock2", "Moonstone2", "", 0},
  150. {"blackvnt", "Black vent", "", 0},
  151. {"blackplate", "Black plate", "", 0},
  152. }
  153. if minetest.global_exists("stairsplus") then
  154. for _, row in ipairs(node.types) do
  155. local name = row[1]
  156. local desc = row[2]
  157. local light = row[4]
  158. -- Node Definition
  159. stairsplus:register_all("scifi_nodes", row[1], "scifi_nodes:"..name, {
  160. description = desc,
  161. tiles = {"scifi_nodes_"..name..".png"},
  162. groups = {cracky=1},
  163. paramtype = "light",
  164. paramtype2 = "facedir",
  165. light_source = light,
  166. })
  167. end
  168. end