Stalactites and Stalagmites

This commit is contained in:
Duane Robertson 2015-09-08 21:48:06 -05:00
parent 79edcdad54
commit d739d05520
2 changed files with 53 additions and 5 deletions

View File

@ -159,6 +159,8 @@ function vmg.generate(minp, maxp, seed)
local c_lava = minetest.get_content_id("default:lava_source")
local c_snow_layer = minetest.get_content_id("default:snow")
local c_glowing_fungal_stone = minetest.get_content_id("valleys_mapgen:glowing_fungal_stone")
local c_stalactite = minetest.get_content_id("valleys_mapgen:stalactite")
local c_stalagmite = minetest.get_content_id("valleys_mapgen:stalagmite")
-- Tree nodes
local c_tree = minetest.get_content_id("default:tree")
@ -445,8 +447,13 @@ function vmg.generate(minp, maxp, seed)
y = y - 1
end
elseif above <= 0 then
if do_cave_stuff and x == last_cave_block[1] and z == last_cave_block[3] and y == last_cave_block[2] + 1 and math.random() < 0.05 then
data[ivm] = c_glowing_fungal_stone
if do_cave_stuff and x == last_cave_block[1] and z == last_cave_block[3] and y == last_cave_block[2] + 1 and math.random() < 0.15 then
if data[ivm - ystride] == c_air and math.random() < 0.66 then
data[ivm] = c_stone
data[ivm - ystride] = c_stalactite
else
data[ivm] = c_glowing_fungal_stone
end
else
data[ivm] = c_stone
end
@ -457,8 +464,13 @@ function vmg.generate(minp, maxp, seed)
data[ivm] = dirt
end
else
if do_cave_stuff and x == last_cave_block[1] and z == last_cave_block[3] and y == last_cave_block[2] + 1 and math.random() < 0.05 then
data[ivm] = c_glowing_fungal_stone
if do_cave_stuff and x == last_cave_block[1] and z == last_cave_block[3] and y == last_cave_block[2] + 1 and math.random() < 0.13 then
if data[ivm - ystride] == c_air and math.random() < 0.75 then
data[ivm] = c_stone
data[ivm - ystride] = c_stalactite
else
data[ivm] = c_glowing_fungal_stone
end
else
data[ivm] = c_stone
end
@ -481,7 +493,9 @@ function vmg.generate(minp, maxp, seed)
end
end
if air_to_stone == 1 and math.random() < 0.08 then
if air_to_stone == 1 and math.random() < 0.1 then
data[ivm] = c_stalagmite
elseif air_to_stone == 1 and math.random() < 0.08 then
local r = math.random()
if r < 0.03 then
data[ivm] = c_riverwater

View File

@ -307,6 +307,40 @@ minetest.register_craft({
},
})
minetest.register_node("valleys_mapgen:stalactite", {
description = "Stalactite",
tiles = {"default_stone.png"},
is_ground_content = false,
walkable = false,
paramtype = "light",
drawtype = "nodebox",
node_box = { type = "fixed",
fixed = {
{-0.07, 0.0, -0.07, 0.07, 0.5, 0.07},
{-0.04, -0.25, -0.04, 0.04, 0.0, 0.04},
{-0.02, -0.5, -0.02, 0.02, 0.25, 0.02},
} },
groups = {stone=1, cracky=3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("valleys_mapgen:stalagmite", {
description = "Stalagmite",
tiles = {"default_stone.png"},
is_ground_content = false,
walkable = false,
paramtype = "light",
drawtype = "nodebox",
node_box = { type = "fixed",
fixed = {
{-0.07, -0.5, -0.07, 0.07, 0.0, 0.07},
{-0.04, 0.0, -0.04, 0.04, 0.25, 0.04},
{-0.02, 0.25, -0.02, 0.02, 0.5, 0.02},
} },
groups = {stone=1, cracky=3},
sounds = default.node_sound_stone_defaults(),
})
-- Change leafdecay ratings
minetest.add_group("default:leaves", {leafdecay = 5})
minetest.add_group("default:jungleleaves", {leafdecay = 8})