plantlife.lua 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  1. local S = ethereal.intllib
  2. -- Firethorn (poisonous when eaten raw, must be crushed and washed in flowing water 1st)
  3. minetest.register_node("ethereal:firethorn", {
  4. description = S("Firethorn Shrub"),
  5. drawtype = "plantlike",
  6. tiles = {"ethereal_firethorn.png"},
  7. inventory_image = "ethereal_firethorn.png",
  8. wield_image = "ethereal_firethorn.png",
  9. paramtype = "light",
  10. sunlight_propagates = true,
  11. waving = 1,
  12. walkable = false,
  13. buildable_to = true,
  14. groups = {snappy = 3, flora = 1, attached_node = 1},
  15. sounds = default.node_sound_leaves_defaults(),
  16. selection_box = {
  17. type = "fixed",
  18. fixed = {-5 / 16, -0.5, -5 / 16, 5 / 16, 4 / 16, 5 / 16}
  19. }
  20. })
  21. -- Fire Flower
  22. minetest.register_node("ethereal:fire_flower", {
  23. description = S("Fire Flower"),
  24. drawtype = "plantlike",
  25. tiles = { "ethereal_fire_flower.png" },
  26. inventory_image = "ethereal_fire_flower.png",
  27. wield_image = "ethereal_fire_flower.png",
  28. paramtype = "light",
  29. light_source = 5,
  30. sunlight_propagates = true,
  31. walkable = false,
  32. buildable_to = true,
  33. damage_per_second = 2,
  34. groups = {snappy = 1, oddly_breakable_by_hand = 3, igniter = 2},
  35. sounds = default.node_sound_leaves_defaults(),
  36. selection_box = {
  37. type = "fixed",
  38. fixed = {-5 / 16, -0.5, -5 / 16, 5 / 16, 1 / 2, 5 / 16}
  39. },
  40. on_punch = function(pos, node, puncher)
  41. puncher:punch(puncher, 1.0, {
  42. full_punch_interval = 1.0,
  43. damage_groups = {fleshy = 2}
  44. }, nil)
  45. end
  46. })
  47. minetest.register_craft({
  48. type = "fuel",
  49. recipe = "ethereal:fire_flower",
  50. burntime = 20
  51. })
  52. -- Fire Dust
  53. minetest.register_craftitem("ethereal:fire_dust", {
  54. description = S("Fire Dust"),
  55. inventory_image = "ethereal_fire_dust.png"
  56. })
  57. minetest.register_craft({
  58. output = "ethereal:fire_dust 2",
  59. recipe = {{"ethereal:fire_flower"}}
  60. })
  61. minetest.register_craft({
  62. type = "fuel",
  63. recipe = "ethereal:fire_dust",
  64. burntime = 10
  65. })
  66. -- vines
  67. minetest.register_node("ethereal:vine", {
  68. description = S("Vine"),
  69. drawtype = "signlike",
  70. tiles = {"ethereal_vine.png"},
  71. inventory_image = "ethereal_vine.png",
  72. wield_image = "ethereal_vine.png",
  73. paramtype = "light",
  74. paramtype2 = "wallmounted",
  75. walkable = false,
  76. climbable = true,
  77. is_ground_content = false,
  78. selection_box = {
  79. type = "wallmounted"
  80. },
  81. groups = {choppy = 3, oddly_breakable_by_hand = 1, flammable = 2},
  82. legacy_wallmounted = true,
  83. sounds = default.node_sound_leaves_defaults()
  84. })
  85. minetest.register_craft({
  86. output = "ethereal:vine 2",
  87. recipe = {
  88. {"group:leaves", "", "group:leaves"},
  89. {"", "group:leaves", ""},
  90. {"group:leaves", "", "group:leaves"}
  91. }
  92. })
  93. -- light strings (glowing vine)
  94. minetest.register_node("ethereal:lightstring", {
  95. description = S("Light String Vine"),
  96. drawtype = "signlike",
  97. tiles = {"ethereal_lightstring.png"},
  98. inventory_image = "ethereal_lightstring.png",
  99. wield_image = "ethereal_lightstring.png",
  100. paramtype = "light",
  101. paramtype2 = "wallmounted",
  102. light_source = 10,
  103. walkable = false,
  104. climbable = true,
  105. is_ground_content = false,
  106. selection_box = {
  107. type = "wallmounted"
  108. },
  109. groups = {choppy = 3, oddly_breakable_by_hand = 1, flammable = 2},
  110. legacy_wallmounted = true,
  111. sounds = default.node_sound_leaves_defaults()
  112. })
  113. minetest.register_craft({
  114. output = "ethereal:lightstring 8",
  115. recipe = {
  116. {"ethereal:vine", "ethereal:vine", "ethereal:vine"},
  117. {"ethereal:vine", "ethereal:fire_dust", "ethereal:vine"},
  118. {"ethereal:vine", "ethereal:vine", "ethereal:vine"}
  119. }
  120. })
  121. -- Fern (boston)
  122. minetest.register_node("ethereal:fern", {
  123. description = S("Fern"),
  124. drawtype = "plantlike",
  125. visual_scale = 1.4,
  126. tiles = {"ethereal_fern.png"},
  127. inventory_image = "ethereal_fern.png",
  128. wield_image = "ethereal_fern.png",
  129. paramtype = "light",
  130. sunlight_propagates = true,
  131. waving = 1,
  132. walkable = false,
  133. buildable_to = true,
  134. drop = {
  135. max_items = 1,
  136. items = {
  137. {items = {"ethereal:fern_tubers"}, rarity = 6},
  138. {items = {"ethereal:fern"}}
  139. }
  140. },
  141. groups = {snappy = 3, flora = 1, attached_node = 1, flammable = 2},
  142. sounds = default.node_sound_leaves_defaults(),
  143. selection_box = {
  144. type = "fixed",
  145. fixed = {-5 / 16, -0.5, -5 / 16, 5 / 16, 0.67, 5 / 16}
  146. }
  147. })
  148. -- Boston Ferns sometimes drop edible Tubers (heals 1/2 heart when eaten)
  149. minetest.register_craftitem("ethereal:fern_tubers", {
  150. description = S("Fern Tubers"),
  151. inventory_image = "ethereal_fern_tubers.png",
  152. groups = {food_tuber = 1, flammable = 2},
  153. on_use = minetest.item_eat(1)
  154. })
  155. -- Red Shrub (not flammable)
  156. minetest.register_node("ethereal:dry_shrub", {
  157. description = S("Fiery Dry Shrub"),
  158. drawtype = "plantlike",
  159. tiles = {"ethereal_dry_shrub.png"},
  160. inventory_image = "ethereal_dry_shrub.png",
  161. wield_image = "ethereal_dry_shrub.png",
  162. paramtype = "light",
  163. sunlight_propagates = true,
  164. waving = 1,
  165. walkable = false,
  166. buildable_to = true,
  167. groups = {snappy = 3, flora = 1, attached_node = 1},
  168. sounds = default.node_sound_leaves_defaults(),
  169. selection_box = {
  170. type = "fixed",
  171. fixed = {-5 / 16, -0.5, -5 / 16, 5 / 16, 4 / 16, 5 / 16}
  172. }
  173. })
  174. -- Grey Shrub (not Flammable - too cold to burn)
  175. minetest.register_node("ethereal:snowygrass", {
  176. description = S("Snowy Grass"),
  177. drawtype = "plantlike",
  178. visual_scale = 0.9,
  179. tiles = {"ethereal_snowygrass.png"},
  180. inventory_image = "ethereal_snowygrass.png",
  181. wield_image = "ethereal_snowygrass.png",
  182. paramtype = "light",
  183. sunlight_propagates = true,
  184. waving = 1,
  185. walkable = false,
  186. buildable_to = true,
  187. groups = {snappy = 3, flora = 1, attached_node = 1},
  188. sounds = default.node_sound_leaves_defaults(),
  189. selection_box = {
  190. type = "fixed",
  191. fixed = {-5 / 16, -0.5, -5 / 16, 5 / 16, 5 / 16, 5 / 16}
  192. }
  193. })
  194. -- Crystal Shrub (not Flammable - too cold to burn)
  195. minetest.register_node("ethereal:crystalgrass", {
  196. description = S("Crystal Grass"),
  197. drawtype = "plantlike",
  198. visual_scale = 0.9,
  199. tiles = {"ethereal_crystalgrass.png"},
  200. inventory_image = "ethereal_crystalgrass.png",
  201. wield_image = "ethereal_crystalgrass.png",
  202. paramtype = "light",
  203. sunlight_propagates = true,
  204. waving = 1,
  205. walkable = false,
  206. buildable_to = true,
  207. groups = {snappy = 3, flora = 1, attached_node = 1},
  208. sounds = default.node_sound_leaves_defaults(),
  209. selection_box = {
  210. type = "fixed",
  211. fixed = {-5 / 16, -0.5, -5 / 16, 5 / 16, 5 / 16, 5 / 16}
  212. }
  213. })
  214. -- Define Moss Types (Has grass textures on all sides)
  215. local add_moss = function(typ, descr, texture, receipe_item)
  216. minetest.register_node("ethereal:" .. typ .. "_moss", {
  217. description = S(descr .. " Moss"),
  218. tiles = {texture},
  219. groups = {crumbly = 3},
  220. sounds = default.node_sound_dirt_defaults({
  221. footstep = {name = "default_grass_footstep", gain = 0.4}})
  222. })
  223. minetest.register_craft({
  224. output = "ethereal:" .. typ .. "_moss",
  225. recipe = {{"default:dirt", receipe_item}}
  226. })
  227. end
  228. add_moss("crystal", "Crystal", "ethereal_grass_crystal_top.png", "ethereal:frost_leaves")
  229. add_moss("mushroom", "Mushroom", "ethereal_grass_mushroom_top.png", "ethereal:mushroom")
  230. add_moss("fiery", "Fiery", "ethereal_grass_fiery_top.png", "ethereal:dry_shrub")
  231. add_moss("gray", "Gray", "ethereal_grass_gray_top.png", "ethereal:snowygrass")
  232. add_moss("green", "Green", "default_grass.png", "default:jungleleaves")
  233. -- Illuminated Cave Shrooms (Red, Green and Blue)
  234. local add_shroom = function(name, desc, ad)
  235. minetest.register_node("ethereal:illumishroom" .. ad, {
  236. description = S(desc .. " Illumishroom"),
  237. drawtype = "plantlike",
  238. tiles = {"ethereal_illumishroom_" .. name .. ".png"},
  239. inventory_image = "ethereal_illumishroom_" .. name .. ".png",
  240. wield_image = "ethereal_illumishroom_" .. name .. ".png",
  241. paramtype = "light",
  242. light_source = 5,
  243. sunlight_propagates = true,
  244. walkable = false,
  245. groups = {dig_immediate = 3, attached_node = 1, flammable = 3},
  246. sounds = default.node_sound_leaves_defaults(),
  247. selection_box = {
  248. type = "fixed",
  249. fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.47, 6 / 16}
  250. }
  251. })
  252. end
  253. add_shroom("red", "Red", "")
  254. add_shroom("green", "Green", "2")
  255. add_shroom("cyan", "Cyan", "3")