plantlife.lua 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  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 = "fire_dust.png",
  56. })
  57. minetest.register_craft({
  58. output = "ethereal:fire_dust 2",
  59. recipe = {
  60. {"ethereal:fire_flower"},
  61. }
  62. })
  63. minetest.register_craft({
  64. type = "fuel",
  65. recipe = "ethereal:fire_dust",
  66. burntime = 10,
  67. })
  68. -- vines
  69. minetest.register_node("ethereal:vine", {
  70. description = S("Vine"),
  71. drawtype = "signlike",
  72. tiles = {"vine.png"},
  73. inventory_image = "vine.png",
  74. wield_image = "vine.png",
  75. paramtype = "light",
  76. paramtype2 = "wallmounted",
  77. walkable = false,
  78. climbable = true,
  79. is_ground_content = false,
  80. selection_box = {
  81. type = "wallmounted",
  82. },
  83. groups = {choppy = 3, oddly_breakable_by_hand = 1, flammable = 2},
  84. legacy_wallmounted = true,
  85. sounds = default.node_sound_leaves_defaults(),
  86. })
  87. minetest.register_craft({
  88. output = "ethereal:vine 2",
  89. recipe = {
  90. {"group:leaves", "", "group:leaves"},
  91. {"", "group:leaves", ""},
  92. {"group:leaves", "", "group:leaves"},
  93. }
  94. })
  95. -- light strings (glowing vine)
  96. minetest.register_node("ethereal:lightstring", {
  97. description = S("Light String Vine"),
  98. drawtype = "signlike",
  99. tiles = {"lightstring.png"},
  100. inventory_image = "lightstring.png",
  101. wield_image = "lightstring.png",
  102. paramtype = "light",
  103. paramtype2 = "wallmounted",
  104. light_source = 10,
  105. walkable = false,
  106. climbable = true,
  107. is_ground_content = false,
  108. selection_box = {
  109. type = "wallmounted",
  110. },
  111. groups = {choppy = 3, oddly_breakable_by_hand = 1, flammable = 2},
  112. legacy_wallmounted = true,
  113. sounds = default.node_sound_leaves_defaults(),
  114. })
  115. minetest.register_craft({
  116. output = "ethereal:lightstring 8",
  117. recipe = {
  118. {"ethereal:vine", "ethereal:vine", "ethereal:vine"},
  119. {"ethereal:vine", "ethereal:fire_dust", "ethereal:vine"},
  120. {"ethereal:vine", "ethereal:vine", "ethereal:vine"},
  121. },
  122. })
  123. -- Fern (boston)
  124. minetest.register_node("ethereal:fern", {
  125. description = S("Fern"),
  126. drawtype = "plantlike",
  127. visual_scale = 1.4,
  128. tiles = {"fern.png"},
  129. inventory_image = "fern.png",
  130. wield_image = "fern.png",
  131. paramtype = "light",
  132. sunlight_propagates = true,
  133. waving = 1,
  134. walkable = false,
  135. buildable_to = true,
  136. drop = {
  137. max_items = 1,
  138. items = {
  139. {items = {"ethereal:fern_tubers"}, rarity = 6},
  140. {items = {"ethereal:fern"}}
  141. }
  142. },
  143. groups = {snappy = 3, flora = 1, attached_node = 1, flammable = 2},
  144. sounds = default.node_sound_leaves_defaults(),
  145. selection_box = {
  146. type = "fixed",
  147. fixed = {-5 / 16, -0.5, -5 / 16, 5 / 16, 0.67, 5 / 16},
  148. },
  149. })
  150. -- Boston Ferns sometimes drop edible Tubers (heals 1/2 heart when eaten)
  151. minetest.register_craftitem("ethereal:fern_tubers", {
  152. description = S("Fern Tubers"),
  153. inventory_image = "fern_tubers.png",
  154. groups = {food_tuber = 1, flammable = 2},
  155. on_use = minetest.item_eat(1),
  156. })
  157. -- Red Shrub (not flammable)
  158. minetest.register_node("ethereal:dry_shrub", {
  159. description = S("Fiery Dry Shrub"),
  160. drawtype = "plantlike",
  161. tiles = {"ethereal_dry_shrub.png"},
  162. inventory_image = "ethereal_dry_shrub.png",
  163. wield_image = "ethereal_dry_shrub.png",
  164. paramtype = "light",
  165. sunlight_propagates = true,
  166. waving = 1,
  167. walkable = false,
  168. buildable_to = true,
  169. groups = {snappy = 3, flora = 1, attached_node = 1},
  170. sounds = default.node_sound_leaves_defaults(),
  171. selection_box = {
  172. type = "fixed",
  173. fixed = {-5 / 16, -0.5, -5 / 16, 5 / 16, 4 / 16, 5 / 16},
  174. },
  175. })
  176. -- Grey Shrub (not Flammable - too cold to burn)
  177. minetest.register_node("ethereal:snowygrass", {
  178. description = S("Snowy Grass"),
  179. drawtype = "plantlike",
  180. visual_scale = 0.9,
  181. tiles = {"ethereal_snowygrass.png"},
  182. inventory_image = "ethereal_snowygrass.png",
  183. wield_image = "ethereal_snowygrass.png",
  184. paramtype = "light",
  185. sunlight_propagates = true,
  186. waving = 1,
  187. walkable = false,
  188. buildable_to = true,
  189. groups = {snappy = 3, flora = 1, attached_node = 1},
  190. sounds = default.node_sound_leaves_defaults(),
  191. selection_box = {
  192. type = "fixed",
  193. fixed = {-5 / 16, -0.5, -5 / 16, 5 / 16, 5 / 16, 5 / 16},
  194. },
  195. })
  196. -- Crystal Shrub (not Flammable - too cold to burn)
  197. minetest.register_node("ethereal:crystalgrass", {
  198. description = S("Crystal Grass"),
  199. drawtype = "plantlike",
  200. visual_scale = 0.9,
  201. tiles = {"ethereal_crystalgrass.png"},
  202. inventory_image = "ethereal_crystalgrass.png",
  203. wield_image = "ethereal_crystalgrass.png",
  204. paramtype = "light",
  205. sunlight_propagates = true,
  206. waving = 1,
  207. walkable = false,
  208. buildable_to = true,
  209. groups = {snappy = 3, flora = 1, attached_node = 1},
  210. sounds = default.node_sound_leaves_defaults(),
  211. selection_box = {
  212. type = "fixed",
  213. fixed = {-5 / 16, -0.5, -5 / 16, 5 / 16, 5 / 16, 5 / 16},
  214. },
  215. })
  216. -- Define Moss Types (Has grass textures on all sides)
  217. local add_moss = function(typ, descr, texture, receipe_item)
  218. minetest.register_node("ethereal:" .. typ .. "_moss", {
  219. description = S(descr .. " Moss"),
  220. tiles = {texture},
  221. groups = {crumbly = 3},
  222. sounds = default.node_sound_dirt_defaults({
  223. footstep = {name = "default_grass_footstep", gain = 0.4}})
  224. })
  225. minetest.register_craft({
  226. type = "shapeless",
  227. output = "ethereal:"..typ.."_moss",
  228. recipe = {"default:dirt", receipe_item }
  229. })
  230. end
  231. add_moss( "crystal", "Crystal", "ethereal_grass_crystal_top.png", "ethereal:frost_leaves")
  232. add_moss( "mushroom", "Mushroom", "ethereal_grass_mushroom_top.png", "ethereal:mushroom")
  233. add_moss( "fiery", "Fiery", "ethereal_grass_fiery_top.png", "ethereal:dry_shrub")
  234. add_moss( "gray", "Gray", "ethereal_grass_gray_top.png", "ethereal:snowygrass")
  235. add_moss( "green", "Green", "default_grass.png", "default:jungleleaves")
  236. -- Illuminated Cave Shrooms (Red, Green and Blue)
  237. minetest.register_node("ethereal:illumishroom", {
  238. description = S("Red Illumishroom"),
  239. drawtype = "plantlike",
  240. tiles = { "illumishroom.png" },
  241. inventory_image = "illumishroom.png",
  242. wield_image = "illumishroom.png",
  243. paramtype = "light",
  244. light_source = 5,
  245. sunlight_propagates = true,
  246. walkable = false,
  247. groups = {dig_immediate = 3, attached_node = 1, flammable = 3},
  248. sounds = default.node_sound_leaves_defaults(),
  249. selection_box = {
  250. type = "fixed",
  251. fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.47, 6 / 16},
  252. },
  253. })
  254. minetest.register_node("ethereal:illumishroom2", {
  255. description = S("Green Illumishroom"),
  256. drawtype = "plantlike",
  257. tiles = { "illumishroom2.png" },
  258. inventory_image = "illumishroom2.png",
  259. wield_image = "illumishroom2.png",
  260. paramtype = "light",
  261. light_source = 5,
  262. sunlight_propagates = true,
  263. walkable = false,
  264. groups = {dig_immediate = 3, attached_node = 1, flammable = 3},
  265. sounds = default.node_sound_leaves_defaults(),
  266. selection_box = {
  267. type = "fixed",
  268. fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.47, 6 / 16},
  269. },
  270. })
  271. minetest.register_node("ethereal:illumishroom3", {
  272. description = S("Cyan Illumishroom"),
  273. drawtype = "plantlike",
  274. tiles = { "illumishroom3.png" },
  275. inventory_image = "illumishroom3.png",
  276. wield_image = "illumishroom3.png",
  277. paramtype = "light",
  278. light_source = 5,
  279. sunlight_propagates = true,
  280. walkable = false,
  281. groups = {dig_immediate = 3, attached_node = 1, flammable = 3},
  282. sounds = default.node_sound_leaves_defaults(),
  283. selection_box = {
  284. type = "fixed",
  285. fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.47, 6 / 16},
  286. },
  287. })