2016-05-17 23:40:05 +03:00
|
|
|
|
2016-06-09 17:08:34 +03:00
|
|
|
local S = ethereal.intllib
|
|
|
|
|
2014-11-09 22:17:41 +03:00
|
|
|
-- Seaweed
|
|
|
|
minetest.register_node("ethereal:seaweed", {
|
2016-06-09 17:08:34 +03:00
|
|
|
description = S("Seaweed"),
|
2014-11-09 22:17:41 +03:00
|
|
|
drawtype = "plantlike",
|
|
|
|
tiles = {"seaweed.png"},
|
|
|
|
inventory_image = "seaweed.png",
|
|
|
|
wield_image = "seaweed.png",
|
|
|
|
paramtype = "light",
|
|
|
|
walkable = false,
|
|
|
|
climbable = true,
|
|
|
|
drowning = 1,
|
2015-07-04 14:22:39 +03:00
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
|
|
|
|
},
|
|
|
|
post_effect_color = {a = 64, r = 100, g = 100, b = 200},
|
|
|
|
groups = {snappy = 3},
|
2014-11-09 22:17:41 +03:00
|
|
|
on_use = minetest.item_eat(1),
|
|
|
|
sounds = default.node_sound_leaves_defaults(),
|
2016-05-17 23:40:05 +03:00
|
|
|
after_dig_node = function(pos, node, metadata, digger)
|
|
|
|
default.dig_up(pos, node, digger)
|
|
|
|
end,
|
2014-11-09 22:17:41 +03:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
|
|
|
output = "dye:dark_green 3",
|
|
|
|
recipe = {"ethereal:seaweed",},
|
|
|
|
})
|
|
|
|
|
|
|
|
-- Blue Coral
|
|
|
|
minetest.register_node("ethereal:coral2", {
|
2016-06-09 17:08:34 +03:00
|
|
|
description = S("Blue Coral"),
|
2014-11-09 22:17:41 +03:00
|
|
|
drawtype = "plantlike",
|
|
|
|
tiles = {"coral2.png"},
|
|
|
|
inventory_image = "coral2.png",
|
2015-11-23 23:43:48 +03:00
|
|
|
wield_image = "coral2.png",
|
2014-11-09 22:17:41 +03:00
|
|
|
paramtype = "light",
|
2015-07-04 14:22:39 +03:00
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}
|
|
|
|
},
|
2014-11-09 22:17:41 +03:00
|
|
|
light_source = 3,
|
2015-07-04 14:22:39 +03:00
|
|
|
groups = {snappy = 3},
|
2014-11-09 22:17:41 +03:00
|
|
|
sounds = default.node_sound_leaves_defaults(),
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
|
|
|
output = "dye:cyan 3",
|
|
|
|
recipe = {"ethereal:coral2",},
|
|
|
|
})
|
|
|
|
|
|
|
|
-- Orange Coral
|
|
|
|
minetest.register_node("ethereal:coral3", {
|
2016-06-09 17:08:34 +03:00
|
|
|
description = S("Orange Coral"),
|
2014-11-09 22:17:41 +03:00
|
|
|
drawtype = "plantlike",
|
|
|
|
tiles = {"coral3.png"},
|
|
|
|
inventory_image = "coral3.png",
|
2015-11-23 23:43:48 +03:00
|
|
|
wield_image = "coral3.png",
|
2014-11-09 22:17:41 +03:00
|
|
|
paramtype = "light",
|
2015-07-04 14:22:39 +03:00
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}
|
|
|
|
},
|
2014-11-09 22:17:41 +03:00
|
|
|
light_source = 3,
|
2015-07-04 14:22:39 +03:00
|
|
|
groups = {snappy = 3},
|
2014-11-09 22:17:41 +03:00
|
|
|
sounds = default.node_sound_leaves_defaults(),
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
|
|
|
output = "dye:orange 3",
|
|
|
|
recipe = {"ethereal:coral3",},
|
|
|
|
})
|
|
|
|
|
|
|
|
-- Pink Coral
|
|
|
|
minetest.register_node("ethereal:coral4", {
|
2016-06-09 17:08:34 +03:00
|
|
|
description = S("Pink Coral"),
|
2014-11-09 22:17:41 +03:00
|
|
|
drawtype = "plantlike",
|
|
|
|
tiles = {"coral4.png"},
|
|
|
|
inventory_image = "coral4.png",
|
2015-11-23 23:43:48 +03:00
|
|
|
wield_image = "coral4.png",
|
2014-11-09 22:17:41 +03:00
|
|
|
paramtype = "light",
|
2015-07-04 14:22:39 +03:00
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}
|
|
|
|
},
|
2014-11-09 22:17:41 +03:00
|
|
|
light_source = 3,
|
2015-07-04 14:22:39 +03:00
|
|
|
groups = {snappy = 3},
|
2014-11-09 22:17:41 +03:00
|
|
|
sounds = default.node_sound_leaves_defaults(),
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
|
|
|
output = "dye:pink 3",
|
|
|
|
recipe = {"ethereal:coral4",},
|
|
|
|
})
|
|
|
|
|
|
|
|
-- Green Coral
|
|
|
|
minetest.register_node("ethereal:coral5", {
|
2016-06-09 17:08:34 +03:00
|
|
|
description = S("Green Coral"),
|
2014-11-09 22:17:41 +03:00
|
|
|
drawtype = "plantlike",
|
|
|
|
tiles = {"coral5.png"},
|
|
|
|
inventory_image = "coral5.png",
|
2015-11-23 23:43:48 +03:00
|
|
|
wield_image = "coral5.png",
|
2014-11-09 22:17:41 +03:00
|
|
|
paramtype = "light",
|
2015-07-04 14:22:39 +03:00
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}
|
|
|
|
},
|
2014-11-09 22:17:41 +03:00
|
|
|
light_source = 3,
|
2015-07-04 14:22:39 +03:00
|
|
|
groups = {snappy = 3},
|
2014-11-09 22:17:41 +03:00
|
|
|
sounds = default.node_sound_leaves_defaults(),
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
|
|
|
output = "dye:green 3",
|
|
|
|
recipe = {"ethereal:coral5",},
|
|
|
|
})
|
|
|
|
|
|
|
|
-- Undersea Sand
|
|
|
|
minetest.register_node("ethereal:sandy", {
|
2016-06-09 17:08:34 +03:00
|
|
|
description = S("Sandy"),
|
2014-11-09 22:17:41 +03:00
|
|
|
tiles = {"default_sand.png"},
|
|
|
|
is_ground_content = true,
|
2015-07-04 14:22:39 +03:00
|
|
|
groups = {
|
2016-05-17 23:40:05 +03:00
|
|
|
crumbly = 3, falling_node = 1, sand = 1, not_in_creative_inventory = 1
|
2015-07-04 14:22:39 +03:00
|
|
|
},
|
2014-11-09 22:17:41 +03:00
|
|
|
drop = "default:sand",
|
|
|
|
sounds = default.node_sound_sand_defaults(),
|
|
|
|
})
|
|
|
|
|
2016-01-21 17:59:28 +03:00
|
|
|
-- randomly generate coral or seaweed and have seaweed grow up to 14 high
|
2014-11-09 22:17:41 +03:00
|
|
|
minetest.register_abm({
|
2016-08-19 19:22:09 +03:00
|
|
|
label = "Grow coral/seaweed",
|
2014-11-09 22:17:41 +03:00
|
|
|
nodenames = {"ethereal:sandy"},
|
|
|
|
neighbors = {"group:water"},
|
|
|
|
interval = 15,
|
|
|
|
chance = 10,
|
2015-11-07 23:50:50 +03:00
|
|
|
catch_up = false,
|
2014-11-09 22:17:41 +03:00
|
|
|
action = function(pos, node)
|
|
|
|
|
2015-11-23 23:43:48 +03:00
|
|
|
local sel = math.random(1, 5)
|
2016-01-21 17:59:28 +03:00
|
|
|
|
|
|
|
pos.y = pos.y + 1
|
|
|
|
|
|
|
|
local nod = minetest.get_node(pos).name
|
|
|
|
|
|
|
|
if nod == "default:water_source"
|
|
|
|
and sel > 1 then
|
|
|
|
|
|
|
|
if minetest.get_node(pos).name == "default:water_source" then
|
|
|
|
|
|
|
|
minetest.swap_node(pos, {name = "ethereal:coral" .. sel})
|
|
|
|
end
|
|
|
|
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
if nod == "ethereal:seaweed"
|
|
|
|
or sel == 1 then
|
|
|
|
|
2014-11-09 22:17:41 +03:00
|
|
|
local height = 0
|
2016-01-21 17:59:28 +03:00
|
|
|
local high = 14
|
2014-11-09 22:17:41 +03:00
|
|
|
|
2016-01-21 17:59:28 +03:00
|
|
|
while height < high
|
|
|
|
and minetest.get_node(pos).name == "ethereal:seaweed" do
|
2014-11-09 22:17:41 +03:00
|
|
|
height = height + 1
|
|
|
|
pos.y = pos.y + 1
|
|
|
|
end
|
|
|
|
|
2016-01-21 17:59:28 +03:00
|
|
|
if pos.y < 1
|
|
|
|
and height < high
|
2015-04-10 17:38:53 +03:00
|
|
|
and minetest.get_node(pos).name == "default:water_source" then
|
2014-11-09 22:17:41 +03:00
|
|
|
|
2016-01-21 17:59:28 +03:00
|
|
|
minetest.swap_node(pos, {name = "ethereal:seaweed"})
|
2014-11-09 22:17:41 +03:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
2016-01-21 17:59:28 +03:00
|
|
|
|
2014-11-09 22:17:41 +03:00
|
|
|
end,
|
2016-01-09 15:25:33 +03:00
|
|
|
})
|