Creating the Sunless Sea level, adding giant columns

This commit is contained in:
FaceDeer 2018-04-22 08:01:13 -06:00
parent 869b964f15
commit 50e9c64a29
9 changed files with 219 additions and 77 deletions

View File

@ -5,6 +5,7 @@ local c_sand = minetest.get_content_id("default:sand")
local c_dirt = minetest.get_content_id("default:dirt")
local c_coal_ore = minetest.get_content_id("default:stone_with_coal")
local c_gravel = minetest.get_content_id("default:gravel")
local c_obsidian = minetest.get_content_id("default:obsidian")
local c_sweet_pod = minetest.get_content_id("dfcaverns:sweet_pod_6") -- param2 = 0
local c_quarry_bush = minetest.get_content_id("dfcaverns:quarry_bush_5") -- param2 = 4
@ -18,6 +19,7 @@ local c_cavern_fungi = minetest.get_content_id("dfcaverns:cavern_fungi") -- para
local c_dirt_moss = minetest.get_content_id("dfcaverns:dirt_with_cave_moss")
local c_cobble_fungus = minetest.get_content_id("dfcaverns:cobble_with_floor_fungus")
local c_wet_flowstone = minetest.get_content_id("subterrane:wet_flowstone")
local shallow_cave_floor = function(area, data, ai, vi, bi, param2_data)
if data[bi] ~= c_stone then
@ -28,7 +30,7 @@ local shallow_cave_floor = function(area, data, ai, vi, bi, param2_data)
if drip_rand < 0.025 then
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
local height = math.floor(drip_rand/0.025 * 4)
subterrane:stalagmite(vi, area, data, param2_data, param2, height, false)
subterrane:stalagmite(vi, area, data, param2_data, param2, height, subterrane.dry_stalagmite_ids)
end
end
@ -41,7 +43,7 @@ local shallow_cave_ceiling = function(area, data, ai, vi, bi, param2_data)
if drip_rand < 0.025 then
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
local height = math.floor(drip_rand/0.025 * 5)
subterrane:stalagmite(vi, area, data, param2_data, param2, -height, false)
subterrane:stalagmite(vi, area, data, param2_data, param2, -height, subterrane.dry_stalagmite_ids)
end
end
@ -91,6 +93,14 @@ subterrane:register_cave_layer({
cave_threshold = dfcaverns.config.cavern_threshold,
perlin_cave = perlin_cave,
perlin_wave = perlin_wave,
columns = {
maximum_radius = 10,
minimum_radius = 2,
node = c_wet_flowstone,
weight = 0.25,
maximum_count = 30,
minimum_count = 5,
},
})
subterrane:register_cave_layer({
@ -99,6 +109,14 @@ subterrane:register_cave_layer({
cave_threshold = dfcaverns.config.cavern_threshold,
perlin_cave = perlin_cave,
perlin_wave = perlin_wave,
columns = {
maximum_radius = 15,
minimum_radius = 2,
node = c_wet_flowstone,
weight = 0.25,
maximum_count = 50,
minimum_count = 10,
},
})
local perlin_cave_lava = {
@ -121,12 +139,38 @@ local perlin_wave_lava = {
subterrane:register_cave_layer({
minimum_depth = dfcaverns.config.level3_min,
maximum_depth = dfcaverns.config.lava_sea_min,
maximum_depth = dfcaverns.config.sunless_sea_min,
cave_threshold = dfcaverns.config.lava_sea_threshold,
perlin_cave = perlin_cave_lava,
perlin_wave = perlin_wave_lava,
columns = {
maximum_radius = 25,
minimum_radius = 2,
node = c_wet_flowstone,
weight = 0.25,
maximum_count = 100,
minimum_count = 25,
},
})
if dfcaverns.config.enable_lava_sea then
subterrane:register_cave_layer({
minimum_depth = dfcaverns.config.lava_sea_max,
maximum_depth = dfcaverns.config.lava_sea_min,
cave_threshold = dfcaverns.config.lava_sea_threshold,
perlin_cave = perlin_cave_lava,
perlin_wave = perlin_wave_lava,
columns = {
maximum_radius = 30,
minimum_radius = 5,
node = c_obsidian,
weight = 0.5,
maximum_count = 100,
minimum_count = 25,
},
})
end
dfcaverns.can_support_vegetation = {[c_sand] = true, [c_dirt] = true, [c_coal_ore] = true, [c_gravel] = true}
dfcaverns.place_shrub = function(data, vi, param2_data, shrub_list)

View File

@ -6,41 +6,25 @@ local c_dirt = minetest.get_content_id("default:dirt")
local c_sand = minetest.get_content_id("default:sand")
local c_lava = minetest.get_content_id("default:lava_source")
local c_dirt_moss = minetest.get_content_id("dfcaverns:dirt_with_cave_moss")
local c_cobble_fungus = minetest.get_content_id("dfcaverns:cobble_with_floor_fungus")
local c_dead_fungus = minetest.get_content_id("dfcaverns:dead_fungus") -- param2 = 0
local c_cavern_fungi = minetest.get_content_id("dfcaverns:cavern_fungi") -- param2 = 0
-------------------------------------------------------------------------------------------
local lava_sea_biome_def = {
name = "dfcaverns_lava_sea",
y_min = dfcaverns.config.lava_sea_min,
y_max = dfcaverns.config.level3_min,
y_max = dfcaverns.config.lava_sea_max,
heat_point = 50,
humidity_point = 50,
}
if not dfcaverns.config.bottom_sea_contains_lava then
lava_sea_biome_def._subterrane_mitigate_lava = true
end
minetest.register_biome(lava_sea_biome_def)
local c_sea
if dfcaverns.config.bottom_sea_contains_lava then
c_sea = c_lava
else
c_sea = c_water
end
local airspace = 256
local airspace = (dfcaverns.config.lava_sea_max - dfcaverns.config.lava_sea_min) / 3
local data = {}
minetest.register_on_generated(function(minp, maxp, seed)
--if out of range of cave definition limits, abort
if minp.y > dfcaverns.config.level3_min - airspace or maxp.y < dfcaverns.config.lava_sea_min then
if minp.y > dfcaverns.config.lava_sea_max - airspace or maxp.y < dfcaverns.config.lava_sea_min then
return
end
@ -62,7 +46,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
local vi = area:index(x_min, y, z) --current node index
for x = x_min, x_max do -- for each node do
if data[vi] == c_air or data[vi] == c_water then
data[vi] = c_sea
data[vi] = c_lava
end
vi = vi + 1
end

View File

@ -11,7 +11,7 @@ local c_cobble_fungus = minetest.get_content_id("dfcaverns:cobble_with_floor_fun
local c_wet_flowstone = minetest.get_content_id("subterrane:wet_flowstone")
local c_dry_flowstone = minetest.get_content_id("subterrane:dry_flowstone")
local subsea_level = (dfcaverns.config.level1_min - dfcaverns.config.ymax) * 0.3 + dfcaverns.config.level1_min
local subsea_level = (dfcaverns.config.ymax - dfcaverns.config.level1_min) * 0.3 + dfcaverns.config.level1_min
local c_sweet_pod = minetest.get_content_id("dfcaverns:sweet_pod_6") -- param2 = 0
local c_quarry_bush = minetest.get_content_id("dfcaverns:quarry_bush_5") -- param2 = 4
@ -41,7 +41,7 @@ local level_1_tower_cap_floor = function(area, data, ai, vi, bi, param2_data)
elseif drip_rand < 0.1 then
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
local height = math.floor(drip_rand/0.1 * 5)
subterrane:stalagmite(vi, area, data, param2_data, param2, height, true)
subterrane:stalagmite(vi, area, data, param2_data, param2, height, subterrane.wet_stalagmite_ids)
elseif math.random() < 0.005 then
dfcaverns.spawn_tower_cap_vm(vi, area, data)
end
@ -67,7 +67,7 @@ local level_1_fungiwood_floor = function(area, data, ai, vi, bi, param2_data)
elseif drip_rand < 0.1 then
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
local height = math.floor(drip_rand/0.1 * 5)
subterrane:stalagmite(vi, area, data, param2_data, param2, height, true)
subterrane:stalagmite(vi, area, data, param2_data, param2, height, subterrane.wet_stalagmite_ids)
elseif math.random() < 0.005 then
dfcaverns.spawn_fungiwood_vm(vi, area, data)
end
@ -83,7 +83,7 @@ local level_1_moist_ceiling = function(area, data, ai, vi, bi, param2_data)
elseif drip_rand < 0.075 then
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
local height = math.floor(drip_rand/0.075 * 5)
subterrane:stalagmite(vi, area, data, param2_data, param2, -height, true)
subterrane:stalagmite(vi, area, data, param2_data, param2, -height, subterrane.wet_stalagmite_ids)
elseif math.random() < 0.03 then
dfcaverns.glow_worm_ceiling(area, data, ai, vi, bi)
end
@ -110,7 +110,7 @@ local level_1_wet_floor = function(area, data, ai, vi, bi, param2_data)
elseif drip_rand < 0.025 then
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
local height = math.floor(drip_rand/0.025 * 5)
subterrane:stalagmite(vi, area, data, param2_data, param2, height, true)
subterrane:stalagmite(vi, area, data, param2_data, param2, height, subterrane.wet_stalagmite_ids)
end
end
@ -134,7 +134,7 @@ local level_1_dry_floor = function(area, data, ai, vi, bi, param2_data)
elseif drip_rand < 0.05 then
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
local height = math.floor(drip_rand/0.05 * 5)
subterrane:stalagmite(vi, area, data, param2_data, param2, height, false)
subterrane:stalagmite(vi, area, data, param2_data, param2, height, subterrane.dry_stalagmite_ids)
end
end
@ -148,7 +148,7 @@ local level_1_dry_ceiling = function(area, data, ai, vi, bi, param2_data)
elseif drip_rand < 0.075 then
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
local height = math.floor(drip_rand/0.075 * 5)
subterrane:stalagmite(vi, area, data, param2_data, param2, -height, false)
subterrane:stalagmite(vi, area, data, param2_data, param2, -height, subterrane.dry_stalagmite_ids)
end
end
@ -189,7 +189,7 @@ local level_1_cave_floor = function(area, data, ai, vi, bi, param2_data)
if drip_rand < 0.075 then
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
local height = math.floor(drip_rand/0.075 * 4)
subterrane:stalagmite(vi, area, data, param2_data, param2, height, true)
subterrane:stalagmite(vi, area, data, param2_data, param2, height, subterrane.wet_stalagmite_ids)
end
end
@ -203,7 +203,7 @@ local level_1_cave_ceiling = function(area, data, ai, vi, bi, param2_data)
if drip_rand < 0.1 then
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
local height = math.floor(drip_rand/0.1 * 5)
subterrane:stalagmite(vi, area, data, param2_data, param2, -height, true)
subterrane:stalagmite(vi, area, data, param2_data, param2, -height, subterrane.wet_stalagmite_ids)
end
end

View File

@ -27,7 +27,7 @@ local c_cave_wheat = minetest.get_content_id("dfcaverns:cave_wheat_8") -- param2
local c_dead_fungus = minetest.get_content_id("dfcaverns:dead_fungus") -- param2 = 0
local c_cavern_fungi = minetest.get_content_id("dfcaverns:cavern_fungi") -- param2 = 0
local subsea_level = (dfcaverns.config.level2_min - dfcaverns.config.level1_min) * 0.3 + dfcaverns.config.level2_min
local subsea_level = (dfcaverns.config.level1_min - dfcaverns.config.level2_min) * 0.3 + dfcaverns.config.level2_min
local level_2_tower_cap_floor = function(area, data, ai, vi, bi, param2_data)
@ -49,7 +49,7 @@ local level_2_tower_cap_floor = function(area, data, ai, vi, bi, param2_data)
elseif drip_rand < 0.1 then
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
local height = math.floor(drip_rand/0.1 * 5)
subterrane:stalagmite(vi, area, data, param2_data, param2, height, true)
subterrane:stalagmite(vi, area, data, param2_data, param2, height, subterrane.wet_stalagmite_ids)
elseif math.random() < 0.005 then
dfcaverns.spawn_tower_cap_vm(vi, area, data)
end
@ -73,7 +73,7 @@ local level_2_fungiwood_floor = function(area, data, ai, vi, bi, param2_data)
elseif drip_rand < 0.1 then
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
local height = math.floor(drip_rand/0.1 * 5)
subterrane:stalagmite(vi, area, data, param2_data, param2, height, true)
subterrane:stalagmite(vi, area, data, param2_data, param2, height, subterrane.wet_stalagmite_ids)
elseif math.random() < 0.005 then
dfcaverns.spawn_fungiwood_vm(vi, area, data)
end
@ -97,7 +97,7 @@ local level_2_tunnel_tube_floor = function(area, data, ai, vi, bi, param2_data)
elseif drip_rand < 0.1 then
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
local height = math.floor(drip_rand/0.1 * 5)
subterrane:stalagmite(vi, area, data, param2_data, param2, height, true)
subterrane:stalagmite(vi, area, data, param2_data, param2, height, subterrane.wet_stalagmite_ids)
elseif math.random() < 0.05 then
dfcaverns.spawn_tunnel_tube_vm(vi, area, data, param2_data)
end
@ -123,7 +123,7 @@ local level_2_black_cap_floor = function(area, data, ai, vi, bi, param2_data)
elseif drip_rand < 0.1 then
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
local height = math.floor(drip_rand/0.1 * 5)
subterrane:stalagmite(vi, area, data, param2_data, param2, height, true)
subterrane:stalagmite(vi, area, data, param2_data, param2, height, subterrane.wet_stalagmite_ids)
elseif math.random() < 0.025 then
dfcaverns.spawn_black_cap_vm(vi, area, data)
end
@ -149,7 +149,7 @@ local level_2_spore_tree_floor = function(area, data, ai, vi, bi, param2_data)
elseif drip_rand < 0.1 then
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
local height = math.floor(drip_rand/0.1 * 5)
subterrane:stalagmite(vi, area, data, param2_data, param2, height, true)
subterrane:stalagmite(vi, area, data, param2_data, param2, height, subterrane.wet_stalagmite_ids)
elseif math.random() < 0.05 then
dfcaverns.spawn_spore_tree_vm(vi, area, data)
end
@ -175,7 +175,7 @@ local level_2_goblin_cap_floor = function(area, data, ai, vi, bi, param2_data)
elseif drip_rand < 0.1 then
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
local height = math.floor(drip_rand/0.1 * 5)
subterrane:stalagmite(vi, area, data, param2_data, param2, height, true)
subterrane:stalagmite(vi, area, data, param2_data, param2, height, subterrane.wet_stalagmite_ids)
elseif math.random() < 0.025 then
dfcaverns.spawn_goblin_cap_vm(vi, area, data)
end
@ -192,7 +192,7 @@ local level_2_moist_ceiling = function(area, data, ai, vi, bi, param2_data)
elseif drip_rand < 0.07 then
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
local height = math.floor(drip_rand/0.07 * 5)
subterrane:stalagmite(vi, area, data, param2_data, param2, -height, true)
subterrane:stalagmite(vi, area, data, param2_data, param2, -height, subterrane.wet_stalagmite_ids)
elseif math.random() < 0.025 then
dfcaverns.glow_worm_ceiling(area, data, ai, vi, bi)
end
@ -219,7 +219,7 @@ local level_2_wet_floor = function(area, data, ai, vi, bi, param2_data)
elseif drip_rand < 0.05 then
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
local height = math.floor(drip_rand/0.05 * 5)
subterrane:stalagmite(vi, area, data, param2_data, param2, height, true)
subterrane:stalagmite(vi, area, data, param2_data, param2, height, subterrane.wet_stalagmite_ids)
end
end
@ -243,7 +243,7 @@ local level_2_dry_floor = function(area, data, ai, vi, bi, param2_data)
elseif drip_rand < 0.05 then
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
local height = math.floor(drip_rand/0.05 * 5)
subterrane:stalagmite(vi, area, data, param2_data, param2, height, false)
subterrane:stalagmite(vi, area, data, param2_data, param2, height, subterrane.dry_stalagmite_ids)
end
end
@ -255,7 +255,7 @@ local level_2_dry_ceiling = function(area, data, ai, vi, bi, param2_data)
if drip_rand < 0.075 then
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
local height = math.floor(drip_rand/0.075 * 5)
subterrane:stalagmite(vi, area, data, param2_data, param2, -height, false)
subterrane:stalagmite(vi, area, data, param2_data, param2, -height, subterrane.dry_stalagmite_ids)
end
end
@ -285,7 +285,7 @@ local level_2_cave_floor = function(area, data, ai, vi, bi, param2_data)
if drip_rand < 0.075 then
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
local height = math.floor(drip_rand/0.075 * 4)
subterrane:stalagmite(vi, area, data, param2_data, param2, height, true)
subterrane:stalagmite(vi, area, data, param2_data, param2, height, subterrane.wet_stalagmite_ids)
end
end
@ -299,7 +299,7 @@ local level_2_cave_ceiling = function(area, data, ai, vi, bi, param2_data)
if drip_rand < 0.1 then
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
local height = math.floor(drip_rand/0.1 * 5)
subterrane:stalagmite(vi, area, data, param2_data, param2, -height, true)
subterrane:stalagmite(vi, area, data, param2_data, param2, -height, subterrane.wet_stalagmite_ids)
end
end
@ -482,6 +482,7 @@ minetest.register_biome({
_subterrane_ceiling_decor = level_2_dry_ceiling,
_subterrane_floor_decor = level_2_black_cap_floor,
_subterrane_fill_node = c_air,
_subterrane_column_node = c_dry_flowstone,
_subterrane_cave_floor_decor = level_2_cave_floor,
_subterrane_cave_ceiling_decor = level_2_cave_ceiling,
_subterrane_mitigate_lava = true,
@ -496,6 +497,7 @@ minetest.register_biome({
_subterrane_ceiling_decor = level_2_dry_ceiling,
_subterrane_floor_decor = level_2_black_cap_floor,
_subterrane_fill_node = c_air,
_subterrane_column_node = c_dry_flowstone,
_subterrane_cave_floor_decor = level_2_cave_floor,
_subterrane_cave_ceiling_decor = level_2_cave_ceiling,
_subterrane_mitigate_lava = true,
@ -510,6 +512,7 @@ minetest.register_biome({
_subterrane_ceiling_decor = level_2_dry_ceiling,
_subterrane_floor_decor = level_2_dry_floor,
_subterrane_fill_node = c_air,
_subterrane_column_node = c_dry_flowstone,
_subterrane_mitigate_lava = false,
})
@ -522,5 +525,6 @@ minetest.register_biome({
_subterrane_ceiling_decor = level_2_dry_ceiling,
_subterrane_floor_decor = level_2_dry_floor,
_subterrane_fill_node = c_air,
_subterrane_column_node = c_dry_flowstone,
_subterrane_mitigate_lava = false,
})

View File

@ -32,7 +32,7 @@ local c_cave_wheat = minetest.get_content_id("dfcaverns:cave_wheat_8") -- param2
local c_dead_fungus = minetest.get_content_id("dfcaverns:dead_fungus") -- param2 = 0
local c_cavern_fungi = minetest.get_content_id("dfcaverns:cavern_fungi") -- param2 = 0
local subsea_level = (dfcaverns.config.level3_min - dfcaverns.config.level2_min) * 0.3 + dfcaverns.config.level3_min
local subsea_level = (dfcaverns.config.level2_min - dfcaverns.config.level3_min) * 0.3 + dfcaverns.config.level3_min
local level_3_moist_ceiling = function(area, data, ai, vi, bi, param2_data)
if data[ai] ~= c_stone then
@ -44,7 +44,7 @@ local level_3_moist_ceiling = function(area, data, ai, vi, bi, param2_data)
elseif drip_rand < 0.075 then
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
local height = math.floor(drip_rand/0.075 * 5)
subterrane:stalagmite(vi, area, data, param2_data, param2, -height, true)
subterrane:stalagmite(vi, area, data, param2_data, param2, -height, subterrane.wet_stalagmite_ids)
elseif math.random() < 0.03 then
dfcaverns.glow_worm_ceiling(area, data, ai, vi, bi)
end
@ -70,7 +70,7 @@ local level_3_dry_floor = function(area, data, ai, vi, bi, param2_data)
elseif drip_rand < 0.05 then
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
local height = math.floor(drip_rand/0.05 * 5)
subterrane:stalagmite(vi, area, data, param2_data, param2, height, false)
subterrane:stalagmite(vi, area, data, param2_data, param2, height, subterrane.dry_stalagmite_ids)
end
end
@ -95,7 +95,7 @@ local level_3_wet_floor = function(area, data, ai, vi, bi, param2_data)
elseif drip_rand < 0.05 then
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
local height = math.floor(drip_rand/0.05 * 5)
subterrane:stalagmite(vi, area, data, param2_data, param2, height, true)
subterrane:stalagmite(vi, area, data, param2_data, param2, height, subterrane.wet_stalagmite_ids)
end
end
@ -115,7 +115,7 @@ local level_3_dry_ceiling = function(area, data, ai, vi, bi, param2_data)
if drip_rand < 0.075 then
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
local height = math.floor(drip_rand/0.075 * 5)
subterrane:stalagmite(vi, area, data, param2_data, param2, -height, false)
subterrane:stalagmite(vi, area, data, param2_data, param2, -height, subterrane.dry_stalagmite_ids)
end
end
@ -136,7 +136,7 @@ local level_3_blood_thorn_floor = function(area, data, ai, vi, bi, param2_data)
elseif drip_rand < 0.05 then
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
local height = math.floor(drip_rand/0.05 * 5)
subterrane:stalagmite(vi, area, data, param2_data, param2, height, false)
subterrane:stalagmite(vi, area, data, param2_data, param2, height, subterrane.dry_stalagmite_ids)
elseif math.random() < 0.05 then
dfcaverns.spawn_blood_thorn_vm(vi, area, data, param2_data)
end
@ -165,7 +165,7 @@ local level_3_nether_cap_floor = function(area, data, ai, vi, bi, param2_data)
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
local height = math.floor(drip_rand/0.1 * 5)
data[vi] = c_air
subterrane:stalagmite(vi, area, data, param2_data, param2, height, false)
subterrane:stalagmite(vi, area, data, param2_data, param2, height, subterrane.icicle_ids)
elseif math.random() < 0.005 then
dfcaverns.spawn_nether_cap_vm(vi, area, data)
end
@ -190,7 +190,7 @@ local level_3_tunnel_tube_floor = function(area, data, ai, vi, bi, param2_data)
elseif drip_rand < 0.1 then
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
local height = math.floor(drip_rand/0.1 * 5)
subterrane:stalagmite(vi, area, data, param2_data, param2, height, true)
subterrane:stalagmite(vi, area, data, param2_data, param2, height, subterrane.wet_stalagmite_ids)
elseif math.random() < 0.05 then
dfcaverns.spawn_tunnel_tube_vm(vi, area, data, param2_data)
end
@ -216,7 +216,7 @@ local level_3_spore_tree_floor = function(area, data, ai, vi, bi, param2_data)
elseif drip_rand < 0.1 then
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
local height = math.floor(drip_rand/0.1 * 5)
subterrane:stalagmite(vi, area, data, param2_data, param2, height, true)
subterrane:stalagmite(vi, area, data, param2_data, param2, height, subterrane.wet_stalagmite_ids)
elseif math.random() < 0.05 then
dfcaverns.spawn_spore_tree_vm(vi, area, data)
end
@ -242,7 +242,7 @@ local level_3_black_cap_floor = function(area, data, ai, vi, bi, param2_data)
elseif drip_rand < 0.1 then
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
local height = math.floor(drip_rand/0.1 * 5)
subterrane:stalagmite(vi, area, data, param2_data, param2, height, true)
subterrane:stalagmite(vi, area, data, param2_data, param2, height, subterrane.dry_stalagmite_ids)
elseif math.random() < 0.025 then
dfcaverns.spawn_black_cap_vm(vi, area, data)
end
@ -266,7 +266,7 @@ local level_3_goblin_cap_floor = function(area, data, ai, vi, bi, param2_data)
elseif drip_rand < 0.1 then
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
local height = math.floor(drip_rand/0.1 * 5)
subterrane:stalagmite(vi, area, data, param2_data, param2, height, true)
subterrane:stalagmite(vi, area, data, param2_data, param2, height, subterrane.wet_stalagmite_ids)
elseif math.random() < 0.025 then
dfcaverns.spawn_goblin_cap_vm(vi, area, data)
end
@ -296,7 +296,7 @@ local level_3_cave_floor = function(area, data, ai, vi, bi, param2_data)
if drip_rand < 0.075 then
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
local height = math.floor(drip_rand/0.075 * 4)
subterrane:stalagmite(vi, area, data, param2_data, param2, height, true)
subterrane:stalagmite(vi, area, data, param2_data, param2, height, subterrane.wet_stalagmite_ids)
end
end
@ -310,7 +310,7 @@ local level_3_cave_ceiling = function(area, data, ai, vi, bi, param2_data)
if drip_rand < 0.1 then
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
local height = math.floor(drip_rand/0.1 * 5)
subterrane:stalagmite(vi, area, data, param2_data, param2, -height, true)
subterrane:stalagmite(vi, area, data, param2_data, param2, -height, subterrane.wet_stalagmite_ids)
end
end
@ -319,7 +319,7 @@ end
minetest.register_biome({
name = "dfcaverns_level3_flooded_biome_lower",
y_min = dfcaverns.config.level3_min,
y_min = dfcaverns.config.sunless_sea_level,
y_max = subsea_level,
heat_point = 50,
humidity_point = 90,
@ -344,15 +344,18 @@ minetest.register_biome({
minetest.register_biome({
name = "dfcaverns_level3_blood_thorn_biome_lower",
y_min = dfcaverns.config.level3_min,
y_min = dfcaverns.config.sunless_sea_level,
y_max = subsea_level,
heat_point = 10,
humidity_point = 30,
_subterrane_ceiling_decor = level_3_dry_ceiling,
_subterrane_floor_decor = level_3_blood_thorn_floor,
_subterrane_fill_node = c_air,
_subterrane_column_node = c_dry_flowstone,
_subterrane_cave_floor_decor = level_3_cave_floor,
_subterrane_cave_ceiling_decor = level_3_cave_ceiling,
_subterrane_override_sea_level = dfcaverns.config.sunless_sea_level,
_subterrane_override_under_sea_biome = "dfcaverns_sunless_sea",
_subterrane_mitigate_lava = true,
})
@ -364,6 +367,7 @@ minetest.register_biome({
humidity_point = 30,
_subterrane_ceiling_decor = level_3_dry_ceiling,
_subterrane_floor_decor = level_3_blood_thorn_floor,
_subterrane_column_node = c_dry_flowstone,
_subterrane_fill_node = c_air,
_subterrane_cave_floor_decor = level_3_cave_floor,
_subterrane_cave_ceiling_decor = level_3_cave_ceiling,
@ -372,15 +376,18 @@ minetest.register_biome({
minetest.register_biome({
name = "dfcaverns_level3_nether_cap_biome_lower",
y_min = dfcaverns.config.level3_min,
y_min = dfcaverns.config.sunless_sea_level,
y_max = subsea_level,
heat_point = 90,
humidity_point = 50,
_subterrane_ceiling_decor = level_3_dry_ceiling,
_subterrane_floor_decor = level_3_nether_cap_floor,
_subterrane_fill_node = c_air,
_subterrane_column_node = c_ice,
_subterrane_cave_floor_decor = level_3_cave_floor,
_subterrane_cave_ceiling_decor = level_3_cave_ceiling,
_subterrane_override_sea_level = dfcaverns.config.sunless_sea_level,
_subterrane_override_under_sea_biome = "dfcaverns_sunless_sea",
_subterrane_mitigate_lava = true,
})
@ -393,6 +400,7 @@ minetest.register_biome({
_subterrane_ceiling_decor = level_3_dry_ceiling,
_subterrane_floor_decor = level_3_nether_cap_floor,
_subterrane_fill_node = c_air,
_subterrane_column_node = c_ice,
_subterrane_cave_floor_decor = level_3_cave_floor,
_subterrane_cave_ceiling_decor = level_3_cave_ceiling,
_subterrane_mitigate_lava = true,
@ -400,7 +408,7 @@ minetest.register_biome({
minetest.register_biome({
name = "dfcaverns_level3_goblin_cap_biome_lower",
y_min = dfcaverns.config.level3_min,
y_min = dfcaverns.config.sunless_sea_level,
y_max = subsea_level,
heat_point = 20,
humidity_point = 60,
@ -409,6 +417,8 @@ minetest.register_biome({
_subterrane_fill_node = c_air,
_subterrane_cave_floor_decor = level_3_cave_floor,
_subterrane_cave_ceiling_decor = level_3_cave_ceiling,
_subterrane_override_sea_level = dfcaverns.config.sunless_sea_level,
_subterrane_override_under_sea_biome = "dfcaverns_sunless_sea",
_subterrane_mitigate_lava = true,
})
@ -428,7 +438,7 @@ minetest.register_biome({
minetest.register_biome({
name = "dfcaverns_level3_spore_tree_biome_lower",
y_min = dfcaverns.config.level3_min,
y_min = dfcaverns.config.sunless_sea_level,
y_max = subsea_level,
heat_point = 60,
humidity_point = 60,
@ -437,6 +447,8 @@ minetest.register_biome({
_subterrane_fill_node = c_air,
_subterrane_cave_floor_decor = level_3_cave_floor,
_subterrane_cave_ceiling_decor = level_3_cave_ceiling,
_subterrane_override_sea_level = dfcaverns.config.sunless_sea_level,
_subterrane_override_under_sea_biome = "dfcaverns_sunless_sea",
_subterrane_mitigate_lava = true,
})
@ -456,7 +468,7 @@ minetest.register_biome({
minetest.register_biome({
name = "dfcaverns_level3_tunnel_tube_biome_lower",
y_min = dfcaverns.config.level3_min,
y_min = dfcaverns.config.sunless_sea_level,
y_max = subsea_level,
heat_point = 60,
humidity_point = 40,
@ -465,6 +477,8 @@ minetest.register_biome({
_subterrane_fill_node = c_air,
_subterrane_cave_floor_decor = level_3_cave_floor,
_subterrane_cave_ceiling_decor = level_3_cave_ceiling,
_subterrane_override_sea_level = dfcaverns.config.sunless_sea_level,
_subterrane_override_under_sea_biome = "dfcaverns_sunless_sea",
_subterrane_mitigate_lava = true,
})
@ -484,27 +498,31 @@ minetest.register_biome({
minetest.register_biome({
name = "dfcaverns_level3_black_cap_biome_lower",
y_min = dfcaverns.config.level2_min,
y_min = dfcaverns.config.sunless_sea_level,
y_max = subsea_level,
heat_point = 50,
humidity_point = 15,
_subterrane_ceiling_decor = level_3_dry_ceiling,
_subterrane_floor_decor = level_3_black_cap_floor,
_subterrane_fill_node = c_air,
_subterrane_column_node = c_dry_flowstone,
_subterrane_cave_floor_decor = level_3_cave_floor,
_subterrane_cave_ceiling_decor = level_3_cave_ceiling,
_subterrane_override_sea_level = dfcaverns.config.sunless_sea_level,
_subterrane_override_under_sea_biome = "dfcaverns_sunless_sea",
_subterrane_mitigate_lava = true,
})
minetest.register_biome({
name = "dfcaverns_level3_black_cap_biome_upper",
y_min = subsea_level,
y_max = dfcaverns.config.level3_min,
y_max = dfcaverns.config.level2_min,
heat_point = 50,
humidity_point = 15,
_subterrane_ceiling_decor = level_3_dry_ceiling,
_subterrane_floor_decor = level_3_black_cap_floor,
_subterrane_fill_node = c_air,
_subterrane_column_node = c_dry_flowstone,
_subterrane_cave_floor_decor = level_3_cave_floor,
_subterrane_cave_ceiling_decor = level_3_cave_ceiling,
_subterrane_mitigate_lava = true,
@ -512,13 +530,14 @@ minetest.register_biome({
minetest.register_biome({
name = "dfcaverns_level3_dry_biome_lower",
y_min = dfcaverns.config.level3_min,
y_min = dfcaverns.config.sunless_sea_level,
y_max = subsea_level,
heat_point = 50,
humidity_point = 10,
_subterrane_ceiling_decor = level_3_dry_ceiling,
_subterrane_floor_decor = level_3_dry_floor,
_subterrane_fill_node = c_air,
_subterrane_column_node = c_dry_flowstone,
_subterrane_mitigate_lava = false,
})
@ -531,5 +550,6 @@ minetest.register_biome({
_subterrane_ceiling_decor = level_3_dry_ceiling,
_subterrane_floor_decor = level_3_dry_floor,
_subterrane_fill_node = c_air,
_subterrane_column_node = c_dry_flowstone,
_subterrane_mitigate_lava = false,
})

81
biomes/sunless_sea.lua Normal file
View File

@ -0,0 +1,81 @@
local c_water = minetest.get_content_id("default:water_source")
local c_air = minetest.get_content_id("air")
local c_stone = minetest.get_content_id("default:stone")
local c_cobble = minetest.get_content_id("default:cobble")
local c_dirt = minetest.get_content_id("default:dirt")
local c_sand = minetest.get_content_id("default:sand")
local c_dirt_moss = minetest.get_content_id("dfcaverns:dirt_with_cave_moss")
local c_cobble_fungus = minetest.get_content_id("dfcaverns:cobble_with_floor_fungus")
local c_dead_fungus = minetest.get_content_id("dfcaverns:dead_fungus") -- param2 = 0
local c_cavern_fungi = minetest.get_content_id("dfcaverns:cavern_fungi") -- param2 = 0
-------------------------------------------------------------------------------------------
minetest.debug(dfcaverns.config.sunless_sea_min)
minetest.debug(dfcaverns.config.sunless_sea_level)
local sunless_sea_underwater_floor = function(area, data, ai, vi, bi, param2_data)
if data[bi] ~= c_stone then
return
end
data[bi] = c_dirt
end
local sunless_sea_biome_def = {
name = "dfcaverns_sunless_sea",
y_min = dfcaverns.config.sunless_sea_min,
y_max = dfcaverns.config.sunless_sea_level,
heat_point = 50,
humidity_point = 50,
_subterrane_fill_node = c_water,
_subterrane_cave_fill_node = c_water,
_subterrane_mitigate_lava = true,
_subterrane_floor_decor = sunless_sea_underwater_floor,
}
minetest.register_biome(sunless_sea_biome_def)
local data = {}
minetest.register_on_generated(function(minp, maxp, seed)
--if out of range of cave definition limits, abort
if minp.y > dfcaverns.config.sunless_sea_level or maxp.y < dfcaverns.config.sunless_sea_min then
return
end
--easy reference to commonly used values
local t_start = os.clock()
local x_max = maxp.x
local y_max = maxp.y
local z_max = maxp.z
local x_min = minp.x
local y_min = minp.y
local z_min = minp.z
local vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
local area = VoxelArea:new{MinEdge=emin, MaxEdge=emax}
vm:get_data(data)
for z = z_min, z_max do -- for each xy plane progressing northwards
for y = y_min, y_max do -- for each x row progressing upwards
if y <= dfcaverns.config.sunless_sea_level then
local vi = area:index(x_min, y, z) --current node index
for x = x_min, x_max do -- for each node do
if data[vi] == c_air then
data[vi] = c_water
end
vi = vi + 1
end
end
end
end
--send data back to voxelmanip
vm:set_data(data)
--calc lighting
vm:set_lighting({day = 0, night = 0})
vm:calc_lighting()
--write it to world
vm:write_to_map()
end)

View File

@ -69,15 +69,19 @@ setting("bool", "light_kills_fungus", true, "Light kills fungus")
setting("float", "vertical_cavern_scale", 256, "Vertical cavern dimension scale")
setting("float", "horizontal_cavern_scale", 256, "Horizontal cavern dimension scale")
setting("float", "cavern_threshold", 0.5, "Cavern threshold")
setting("int", "ymax", -300, "Upper limit of level 1")
setting("int", "level1_min", -900, "Upper limit of level 2")
setting("int", "level2_min", -1500, "Upper limit of level 3")
setting("int", "level3_min", -2100, "Upper limit of lava sea")
setting("int", "lava_sea_min", -2700, "Lower limit of the lava sea")
setting("int", "level3_min", -2100, "Upper limit of the sunless sea")
setting("int", "sunless_sea_min", -2500, "Lower limit of the sunless sea")
setting("float", "lava_sea_threshold", 0.2, "Cavern threshold for magma sea (higher number means sparser magma)")
setting("bool", "bottom_sea_contains_lava", true, "Lower sea contains lava")
setting("int", "lava_sea_max", -3000, "Upper limit of the lava sea")
setting("int", "lava_sea_min", -3500, "Lower limit of the lava sea")
setting("float", "lava_sea_threshold", 0.2, "Cavern threshold for sunless and magma seas (higher number means sparser magma)")
setting("bool", "enable_lava_sea", true, "Enable magma sea level")
if minetest.get_modpath("tnt") then
dfcaverns.config.enable_tnt = minetest.settings:get_bool("enable_tnt")
@ -86,3 +90,5 @@ if minetest.get_modpath("tnt") then
dfcaverns.config.enable_tnt = minetest.is_singleplayer()
end
end
dfcaverns.config.sunless_sea_level = dfcaverns.config.level3_min - (dfcaverns.config.level3_min - dfcaverns.config.sunless_sea_min) * 0.3

View File

@ -35,4 +35,5 @@ dofile(modpath.."/biomes.lua")
dofile(modpath.."/biomes/level1.lua")
dofile(modpath.."/biomes/level2.lua")
dofile(modpath.."/biomes/level3.lua")
dofile(modpath.."/biomes/sunless_sea.lua")
dofile(modpath.."/biomes/lava_sea.lua")

View File

@ -39,11 +39,13 @@ dfcaverns_cavern_threshold (Cavern threshold) float 0.5 0.0 1.0
dfcaverns_ymax (Upper limit of level 1) int -300
dfcaverns_level1_min (Upper limit of level 2) int -900
dfcaverns_level2_min (Upper limit of level 3) int -1500
dfcaverns_level3_min (Upper limit of lava sea) int -2100
dfcaverns_lava_sea_min (Lower limit of lava sea) int -2700
dfcaverns_level3_min (Upper limit of the sunless sea) int -2100
dfcaverns_sunless_sea_min (Lower limit of the sunless sea) int -2500
dfcaverns_lava_sea_max (Upper limit of the lava sea) int -3000
dfcaverns_lava_sea_min (Lower limit of the lava sea) int -3500
[Lower Sea]
[Lower Seas]
#Determines threshold for lower sea cave generation. Higher number means sparser cavern
dfcaverns_lava_sea_threshold (Cavern threshold for magma sea) float 0.2 0.0 1.0
#When true, the lower sea contains magma. When false, it's water instead.
dfcaverns_bottom_sea_contains_lava (Lower sea is lava) bool true
#When true, the lava sea level is generated
dfcaverns_enable_lava_sea (Lower sea is lava) bool true