stairs.lua 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. -- language support
  2. local S = ethereal.intllib
  3. -- stair mods active
  4. local stairs_mod = minetest.get_modpath("stairs")
  5. local stairs_redo = stairs_mod and stairs.mod and stairs.mod == "redo"
  6. local stairs_plus = minetest.global_exists("stairsplus")
  7. -- stair selection function
  8. local do_stair = function(description, name, node, groups, texture, sound)
  9. if stairs_redo then
  10. stairs.register_all(name, node, groups, texture, S(description), sound)
  11. elseif stairs_plus then
  12. local mod = "ethereal"
  13. stairsplus:register_all(mod, name, node, {
  14. description = S(description),
  15. tiles = texture,
  16. groups = groups,
  17. sounds = sound,
  18. })
  19. -- aliases need to be set for previous stairs to avoid unknown nodes
  20. minetest.register_alias_force("stairs:stair_" .. name,
  21. mod .. ":stair_" .. name)
  22. minetest.register_alias_force("stairs:stair_outer_" .. name,
  23. mod .. ":stair_" .. name .. "_outer")
  24. minetest.register_alias_force("stairs:stair_inner_" .. name,
  25. mod .. ":stair_" .. name .. "_inner")
  26. minetest.register_alias_force("stairs:slab_" .. name,
  27. mod .. ":slab_" .. name)
  28. else
  29. stairs.register_stair_and_slab(name, node, groups, texture,
  30. S(description .. " Stair"), S(description .. " Slab"), sound)
  31. end
  32. end
  33. -- Register Stairs (stair mod will be auto-selected)
  34. do_stair(
  35. "Blue Marble",
  36. "blue_marble",
  37. "ethereal:blue_marble",
  38. {cracky = 1},
  39. {"ethereal_blue_marble.png"},
  40. default.node_sound_stone_defaults())
  41. do_stair(
  42. "Blue Marble Tile",
  43. "blue_marble_tile",
  44. "ethereal:blue_marble_tile",
  45. {cracky = 1},
  46. {"ethereal_blue_marble_tile.png"},
  47. default.node_sound_stone_defaults())
  48. do_stair(
  49. "Crystal Block",
  50. "crystal_block",
  51. "ethereal:crystal_block",
  52. {cracky = 1, level = 2, puts_out_fire = 1, cools_lava = 1},
  53. {"ethereal_crystal_block.png"},
  54. default.node_sound_glass_defaults())
  55. do_stair(
  56. "Ice Brick",
  57. "icebrick",
  58. "ethereal:icebrick",
  59. {cracky = 3, puts_out_fire = 1, cools_lava = 1},
  60. {"ethereal_brick_ice.png"},
  61. default.node_sound_glass_defaults())
  62. do_stair(
  63. "Snow Brick",
  64. "snowbrick",
  65. "ethereal:snowbrick",
  66. {crumbly = 3, puts_out_fire = 1, cools_lava = 1},
  67. {"ethereal_brick_snow.png"},
  68. default.node_sound_dirt_defaults({
  69. footstep = {name = "default_snow_footstep", gain = 0.25},
  70. dug = {name = "default_snow_footstep", gain = 0.75},
  71. }))
  72. do_stair(
  73. "Dried Dirt",
  74. "dry_dirt",
  75. "ethereal:dry_dirt",
  76. {crumbly = 3},
  77. {"ethereal_dry_dirt.png"},
  78. default.node_sound_dirt_defaults())
  79. do_stair(
  80. "Mushroom Trunk",
  81. "mushroom_trunk",
  82. "ethereal:mushroom_trunk",
  83. {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
  84. {"ethereal_mushroom_trunk.png"},
  85. default.node_sound_wood_defaults())
  86. do_stair(
  87. "Mushroom Top",
  88. "mushroom",
  89. "ethereal:mushroom",
  90. {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
  91. {"ethereal_mushroom_block.png"},
  92. default.node_sound_wood_defaults())
  93. do_stair(
  94. "Frost Wood",
  95. "frost_wood",
  96. "ethereal:frost_wood",
  97. {choppy = 2, oddly_breakable_by_hand = 1, put_out_fire = 1},
  98. {"ethereal_frost_wood.png"},
  99. default.node_sound_wood_defaults())
  100. do_stair(
  101. "Healing Wood",
  102. "yellow_wood",
  103. "ethereal:yellow_wood",
  104. {choppy = 2, oddly_breakable_by_hand = 1, put_out_fire = 1},
  105. {"ethereal_yellow_wood.png"},
  106. default.node_sound_wood_defaults())
  107. do_stair(
  108. "Palm Wood",
  109. "palm_wood",
  110. "ethereal:palm_wood",
  111. {choppy = 2, oddly_breakable_by_hand = 1, flammable = 3},
  112. {"moretrees_palm_wood.png"},
  113. default.node_sound_wood_defaults())
  114. do_stair(
  115. "Birch Wood",
  116. "birch_wood",
  117. "ethereal:birch_wood",
  118. {choppy = 2, oddly_breakable_by_hand = 1, flammable = 3},
  119. {"moretrees_birch_wood.png"},
  120. default.node_sound_wood_defaults())
  121. do_stair(
  122. "Banana Wood",
  123. "banana_wood",
  124. "ethereal:banana_wood",
  125. {choppy = 2, oddly_breakable_by_hand = 1, flammable = 3},
  126. {"ethereal_banana_wood.png"},
  127. default.node_sound_wood_defaults())
  128. do_stair(
  129. "Willow Wood",
  130. "willow_wood",
  131. "ethereal:willow_wood",
  132. {choppy = 2, oddly_breakable_by_hand = 1, flammable = 3},
  133. {"ethereal_willow_wood.png"},
  134. default.node_sound_wood_defaults())
  135. do_stair(
  136. "Redwood",
  137. "redwood_wood",
  138. "ethereal:redwood_wood",
  139. {choppy = 2, oddly_breakable_by_hand = 1, flammable = 3},
  140. {"ethereal_redwood_wood.png"},
  141. default.node_sound_wood_defaults())
  142. do_stair(
  143. "Bamboo",
  144. "bamboo_wood",
  145. "ethereal:bamboo_block",
  146. {snappy = 3, choppy = 2, oddly_breakable_by_hand = 1, flammable = 3},
  147. {"ethereal_bamboo_floor.png"},
  148. default.node_sound_wood_defaults())
  149. do_stair(
  150. "Sakura Wood",
  151. "sakura_wood",
  152. "ethereal:sakura_wood",
  153. {choppy = 2, oddly_breakable_by_hand = 1, flammable = 3},
  154. {"ethereal_sakura_wood.png"},
  155. default.node_sound_wood_defaults())
  156. do_stair(
  157. "Olive Wood",
  158. "olive_wood",
  159. "ethereal:olive_wood",
  160. {choppy = 2, oddly_breakable_by_hand = 1, flammable = 3},
  161. {"ethereal_olive_wood.png"},
  162. default.node_sound_wood_defaults())