add giant columns, and options for dealing with underground sea levels more cleanly
This commit is contained in:
parent
7ebed63c78
commit
36ac111eb5
20
features.lua
20
features.lua
@ -2,20 +2,27 @@ local c_dry_stal_1 = minetest.get_content_id("subterrane:dry_stal_1") -- thinnes
|
||||
local c_dry_stal_2 = minetest.get_content_id("subterrane:dry_stal_2")
|
||||
local c_dry_stal_3 = minetest.get_content_id("subterrane:dry_stal_3")
|
||||
local c_dry_stal_4 = minetest.get_content_id("subterrane:dry_stal_4") -- thickest
|
||||
|
||||
subterrane.dry_stalagmite_ids = {c_dry_stal_1, c_dry_stal_2, c_dry_stal_3, c_dry_stal_4}
|
||||
local c_wet_stal_1 = minetest.get_content_id("subterrane:wet_stal_1") -- thinnest
|
||||
local c_wet_stal_2 = minetest.get_content_id("subterrane:wet_stal_2")
|
||||
local c_wet_stal_3 = minetest.get_content_id("subterrane:wet_stal_3")
|
||||
local c_wet_stal_4 = minetest.get_content_id("subterrane:wet_stal_4") -- thickest
|
||||
subterrane.wet_stalagmite_ids = {c_wet_stal_1, c_wet_stal_2, c_wet_stal_3, c_wet_stal_4}
|
||||
local c_icicle_1 = minetest.get_content_id("subterrane:icicle_1") -- thinnest
|
||||
local c_icicle_2 = minetest.get_content_id("subterrane:icicle_2")
|
||||
local c_icicle_3 = minetest.get_content_id("subterrane:icicle_3")
|
||||
local c_icicle_4 = minetest.get_content_id("subterrane:icicle_4") -- thickest
|
||||
subterrane.icicle_ids = {c_icicle_1, c_icicle_2, c_icicle_3, c_icicle_4}
|
||||
|
||||
local c_test = minetest.get_content_id("default:obsidian")
|
||||
|
||||
local c_air = minetest.get_content_id("air")
|
||||
|
||||
local wet_stalagmite_id = {c_wet_stal_1, c_wet_stal_2, c_wet_stal_3, c_wet_stal_4}
|
||||
local dry_stalagmite_id = {c_dry_stal_1, c_dry_stal_2, c_dry_stal_3, c_dry_stal_4}
|
||||
|
||||
-- use a negative height to turn this into a stalactite
|
||||
function subterrane:stalagmite(vi, area, data, param2_data, param2, height, is_wet)
|
||||
-- stalagmite_id is a table of the content ids of the four stalagmite sections, from _1 to _4.
|
||||
function subterrane:stalagmite(vi, area, data, param2_data, param2, height, stalagmite_id)
|
||||
local pos = area:position(vi)
|
||||
|
||||
local x = pos.x
|
||||
local y = pos.y
|
||||
local z = pos.z
|
||||
@ -23,9 +30,6 @@ function subterrane:stalagmite(vi, area, data, param2_data, param2, height, is_w
|
||||
if height == nil then height = math.random(1,4) end
|
||||
if param2 == nil then param2 = math.random(0,3) end
|
||||
|
||||
local stalagmite_id = nil
|
||||
if is_wet then stalagmite_id = wet_stalagmite_id else stalagmite_id = dry_stalagmite_id end
|
||||
|
||||
local sign, id_modifier
|
||||
if height > 0 then
|
||||
sign = 1
|
||||
|
@ -11,6 +11,82 @@ function subterrane:vertically_consistent_random(vi, area)
|
||||
return output
|
||||
end
|
||||
|
||||
local scatter_2d = function(min_xz, gridscale, min_output_size, max_output_size)
|
||||
local next_seed = math.random(1, 1000000000)
|
||||
math.randomseed(min_xz.x + min_xz.z * 2 ^ 8)
|
||||
local count = math.random(min_output_size, max_output_size)
|
||||
local result = {}
|
||||
while count > 0 do
|
||||
local point = {}
|
||||
point.val = math.random()
|
||||
point.x = math.random() * gridscale + min_xz.x
|
||||
point.y = 0
|
||||
point.z = math.random() * gridscale + min_xz.z
|
||||
table.insert(result, point)
|
||||
count = count - 1
|
||||
end
|
||||
|
||||
math.randomseed(next_seed)
|
||||
return result
|
||||
end
|
||||
|
||||
local get_nearest_grids = function(pos_xz, gridscale)
|
||||
local half_scale = gridscale / 2
|
||||
local grid_cell = {x = math.floor(pos_xz.x / gridscale) * gridscale, z = math.floor(pos_xz.z / gridscale) * gridscale}
|
||||
local pos_internal = {x = pos_xz.x % gridscale, z = pos_xz.z % gridscale}
|
||||
local result = {grid_cell}
|
||||
local shift_x = gridscale
|
||||
local shift_z = gridscale
|
||||
if (pos_internal.x < half_scale) then
|
||||
shift_x = -gridscale
|
||||
end
|
||||
if (pos_internal.z < half_scale) then
|
||||
shift_z = -gridscale
|
||||
end
|
||||
|
||||
table.insert(result, {x = grid_cell.x + shift_x, z = grid_cell.z + shift_z})
|
||||
table.insert(result, {x = grid_cell.x + shift_x, z = grid_cell.z})
|
||||
table.insert(result, {x = grid_cell.x, z = grid_cell.z + shift_z})
|
||||
|
||||
return result
|
||||
end
|
||||
|
||||
subterrane.get_scatter_grid = function(pos_xz, gridscale, min_output_size, max_output_size)
|
||||
local grids = get_nearest_grids(pos_xz, gridscale)
|
||||
local points = {}
|
||||
for _, grid in pairs(grids) do
|
||||
for _, point in pairs(scatter_2d(grid, gridscale, min_output_size, max_output_size)) do
|
||||
table.insert(points, point)
|
||||
end
|
||||
end
|
||||
|
||||
return points
|
||||
end
|
||||
|
||||
subterrane.prune_points = function(minp, maxp, min_radius, max_radius, points)
|
||||
local result = {}
|
||||
for _, point in pairs(points) do
|
||||
local radius = min_radius + point.val * (max_radius-min_radius)
|
||||
point.val = radius
|
||||
if point.x > minp.x - radius and point.x < maxp.x + radius and point.z > minp.z - radius and point.z < maxp.z + radius then
|
||||
table.insert(result, point)
|
||||
end
|
||||
end
|
||||
return result
|
||||
end
|
||||
|
||||
subterrane.get_point_heat = function(pos, points)
|
||||
local heat = 0
|
||||
for _, point in pairs(points) do
|
||||
point.y = pos.y
|
||||
local dist = vector.distance(pos, point)
|
||||
if dist < point.val then
|
||||
heat = math.max(heat, 1 - dist/point.val)
|
||||
end
|
||||
end
|
||||
return heat
|
||||
end
|
||||
|
||||
-- Unfortunately there's no easy way to override a single biome, so do it by wiping everything and re-registering
|
||||
-- Not only that, but the decorations also need to be wiped and re-registered - it appears they keep
|
||||
-- track of the biome they belong to via an internal ID that gets changed when the biomes
|
||||
|
101
init.lua
101
init.lua
@ -61,6 +61,7 @@ local c_lava = minetest.get_content_id("default:lava_source")
|
||||
local c_obsidian = minetest.get_content_id("default:obsidian")
|
||||
local c_stone = minetest.get_content_id("default:stone")
|
||||
local c_air = minetest.get_content_id("air")
|
||||
local c_wet_flowstone = minetest.get_content_id("subterrane:wet_flowstone")
|
||||
|
||||
subterrane.default_perlin_cave = {
|
||||
offset = 0,
|
||||
@ -86,6 +87,7 @@ local data_param2 = {}
|
||||
local nvals_cave_buffer = {}
|
||||
local nvals_wave_buffer = {}
|
||||
|
||||
-- cave_layer_def
|
||||
--{
|
||||
-- minimum_depth = -- required, the highest elevation this cave layer will be generated in.
|
||||
-- maximum_depth = -- required, the lowest elevation this cave layer will be generated in.
|
||||
@ -93,8 +95,42 @@ local nvals_wave_buffer = {}
|
||||
-- boundary_blend_range = -- optional, range near ymin and ymax over which caves diminish to nothing. Defaults to 128.
|
||||
-- perlin_cave = -- optional, a 3D perlin noise definition table to define the shape of the caves
|
||||
-- perlin_wave = -- optional, a 3D perlin noise definition table that's averaged with the cave noise to add floor strata (squash its spread on the y axis relative to perlin_cave to accomplish this)
|
||||
-- columns = -- optional, a column_def table for producing truly enormous dripstone formations
|
||||
--}
|
||||
|
||||
-- column_def
|
||||
--{
|
||||
-- max_column_radius = -- Maximum radius for individual columns, defaults to 10
|
||||
-- min_column_radius = -- Minimum radius for individual columns, defaults to 2 (going lower can increase the likelihood of "intermittent" columns with floating sections)
|
||||
-- node = -- node name to build columns out of. Defaults to "subterrane:wet_flowstone"
|
||||
-- weight = -- a floating point value (usually in the range of 0.5-1) to modify how strongly the column is affected by the surrounding cave. Lower values create a more variable, tapered stalactite/stalagmite combination whereas a value of 1 produces a roughly cylindrical column. Defaults to 0.5
|
||||
-- maximum_count = -- The maximum number of columns placed in any given column region (each region being a square 4 times the length and width of a map chunk). Defaults to 100
|
||||
-- minimum_count = -- The minimum number of columns placed in a column region. The actual number placed will be randomly selected between this range. Defaults to 25.
|
||||
--}
|
||||
|
||||
--extra biome properties used by subterrane
|
||||
--{
|
||||
-- _subterrane_ceiling_decor = -- function for putting stuff on the ceiling of the big caverns
|
||||
-- _subterrane_floor_decor = -- function for putting stuff on the floor of the big caverns
|
||||
-- _subterrane_fill_node = -- node to fill the cavern with (defaults to air)
|
||||
-- _subterrane_column_node = -- override the node the giant columns in this biome are made from
|
||||
-- _subterrane_cave_floor_decor = -- function for putting stuff on the floors of other preexisting open space
|
||||
-- _subterrane_cave_ceiling_decor = -- function for putting stuff on the ceiling of other preexisting open space
|
||||
-- _subterrane_mitigate_lava = -- try to patch the walls of big caverns with obsidian plugs when lava intersects. Not perfect, but helpful.
|
||||
-- _subterrane_override_sea_level = -- Y coordinate where an underground sea level begins. Biomes' y coordinate cutoffs are unreliable underground, this forces subterrane to take this sea level cutoff into account.
|
||||
-- _subterrane_override_under_sea_biome = -- When below the override_sea_level, the biome with this name will be looked up and substituted.
|
||||
-- _subterrane_column_node = -- overrides the node type of a cavern layer's column_def, if there are columns here.
|
||||
--}
|
||||
|
||||
local default_column = {
|
||||
max_column_radius = 10,
|
||||
min_column_radius = 2,
|
||||
node = c_wet_flowstone,
|
||||
weight = 0.25,
|
||||
maximum_count = 100,
|
||||
minimum_count = 25,
|
||||
}
|
||||
|
||||
function subterrane:register_cave_layer(cave_layer_def)
|
||||
|
||||
local YMIN = cave_layer_def.maximum_depth
|
||||
@ -112,6 +148,18 @@ function subterrane:register_cave_layer(cave_layer_def)
|
||||
local nobj_cave = nil
|
||||
local nobj_wave = nil
|
||||
|
||||
local column_def = cave_layer_def.columns
|
||||
local c_column
|
||||
|
||||
if column_def then
|
||||
column_def.max_column_radius = column_def.max_column_radius or default_column.max_column_radius
|
||||
column_def.min_column_radius = column_def.min_column_radius or default_column.min_column_radius
|
||||
c_column = column_def.node or default_column.node
|
||||
column_def.weight = column_def.weight or default_column.weight
|
||||
column_def.maximum_count = column_def.maximum_count or default_column.maximum_count
|
||||
column_def.minimum_count = column_def.minimum_count or default_column.minimum_count
|
||||
end
|
||||
|
||||
-- On generated function
|
||||
minetest.register_on_generated(function(minp, maxp, seed)
|
||||
--if out of range of cave definition limits, abort
|
||||
@ -127,7 +175,7 @@ function subterrane:register_cave_layer(cave_layer_def)
|
||||
subterrane.biome_ids[i] = desc.name
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--easy reference to commonly used values
|
||||
local t_start = os.clock()
|
||||
local x_max = maxp.x
|
||||
@ -152,7 +200,15 @@ function subterrane:register_cave_layer(cave_layer_def)
|
||||
local chunk_lengths2D = {x = sidelen, y = sidelen, z = 1}
|
||||
local minposxyz = {x = x_min, y = y_min, z = z_min} --bottom corner
|
||||
local minposxz = {x = x_min, y = z_min} --2D bottom corner
|
||||
|
||||
|
||||
local column_points = nil
|
||||
local column_weight = nil
|
||||
if column_def then
|
||||
column_points = subterrane.get_scatter_grid(minp, sidelen*4, column_def.minimum_count, column_def.maximum_count)
|
||||
column_points = subterrane.prune_points(minp, maxp, column_def.min_column_radius, column_def.max_column_radius, column_points)
|
||||
column_weight = column_def.weight
|
||||
end
|
||||
|
||||
nobj_cave = nobj_cave or minetest.get_perlin_map(np_cave, chunk_lengths)
|
||||
nobj_wave = nobj_wave or minetest.get_perlin_map(np_wave, chunk_lengths)
|
||||
|
||||
@ -182,17 +238,34 @@ function subterrane:register_cave_layer(cave_layer_def)
|
||||
local biome = minetest.registered_biomes[biome_name]
|
||||
|
||||
local fill_node = c_air
|
||||
if biome and biome._subterrane_fill_node then
|
||||
fill_node = biome._subterrane_fill_node
|
||||
local column_node = c_column
|
||||
if biome then
|
||||
if biome._subterrane_fill_node then
|
||||
fill_node = biome._subterrane_fill_node
|
||||
end
|
||||
if biome._subterrane_column_node then
|
||||
column_node = biome._subterrane_column_node
|
||||
end
|
||||
end
|
||||
|
||||
if (nvals_cave[index_3d] + nvals_wave[index_3d])/2 > tcave then --if node falls within cave threshold
|
||||
data[vi] = fill_node --hollow it out to make the cave
|
||||
local cave_value = (nvals_cave[index_3d] + nvals_wave[index_3d])/2
|
||||
local column_value = 0
|
||||
if column_def then
|
||||
column_value = subterrane.get_point_heat({x=x, y=y, z=z}, column_points, max_column_radius)
|
||||
end
|
||||
if cave_value > tcave then --if node falls within cave threshold
|
||||
if cave_value > tcave then
|
||||
if column_value > 0 and cave_value - column_value * column_weight < tcave then
|
||||
data[vi] = column_node -- add a column
|
||||
else
|
||||
data[vi] = fill_node --hollow it out to make the cave
|
||||
end
|
||||
end
|
||||
elseif biome and biome._subterrane_cave_fill_node and data[vi] == c_air then
|
||||
data[vi] = biome._subterrane_cave_fill_node
|
||||
end
|
||||
|
||||
if biome and biome._subterrane_mitigate_lava and (nvals_cave[index_3d] + nvals_wave[index_3d])/2 > tcave - 0.1 then -- Eliminate nearby lava to keep it from spilling in
|
||||
if biome and biome._subterrane_mitigate_lava and cave_value > tcave - 0.1 then -- Eliminate nearby lava to keep it from spilling in
|
||||
if data[vi] == c_lava then
|
||||
data[vi] = c_obsidian
|
||||
end
|
||||
@ -229,10 +302,20 @@ function subterrane:register_cave_layer(cave_layer_def)
|
||||
local biome = minetest.registered_biomes[biome_name]
|
||||
local fill_node = c_air
|
||||
local cave_fill_node = c_air
|
||||
|
||||
if biome and biome._subterrane_override_sea_level and y <= biome._subterrane_override_sea_level then
|
||||
local override_name = biome._subterrane_override_under_sea_biome
|
||||
if override_name then
|
||||
biome = minetest.registered_biomes[override_name]
|
||||
else
|
||||
biome = nil
|
||||
end
|
||||
end
|
||||
|
||||
if biome then
|
||||
local cave_value = (nvals_cave[index_3d] + nvals_wave[index_3d])/2
|
||||
-- only check nodes near the edges of caverns
|
||||
if math.floor(((nvals_cave[index_3d] + nvals_wave[index_3d])/2)*50) == math.floor(tcave*50) then
|
||||
if math.floor(cave_value*30) == math.floor(tcave*30) then
|
||||
if biome._subterrane_fill_node then
|
||||
fill_node = biome._subterrane_fill_node
|
||||
end
|
||||
@ -256,7 +339,7 @@ function subterrane:register_cave_layer(cave_layer_def)
|
||||
biome._subterrane_floor_decor(area, data, ai, vi, bi, data_param2)
|
||||
end
|
||||
|
||||
elseif (nvals_cave[index_3d] + nvals_wave[index_3d])/2 <= tcave then --if node falls outside cave threshold
|
||||
elseif cave_value <= tcave then --if node falls outside cave threshold
|
||||
-- decorate other "native" caves and tunnels
|
||||
if biome._subterrane_cave_fill_node then
|
||||
cave_fill_node = biome._subterrane_cave_fill_node
|
||||
|
242
nodes.lua
242
nodes.lua
@ -49,93 +49,70 @@ local stal_on_place = function(itemstack, placer, pointed_thing, itemname)
|
||||
return itemstack
|
||||
end
|
||||
|
||||
local stal_box_1 = {{-0.0625+x_disp, -0.5, -0.0625+z_disp, 0.0625+x_disp, 0.5, 0.0625+z_disp}}
|
||||
local stal_box_2 = {{-0.125+x_disp, -0.5, -0.125+z_disp, 0.125+x_disp, 0.5, 0.125+z_disp}}
|
||||
local stal_box_3 = {{-0.25+x_disp, -0.5, -0.25+z_disp, 0.25+x_disp, 0.5, 0.25+z_disp}}
|
||||
local stal_box_4 = {{-0.375+x_disp, -0.5, -0.375+z_disp, 0.375+x_disp, 0.5, 0.375+z_disp}}
|
||||
|
||||
minetest.register_node("subterrane:dry_stal_1", {
|
||||
subterrane.register_stalagmite_nodes = function(base_name, base_node_def, drop_base_name)
|
||||
base_node_def.groups = base_node_def.groups or {}
|
||||
base_node_def.groups.subterrane_stal_align = 1
|
||||
base_node_def.groups.flow_through = 1
|
||||
base_node_def.drawtype = "nodebox"
|
||||
base_node_def.paramtype = "light"
|
||||
base_node_def.paramtype2 = "facedir"
|
||||
base_node_def.is_ground_content = true
|
||||
base_node_def.node_box = {type = "fixed"}
|
||||
|
||||
base_node_def.groups.fall_damage_add_percent = 100
|
||||
base_node_def.node_box.fixed = stal_box_1
|
||||
base_node_def.on_place = function(itemstack, placer, pointed_thing)
|
||||
return stal_on_place(itemstack, placer, pointed_thing, base_name.."_1")
|
||||
end
|
||||
if drop_base_name then
|
||||
base_node_def.drop = drop_base_name.."_1"
|
||||
end
|
||||
minetest.register_node(base_name.."_1", base_node_def)
|
||||
|
||||
base_node_def.groups.fall_damage_add_percent = 50
|
||||
base_node_def.node_box.fixed = stal_box_2
|
||||
base_node_def.on_place = function(itemstack, placer, pointed_thing)
|
||||
return stal_on_place(itemstack, placer, pointed_thing, base_name.."_2")
|
||||
end
|
||||
if drop_base_name then
|
||||
base_node_def.drop = drop_base_name.."_2"
|
||||
end
|
||||
minetest.register_node(base_name.."_2", base_node_def)
|
||||
|
||||
base_node_def.groups.fall_damage_add_percent = nil
|
||||
base_node_def.node_box.fixed = stal_box_3
|
||||
base_node_def.on_place = function(itemstack, placer, pointed_thing)
|
||||
return stal_on_place(itemstack, placer, pointed_thing, base_name.."_3")
|
||||
end
|
||||
if drop_base_name then
|
||||
base_node_def.drop = drop_base_name.."_3"
|
||||
end
|
||||
minetest.register_node(base_name.."_3", base_node_def)
|
||||
|
||||
base_node_def.node_box.fixed = stal_box_4
|
||||
base_node_def.on_place = function(itemstack, placer, pointed_thing)
|
||||
return stal_on_place(itemstack, placer, pointed_thing, base_name.."_4")
|
||||
end
|
||||
if drop_base_name then
|
||||
base_node_def.drop = drop_base_name.."_4"
|
||||
end
|
||||
minetest.register_node(base_name.."_4", base_node_def)
|
||||
end
|
||||
|
||||
-----------------------------------------------
|
||||
|
||||
subterrane.register_stalagmite_nodes("subterrane:dry_stal", {
|
||||
description = S("Dry Dripstone"),
|
||||
tiles = {
|
||||
"default_stone.png^[brighten",
|
||||
},
|
||||
groups = {cracky = 3, stone = 2, subterrane_stal_align = 1, fall_damage_add_percent=100, flow_through=1,},
|
||||
groups = {cracky = 3, stone = 2},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
is_ground_content = true,
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.0625+x_disp, -0.5, -0.0625+z_disp, 0.0625+x_disp, 0.5, 0.0625+z_disp},
|
||||
}
|
||||
},
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
return stal_on_place(itemstack, placer, pointed_thing, "subterrane:dry_stal_1")
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("subterrane:dry_stal_2", {
|
||||
description = S("Dry Dripstone"),
|
||||
tiles = {
|
||||
"default_stone.png^[brighten",
|
||||
},
|
||||
groups = {cracky = 3, stone = 2, subterrane_stal_align = 1, fall_damage_add_percent=50, flow_through=1,},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
is_ground_content = true,
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.125+x_disp, -0.5, -0.125+z_disp, 0.125+x_disp, 0.5, 0.125+z_disp},
|
||||
}
|
||||
},
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
return stal_on_place(itemstack, placer, pointed_thing, "subterrane:dry_stal_2")
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("subterrane:dry_stal_3", {
|
||||
description = S("Dry Dripstone"),
|
||||
tiles = {
|
||||
"default_stone.png^[brighten",
|
||||
},
|
||||
groups = {cracky = 3, stone = 2, subterrane_stal_align = 1, flow_through=1,},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
is_ground_content = true,
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.25+x_disp, -0.5, -0.25+z_disp, 0.25+x_disp, 0.5, 0.25+z_disp},
|
||||
}
|
||||
},
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
return stal_on_place(itemstack, placer, pointed_thing, "subterrane:dry_stal_3")
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("subterrane:dry_stal_4", {
|
||||
description = S("Dry Dripstone"),
|
||||
tiles = {
|
||||
"default_stone.png^[brighten",
|
||||
},
|
||||
groups = {cracky = 3, stone = 2, subterrane_stal_align = 1, flow_through=1,},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
is_ground_content = true,
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.375+x_disp, -0.5, -0.375+z_disp, 0.375+x_disp, 0.5, 0.375+z_disp},
|
||||
}
|
||||
},
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
return stal_on_place(itemstack, placer, pointed_thing, "subterrane:dry_stal_4")
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("subterrane:dry_flowstone", {
|
||||
@ -147,101 +124,17 @@ minetest.register_node("subterrane:dry_flowstone", {
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
|
||||
-----------------------------------------------
|
||||
|
||||
|
||||
minetest.register_node("subterrane:wet_stal_1", {
|
||||
description = S("Wet Dripstone"),
|
||||
subterrane.register_stalagmite_nodes("subterrane:wet_stal", {
|
||||
description = S("Dry Dripstone"),
|
||||
tiles = {
|
||||
"default_stone.png^[brighten^subterrane_dripstone_streaks.png",
|
||||
},
|
||||
groups = {cracky = 3, stone = 2, subterrane_stal_align = 1, fall_damage_add_percent=100, subterrane_wet_dripstone = 1, flow_through=1,},
|
||||
groups = {cracky = 3, stone = 2, subterrane_wet_dripstone = 1},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
is_ground_content = true,
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.0625+x_disp, -0.5, -0.0625+z_disp, 0.0625+x_disp, 0.5, 0.0625+z_disp},
|
||||
}
|
||||
},
|
||||
drop = "subterrane:dry_stal_1",
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
return stal_on_place(itemstack, placer, pointed_thing, "subterrane:wet_stal_1")
|
||||
end,
|
||||
})
|
||||
}, "subterrane:dry_stal")
|
||||
|
||||
minetest.register_node("subterrane:wet_stal_2", {
|
||||
description = S("Wet Dripstone"),
|
||||
tiles = {
|
||||
"default_stone.png^[brighten^subterrane_dripstone_streaks.png",
|
||||
},
|
||||
groups = {cracky = 3, stone = 2, subterrane_stal_align = 1, fall_damage_add_percent=50, subterrane_wet_dripstone = 1, flow_through=1,},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
is_ground_content = true,
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.125+x_disp, -0.5, -0.125+z_disp, 0.125+x_disp, 0.5, 0.125+z_disp},
|
||||
}
|
||||
},
|
||||
drop = "subterrane:dry_stal_2",
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
return stal_on_place(itemstack, placer, pointed_thing, "subterrane:wet_stal_2")
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("subterrane:wet_stal_3", {
|
||||
description = S("Wet Dripstone"),
|
||||
tiles = {
|
||||
"default_stone.png^[brighten^subterrane_dripstone_streaks.png",
|
||||
},
|
||||
groups = {cracky = 3, stone = 2, subterrane_stal_align = 1, subterrane_wet_dripstone = 1, flow_through=1,},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
is_ground_content = true,
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.25+x_disp, -0.5, -0.25+z_disp, 0.25+x_disp, 0.5, 0.25+z_disp},
|
||||
}
|
||||
},
|
||||
drop = "subterrane:dry_stal_3",
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
return stal_on_place(itemstack, placer, pointed_thing, "subterrane:wet_stal_3")
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("subterrane:wet_stal_4", {
|
||||
description = S("Wet Dripstone"),
|
||||
tiles = {
|
||||
"default_stone.png^[brighten^subterrane_dripstone_streaks.png",
|
||||
},
|
||||
groups = {cracky = 3, stone = 2, subterrane_stal_align = 1, subterrane_wet_dripstone = 1, flow_through=1,},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
is_ground_content = true,
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.375+x_disp, -0.5, -0.375+z_disp, 0.375+x_disp, 0.5, 0.375+z_disp},
|
||||
}
|
||||
},
|
||||
drop = "subterrane:dry_stal_4",
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
return stal_on_place(itemstack, placer, pointed_thing, "subterrane:wet_stal_4")
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("subterrane:wet_flowstone", {
|
||||
description = S("Wet Flowstone"),
|
||||
@ -251,3 +144,14 @@ minetest.register_node("subterrane:wet_flowstone", {
|
||||
drop = 'default:cobble',
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
-----------------------------------------------
|
||||
|
||||
subterrane.register_stalagmite_nodes("subterrane:icicle", {
|
||||
description = S("Icicle"),
|
||||
tiles = {
|
||||
"default_ice.png",
|
||||
},
|
||||
groups = {cracky = 3, puts_out_fire = 1, cools_lava = 1, slippery = 3},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user