biome refinements

This commit is contained in:
FaceDeer 2017-03-25 02:49:47 -06:00
parent 88bf842222
commit a95074f5b4
5 changed files with 380 additions and 273 deletions

View File

@ -61,55 +61,52 @@ subterrane:register_cave_decor(-113, dfcaverns.config.ymax)
subterrane:register_cave_layer({ subterrane:register_cave_layer({
minimum_depth = dfcaverns.config.ymax, minimum_depth = dfcaverns.config.ymax,
maximum_depth = dfcaverns.config.level1_min, maximum_depth = dfcaverns.config.level1_min,
cave_threshold = 0.3,
}) })
subterrane:register_cave_layer({ subterrane:register_cave_layer({
minimum_depth = dfcaverns.config.level1_min, minimum_depth = dfcaverns.config.level1_min,
maximum_depth = dfcaverns.config.level2_min, maximum_depth = dfcaverns.config.level2_min,
cave_threshold = 0.3,
}) })
subterrane:register_cave_layer({ subterrane:register_cave_layer({
minimum_depth = dfcaverns.config.level2_min, minimum_depth = dfcaverns.config.level2_min,
maximum_depth = dfcaverns.config.level3_min, maximum_depth = dfcaverns.config.level3_min,
cave_threshold = 0.3,
}) })
subterrane:register_cave_layer({ subterrane:register_cave_layer({
minimum_depth = dfcaverns.config.level3_min, minimum_depth = dfcaverns.config.level3_min,
maximum_depth = dfcaverns.config.lava_sea_min, maximum_depth = dfcaverns.config.lava_sea_min,
cave_threshold = 0.3,
}) })
subterrane:register_cave_layer({ subterrane:register_cave_layer({
minimum_depth = dfcaverns.config.lava_sea_min, minimum_depth = dfcaverns.config.lava_sea_min,
maximum_depth = dfcaverns.config.ymin, maximum_depth = dfcaverns.config.ymin,
cave_threshold = 0.3,
}) })
dfcaverns.can_support_vegetation = {[c_sand] = true, [c_dirt] = true, [c_coal_ore] = true, [c_gravel] = true} 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) dfcaverns.place_shrub = function(data, vi, param2_data, shrub_list)
local shrub = math.random(1,8) local shrub = shrub_list[math.random(#shrub_list)]
if shrub == 1 then
data[vi] = c_sweet_pod if shrub == c_quarry_bush then
param2_data[vi] = 0
elseif shrub == 2 then
data[vi] = c_quarry_bush data[vi] = c_quarry_bush
param2_data[vi] = 4 param2_data[vi] = 4
elseif shrub == 3 then elseif shrub == c_plump_helmet then
data[vi] = c_plump_helmet data[vi] = c_plump_helmet
param2_data[vi] = math.random(0,3) param2_data[vi] = math.random(0,3)
elseif shrub == 4 then elseif shrub == c_pig_tail then
data[vi] = c_pig_tail data[vi] = c_pig_tail
param2_data[vi] = 3 param2_data[vi] = 3
elseif shrub == 5 then elseif shrub == c_cave_wheat then
data[vi] = c_dimple_cup
param2_data[vi] = 0
elseif shrub == 6 then
data[vi] = c_cave_wheat data[vi] = c_cave_wheat
param2_data[vi] = 3 param2_data[vi] = 3
elseif shrub == 7 then else
data[vi] = c_dead_fungus data[vi] = shrub
param2_data[vi] = 0
elseif shrub == 8 then
data[vi] = c_cavern_fungi
param2_data[vi] = 0 param2_data[vi] = 0
end end
end end

View File

@ -2,18 +2,26 @@ local c_water = minetest.get_content_id("default:water_source")
local c_air = minetest.get_content_id("air") local c_air = minetest.get_content_id("air")
local c_stone = minetest.get_content_id("default:stone") local c_stone = minetest.get_content_id("default:stone")
local c_cobble = minetest.get_content_id("default:cobble") local c_cobble = minetest.get_content_id("default:cobble")
local c_mossycobble = minetest.get_content_id("default:mossycobble")
local c_dirt = minetest.get_content_id("default:dirt") local c_dirt = minetest.get_content_id("default:dirt")
local c_dirt_moss = minetest.get_content_id("dfcaverns:dirt_with_cave_moss") 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_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 c_wet_flowstone = minetest.get_content_id("subterrane:wet_flowstone") local c_wet_flowstone = minetest.get_content_id("subterrane:wet_flowstone")
local c_dry_flowstone = minetest.get_content_id("subterrane:dry_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.level1_min - dfcaverns.config.ymax) * 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
local c_plump_helmet = minetest.get_content_id("dfcaverns:plump_helmet_4") -- param2 = 0-3
local c_pig_tail = minetest.get_content_id("dfcaverns:pig_tail_8") -- param2 = 3
local c_dimple_cup = minetest.get_content_id("dfcaverns:dimple_cup_4") -- param2 = 0
local c_cave_wheat = minetest.get_content_id("dfcaverns:cave_wheat_8") -- param2 = 3
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 level_1_tower_cap_floor = function(area, data, ai, vi, bi, param2_data) local level_1_tower_cap_floor = function(area, data, ai, vi, bi, param2_data)
if data[bi] ~= c_stone then if data[bi] ~= c_stone then
return return
@ -27,7 +35,7 @@ local level_1_tower_cap_floor = function(area, data, ai, vi, bi, param2_data)
local drip_rand = subterrane:vertically_consistent_random(vi, area) local drip_rand = subterrane:vertically_consistent_random(vi, area)
if math.random() < 0.1 then if math.random() < 0.1 then
dfcaverns.place_shrub(data, vi, param2_data) dfcaverns.place_shrub(data, vi, param2_data, {c_plump_helmet, c_plump_helmet, c_pig_tail, c_dead_fungus, c_cavern_fungi})
elseif drip_rand < 0.0025 then elseif drip_rand < 0.0025 then
elseif drip_rand < 0.1 then elseif drip_rand < 0.1 then
@ -39,6 +47,32 @@ local level_1_tower_cap_floor = function(area, data, ai, vi, bi, param2_data)
end end
end end
local level_1_fungiwood_floor = function(area, data, ai, vi, bi, param2_data)
if data[bi] ~= c_stone then
return
end
if math.random() < 0.25 then
data[bi] = c_dirt
else
data[bi] = c_dirt_moss
end
local drip_rand = subterrane:vertically_consistent_random(vi, area)
if math.random() < 0.1 then
dfcaverns.place_shrub(data, vi, param2_data, {c_plump_helmet, c_pig_tail, c_cave_wheat, c_cave_wheat, c_dead_fungus, c_cavern_fungi})
elseif drip_rand < 0.001 then
subterrane:giant_stalagmite(bi, area, data, 6, 15, c_wet_flowstone, c_wet_flowstone, c_wet_flowstone)
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)
elseif math.random() < 0.005 then
dfcaverns.spawn_fungiwood_vm(vi, area, data)
end
end
local level_1_moist_ceiling = function(area, data, ai, vi, bi, param2_data) local level_1_moist_ceiling = function(area, data, ai, vi, bi, param2_data)
if data[ai] ~= c_stone then if data[ai] ~= c_stone then
return return
@ -55,6 +89,31 @@ local level_1_moist_ceiling = function(area, data, ai, vi, bi, param2_data)
end end
end end
local level_1_wet_floor = function(area, data, ai, vi, bi, param2_data)
if data[bi] ~= c_stone then
return
end
if math.random() < 0.25 then
data[bi] = c_mossycobble
if math.random() < 0.1 then
data[vi] = c_dead_fungus
elseif math.random() < 0.1 then
data[vi] = c_cavern_fungi
end
end
local drip_rand = subterrane:vertically_consistent_random(vi, area)
if drip_rand < 0.001 then
subterrane:giant_stalagmite(bi, area, data, 6, 15, c_wet_flowstone, c_wet_flowstone, c_wet_flowstone)
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)
end
end
local level_1_dry_floor = function(area, data, ai, vi, bi, param2_data) local level_1_dry_floor = function(area, data, ai, vi, bi, param2_data)
if data[bi] ~= c_stone then if data[bi] ~= c_stone then
return return
@ -79,40 +138,6 @@ local level_1_dry_floor = function(area, data, ai, vi, bi, param2_data)
end end
end end
local level_1_wet_floor = function(area, data, ai, vi, bi, param2_data)
if data[bi] ~= c_stone then
return
end
if math.random() < 0.25 then
data[bi] = c_dirt_moss
if math.random() < 0.1 then
data[vi] = c_dead_fungus
elseif math.random() < 0.1 then
data[vi] = c_cavern_fungi
end
else
data[bi] = c_dirt
end
local drip_rand = subterrane:vertically_consistent_random(vi, area)
if drip_rand < 0.001 then
subterrane:giant_stalagmite(bi, area, data, 6, 15, c_wet_flowstone, c_wet_flowstone, c_wet_flowstone)
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)
end
end
local level_1_underwater_floor = function(area, data, ai, vi, bi, param2_data)
if data[bi] ~= c_stone then
return
end
data[bi] = c_dirt
end
local level_1_dry_ceiling = function(area, data, ai, vi, bi, param2_data) local level_1_dry_ceiling = function(area, data, ai, vi, bi, param2_data)
if data[ai] ~= c_stone then if data[ai] ~= c_stone then
return return
@ -127,47 +152,26 @@ local level_1_dry_ceiling = function(area, data, ai, vi, bi, param2_data)
end end
end end
local level_1_underwater_floor = function(area, data, ai, vi, bi, param2_data)
local level_1_fungiwood_floor = function(area, data, ai, vi, bi, param2_data)
if data[bi] ~= c_stone then if data[bi] ~= c_stone then
return return
end end
if math.random() < 0.25 then if math.random() < 0.25 then
data[bi] = c_dirt data[bi] = c_mossycobble
else else
data[bi] = c_dirt_moss data[bi] = c_dirt
end
local drip_rand = subterrane:vertically_consistent_random(vi, area)
if math.random() < 0.1 then
dfcaverns.place_shrub(data, vi, param2_data)
elseif drip_rand < 0.001 then
subterrane:giant_stalagmite(bi, area, data, 6, 15, c_wet_flowstone, c_wet_flowstone, c_wet_flowstone)
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)
elseif math.random() < 0.005 then
dfcaverns.spawn_fungiwood_vm(vi, area, data)
end end
end end
local level_1_cave_floor = function(area, data, ai, vi, bi, param2_data) local level_1_cave_floor = function(area, data, ai, vi, bi, param2_data)
if dfcaverns.can_support_vegetation[data[bi]] then if dfcaverns.can_support_vegetation[data[bi]] then
data[bi] = c_dirt_moss
if math.random() < 0.25 then
if data[vi] == c_air then
dfcaverns.place_shrub(data, vi, param2_data)
end
end
return
end
if data[bi] == c_cobble and math.random() < 0.001 then
data[bi] = c_cobble_fungus data[bi] = c_cobble_fungus
if math.random() < 0.15 then
if data[vi] == c_air then
dfcaverns.place_shrub(data, vi, param2_data, {c_plump_helmet, c_dead_fungus, c_dead_fungus, c_dead_fungus, c_cavern_fungi})
end
end
return return
end end
@ -204,8 +208,8 @@ minetest.register_biome({
name = "dfcaverns_level1_flooded_biome_lower", name = "dfcaverns_level1_flooded_biome_lower",
y_min = dfcaverns.config.level1_min, y_min = dfcaverns.config.level1_min,
y_max = subsea_level, y_max = subsea_level,
heat_point = -20, heat_point = 50,
humidity_point = 0, humidity_point = 100,
_subterrane_fill_node = c_water, _subterrane_fill_node = c_water,
_subterrane_cave_fill_node = c_water, _subterrane_cave_fill_node = c_water,
_subterrane_floor_decor = level_1_underwater_floor, _subterrane_floor_decor = level_1_underwater_floor,
@ -216,8 +220,8 @@ minetest.register_biome({
name = "dfcaverns_level1_flooded_biome_upper", name = "dfcaverns_level1_flooded_biome_upper",
y_min = subsea_level, y_min = subsea_level,
y_max = dfcaverns.config.ymax, y_max = dfcaverns.config.ymax,
heat_point = -20, heat_point = 50,
humidity_point = 0, humidity_point = 100,
_subterrane_ceiling_decor = level_1_moist_ceiling, _subterrane_ceiling_decor = level_1_moist_ceiling,
_subterrane_floor_decor = level_1_wet_floor, _subterrane_floor_decor = level_1_wet_floor,
_subterrane_fill_node = c_air, _subterrane_fill_node = c_air,
@ -229,8 +233,8 @@ minetest.register_biome({
name = "dfcaverns_level1_tower_cap_biome_lower", name = "dfcaverns_level1_tower_cap_biome_lower",
y_min = dfcaverns.config.level1_min, y_min = dfcaverns.config.level1_min,
y_max = subsea_level, y_max = subsea_level,
heat_point = 80, heat_point = 30,
humidity_point = 20, humidity_point = 40,
_subterrane_ceiling_decor = level_1_moist_ceiling, _subterrane_ceiling_decor = level_1_moist_ceiling,
_subterrane_floor_decor = level_1_tower_cap_floor, _subterrane_floor_decor = level_1_tower_cap_floor,
_subterrane_fill_node = c_air, _subterrane_fill_node = c_air,
@ -243,8 +247,8 @@ minetest.register_biome({
name = "dfcaverns_level1_tower_cap_biome_upper", name = "dfcaverns_level1_tower_cap_biome_upper",
y_min = subsea_level, y_min = subsea_level,
y_max = dfcaverns.config.ymax, y_max = dfcaverns.config.ymax,
heat_point = 80, heat_point = 30,
humidity_point = 20, humidity_point = 40,
_subterrane_ceiling_decor = level_1_moist_ceiling, _subterrane_ceiling_decor = level_1_moist_ceiling,
_subterrane_floor_decor = level_1_tower_cap_floor, _subterrane_floor_decor = level_1_tower_cap_floor,
_subterrane_fill_node = c_air, _subterrane_fill_node = c_air,
@ -257,8 +261,8 @@ minetest.register_biome({
name = "dfcaverns_level1_fungiwood_biome_lower", name = "dfcaverns_level1_fungiwood_biome_lower",
y_min = dfcaverns.config.level1_min, y_min = dfcaverns.config.level1_min,
y_max = subsea_level, y_max = subsea_level,
heat_point = 60, heat_point = 70,
humidity_point = 100, humidity_point = 40,
_subterrane_ceiling_decor = level_1_moist_ceiling, _subterrane_ceiling_decor = level_1_moist_ceiling,
_subterrane_floor_decor = level_1_fungiwood_floor, _subterrane_floor_decor = level_1_fungiwood_floor,
_subterrane_fill_node = c_air, _subterrane_fill_node = c_air,
@ -269,10 +273,63 @@ minetest.register_biome({
minetest.register_biome({ minetest.register_biome({
name = "dfcaverns_level1_fungiwood_biome_upper", name = "dfcaverns_level1_fungiwood_biome_upper",
y_min = dfcaverns.config.level1_min,
y_max = subsea_level,
heat_point = 70,
humidity_point = 40,
_subterrane_ceiling_decor = level_1_moist_ceiling,
_subterrane_floor_decor = level_1_fungiwood_floor,
_subterrane_fill_node = c_air,
_subterrane_cave_floor_decor = level_1_cave_floor,
_subterrane_cave_ceiling_decor = level_1_cave_ceiling,
_subterrane_mitigate_lava = true,
})
minetest.register_biome({
name = "dfcaverns_level1_tower_cap_flooded_biome_lower",
y_min = subsea_level, y_min = subsea_level,
y_max = dfcaverns.config.ymax, y_max = dfcaverns.config.ymax,
heat_point = 60, heat_point = 20,
humidity_point = 100, humidity_point = 80,
_subterrane_fill_node = c_water,
_subterrane_cave_fill_node = c_water,
_subterrane_floor_decor = level_1_underwater_floor,
_subterrane_mitigate_lava = false, -- no need to mitigate lava in a flooded cave, problem is self-solving
})
minetest.register_biome({
name = "dfcaverns_level1_tower_cap_flooded_biome_upper",
y_min = subsea_level,
y_max = dfcaverns.config.ymax,
heat_point = 20,
humidity_point = 80,
_subterrane_ceiling_decor = level_1_moist_ceiling,
_subterrane_floor_decor = level_1_tower_cap_floor,
_subterrane_fill_node = c_air,
_subterrane_cave_floor_decor = level_1_cave_floor,
_subterrane_cave_ceiling_decor = level_1_cave_ceiling,
_subterrane_mitigate_lava = true,
})
minetest.register_biome({
name = "dfcaverns_level1_fungiwood_flooded_biome_lower",
y_min = dfcaverns.config.level1_min,
y_max = subsea_level,
heat_point = 80,
humidity_point = 80,
_subterrane_fill_node = c_water,
_subterrane_cave_fill_node = c_water,
_subterrane_floor_decor = level_1_underwater_floor,
_subterrane_mitigate_lava = false, -- no need to mitigate lava in a flooded cave, problem is self-solving
})
minetest.register_biome({
name = "dfcaverns_level1_fungiwood_flooded_biome_upper",
y_min = subsea_level,
y_max = dfcaverns.config.ymax,
heat_point = 80,
humidity_point = 80,
_subterrane_ceiling_decor = level_1_moist_ceiling, _subterrane_ceiling_decor = level_1_moist_ceiling,
_subterrane_floor_decor = level_1_fungiwood_floor, _subterrane_floor_decor = level_1_fungiwood_floor,
_subterrane_fill_node = c_air, _subterrane_fill_node = c_air,
@ -285,8 +342,8 @@ minetest.register_biome({
name = "dfcaverns_level1_dry_biome_lower", name = "dfcaverns_level1_dry_biome_lower",
y_min = dfcaverns.config.level1_min, y_min = dfcaverns.config.level1_min,
y_max = subsea_level, y_max = subsea_level,
heat_point = 20, heat_point = 50,
humidity_point = 140, humidity_point = 0,
_subterrane_ceiling_decor = level_1_dry_ceiling, _subterrane_ceiling_decor = level_1_dry_ceiling,
_subterrane_floor_decor = level_1_dry_floor, _subterrane_floor_decor = level_1_dry_floor,
_subterrane_fill_node = c_air, _subterrane_fill_node = c_air,
@ -297,8 +354,8 @@ minetest.register_biome({
name = "dfcaverns_level1_dry_biome_upper", name = "dfcaverns_level1_dry_biome_upper",
y_min = subsea_level, y_min = subsea_level,
y_max = dfcaverns.config.ymax, y_max = dfcaverns.config.ymax,
heat_point = 20, heat_point = 50,
humidity_point = 140, humidity_point = 0,
_subterrane_ceiling_decor = level_1_dry_ceiling, _subterrane_ceiling_decor = level_1_dry_ceiling,
_subterrane_floor_decor = level_1_dry_floor, _subterrane_floor_decor = level_1_dry_floor,
_subterrane_fill_node = c_air, _subterrane_fill_node = c_air,

View File

@ -8,10 +8,22 @@ local c_water = minetest.get_content_id("default:water_source")
local c_air = minetest.get_content_id("air") local c_air = minetest.get_content_id("air")
local c_stone = minetest.get_content_id("default:stone") local c_stone = minetest.get_content_id("default:stone")
local c_cobble = minetest.get_content_id("default:cobble") local c_cobble = minetest.get_content_id("default:cobble")
local c_mossycobble = minetest.get_content_id("default:mossycobble")
local c_dirt = minetest.get_content_id("default:dirt") local c_dirt = minetest.get_content_id("default:dirt")
local c_dirt_moss = minetest.get_content_id("dfcaverns:dirt_with_cave_moss") 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_cobble_fungus = minetest.get_content_id("dfcaverns:cobble_with_floor_fungus")
local c_wet_flowstone = minetest.get_content_id("subterrane:wet_flowstone")
local c_dry_flowstone = minetest.get_content_id("subterrane:dry_flowstone")
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
local c_plump_helmet = minetest.get_content_id("dfcaverns:plump_helmet_4") -- param2 = 0-3
local c_pig_tail = minetest.get_content_id("dfcaverns:pig_tail_8") -- param2 = 3
local c_dimple_cup = minetest.get_content_id("dfcaverns:dimple_cup_4") -- param2 = 0
local c_cave_wheat = minetest.get_content_id("dfcaverns:cave_wheat_8") -- param2 = 3
local c_dead_fungus = minetest.get_content_id("dfcaverns:dead_fungus") -- param2 = 0 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 c_cavern_fungi = minetest.get_content_id("dfcaverns:cavern_fungi") -- param2 = 0
@ -31,7 +43,9 @@ local level_2_tower_cap_floor = function(area, data, ai, vi, bi, param2_data)
local drip_rand = subterrane:vertically_consistent_random(vi, area) local drip_rand = subterrane:vertically_consistent_random(vi, area)
if math.random() < 0.1 then if math.random() < 0.1 then
dfcaverns.place_shrub(data, vi, param2_data) dfcaverns.place_shrub(data, vi, param2_data, {c_plump_helmet, c_plump_helmet, c_pig_tail, c_dead_fungus, c_cavern_fungi})
elseif drip_rand < 0.0025 then
elseif drip_rand < 0.1 then elseif drip_rand < 0.1 then
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4 local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
local height = math.floor(drip_rand/0.1 * 5) local height = math.floor(drip_rand/0.1 * 5)
@ -41,88 +55,6 @@ local level_2_tower_cap_floor = function(area, data, ai, vi, bi, param2_data)
end end
end end
local level_2_moist_ceiling = function(area, data, ai, vi, bi, param2_data)
if data[ai] ~= c_stone then
return
end
local drip_rand = subterrane:vertically_consistent_random(vi, area)
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, true)
elseif math.random() < 0.03 then
dfcaverns.glow_worm_ceiling(area, data, ai, vi, bi)
end
end
local level_2_dry_floor = function(area, data, ai, vi, bi, param2_data)
if data[bi] ~= c_stone then
return
end
if math.random() < 0.25 then
data[bi] = c_cobble_fungus
if math.random() < 0.1 then
data[vi] = c_dead_fungus
end
elseif math.random() < 0.5 then
data[bi] = c_cobble
end
local drip_rand = subterrane:vertically_consistent_random(vi, area)
if 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)
end
end
local level_2_wet_floor = function(area, data, ai, vi, bi, param2_data)
if data[bi] ~= c_stone then
return
end
if math.random() < 0.25 then
data[bi] = c_dirt_moss
if math.random() < 0.1 then
data[vi] = c_dead_fungus
elseif math.random() < 0.1 then
data[vi] = c_cavern_fungi
end
else
data[bi] = c_dirt
end
local drip_rand = subterrane:vertically_consistent_random(vi, area)
if 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)
end
end
local level_2_underwater_floor = function(area, data, ai, vi, bi, param2_data)
if data[bi] ~= c_stone then
return
end
data[bi] = c_dirt
end
local level_2_dry_ceiling = function(area, data, ai, vi, bi, param2_data)
if data[ai] ~= c_stone then
return
end
local drip_rand = subterrane:vertically_consistent_random(vi, area)
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)
end
end
local level_2_fungiwood_floor = function(area, data, ai, vi, bi, param2_data) local level_2_fungiwood_floor = function(area, data, ai, vi, bi, param2_data)
if data[bi] ~= c_stone then if data[bi] ~= c_stone then
return return
@ -137,7 +69,7 @@ local level_2_fungiwood_floor = function(area, data, ai, vi, bi, param2_data)
local drip_rand = subterrane:vertically_consistent_random(vi, area) local drip_rand = subterrane:vertically_consistent_random(vi, area)
if math.random() < 0.1 then if math.random() < 0.1 then
dfcaverns.place_shrub(data, vi, param2_data) dfcaverns.place_shrub(data, vi, param2_data, {c_plump_helmet, c_pig_tail, c_cave_wheat, c_cave_wheat, c_dead_fungus, c_cavern_fungi})
elseif drip_rand < 0.1 then elseif drip_rand < 0.1 then
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4 local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
local height = math.floor(drip_rand/0.1 * 5) local height = math.floor(drip_rand/0.1 * 5)
@ -161,7 +93,7 @@ local level_2_tunnel_tube_floor = function(area, data, ai, vi, bi, param2_data)
local drip_rand = subterrane:vertically_consistent_random(vi, area) local drip_rand = subterrane:vertically_consistent_random(vi, area)
if math.random() < 0.1 then if math.random() < 0.1 then
dfcaverns.place_shrub(data, vi, param2_data) dfcaverns.place_shrub(data, vi, param2_data, {c_pig_tail, c_pig_tail, c_cave_wheat, c_cave_wheat, c_dead_fungus, c_cavern_fungi})
elseif drip_rand < 0.1 then elseif drip_rand < 0.1 then
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4 local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
local height = math.floor(drip_rand/0.1 * 5) local height = math.floor(drip_rand/0.1 * 5)
@ -185,7 +117,9 @@ local level_2_spore_tree_floor = function(area, data, ai, vi, bi, param2_data)
local drip_rand = subterrane:vertically_consistent_random(vi, area) local drip_rand = subterrane:vertically_consistent_random(vi, area)
if math.random() < 0.1 then if math.random() < 0.1 then
dfcaverns.place_shrub(data, vi, param2_data) dfcaverns.place_shrub(data, vi, param2_data, {c_pig_tail, c_dimple_cup, c_dimple_cup, c_cave_wheat, c_dead_fungus, c_cavern_fungi})
elseif drip_rand < 0.001 then
subterrane:giant_stalagmite(bi, area, data, 6, 15, c_wet_flowstone, c_wet_flowstone, c_wet_flowstone)
elseif drip_rand < 0.1 then elseif drip_rand < 0.1 then
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4 local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
local height = math.floor(drip_rand/0.1 * 5) local height = math.floor(drip_rand/0.1 * 5)
@ -209,7 +143,9 @@ local level_2_goblin_cap_floor = function(area, data, ai, vi, bi, param2_data)
local drip_rand = subterrane:vertically_consistent_random(vi, area) local drip_rand = subterrane:vertically_consistent_random(vi, area)
if math.random() < 0.1 then if math.random() < 0.1 then
dfcaverns.place_shrub(data, vi, param2_data) dfcaverns.place_shrub(data, vi, param2_data, {c_plump_helmet, c_plump_helmet, c_dimple_cup, c_pig_tail, c_dead_fungus, c_cavern_fungi})
elseif drip_rand < 0.001 then
subterrane:giant_stalagmite(bi, area, data, 6, 15, c_wet_flowstone, c_wet_flowstone, c_wet_flowstone)
elseif drip_rand < 0.1 then elseif drip_rand < 0.1 then
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4 local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
local height = math.floor(drip_rand/0.1 * 5) local height = math.floor(drip_rand/0.1 * 5)
@ -219,19 +155,97 @@ local level_2_goblin_cap_floor = function(area, data, ai, vi, bi, param2_data)
end end
end end
local level_2_cave_floor = function(area, data, ai, vi, bi, param2_data)
if dfcaverns.can_support_vegetation[data[bi]] then local level_2_moist_ceiling = function(area, data, ai, vi, bi, param2_data)
data[bi] = c_dirt_moss if data[ai] ~= c_stone then
if math.random() < 0.25 then return
if data[vi] == c_air then
dfcaverns.place_shrub(data, vi, param2_data)
end end
local drip_rand = subterrane:vertically_consistent_random(vi, area)
if drip_rand < 0.002 then
subterrane:giant_stalactite(ai, area, data, 6, 15, c_wet_flowstone, c_wet_flowstone, c_wet_flowstone)
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)
elseif math.random() < 0.025 then
dfcaverns.glow_worm_ceiling(area, data, ai, vi, bi)
end end
end
local level_2_wet_floor = function(area, data, ai, vi, bi, param2_data)
if data[bi] ~= c_stone then
return return
end end
if data[bi] == c_cobble and math.random() < 0.001 then if math.random() < 0.25 then
data[bi] = c_mossycobble
if math.random() < 0.1 then
data[vi] = c_dead_fungus
elseif math.random() < 0.1 then
data[vi] = c_cavern_fungi
end
end
local drip_rand = subterrane:vertically_consistent_random(vi, area)
if 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)
end
end
local level_2_dry_floor = function(area, data, ai, vi, bi, param2_data)
if data[bi] ~= c_stone then
return
end
if math.random() < 0.25 then
data[bi] = c_cobble_fungus data[bi] = c_cobble_fungus
if math.random() < 0.1 then
data[vi] = c_dead_fungus
end
elseif math.random() < 0.5 then
data[bi] = c_cobble
end
local drip_rand = subterrane:vertically_consistent_random(vi, area)
if drip_rand < 0.001 then
subterrane:giant_stalagmite(bi, area, data, 6, 15, c_dry_flowstone, c_dry_flowstone, c_dry_flowstone)
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)
end
end
local level_2_dry_ceiling = function(area, data, ai, vi, bi, param2_data)
if data[ai] ~= c_stone then
return
end
local drip_rand = subterrane:vertically_consistent_random(vi, area)
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)
end
end
local level_2_underwater_floor = function(area, data, ai, vi, bi, param2_data)
if data[bi] ~= c_stone then
return
end
data[bi] = c_dirt
end
local level_2_cave_floor = function(area, data, ai, vi, bi, param2_data)
if dfcaverns.can_support_vegetation[data[bi]] then
data[bi] = c_cobble_fungus
if math.random() < 0.25 then
if data[vi] == c_air then
dfcaverns.place_shrub(data, vi, param2_data, {c_plump_helmet, c_pig_tail, c_dead_fungus, c_dead_fungus, c_cavern_fungi})
end
end
return return
end end
@ -268,8 +282,8 @@ minetest.register_biome({
name = "dfcaverns_level2_flooded_biome_lower", name = "dfcaverns_level2_flooded_biome_lower",
y_min = dfcaverns.config.level2_min, y_min = dfcaverns.config.level2_min,
y_max = subsea_level, y_max = subsea_level,
heat_point = 20, heat_point = 50,
humidity_point = 0, humidity_point = 90,
_subterrane_fill_node = c_water, _subterrane_fill_node = c_water,
_subterrane_cave_fill_node = c_water, _subterrane_cave_fill_node = c_water,
_subterrane_floor_decor = level_2_underwater_floor, _subterrane_floor_decor = level_2_underwater_floor,
@ -280,8 +294,8 @@ minetest.register_biome({
name = "dfcaverns_level2_flooded_biome_upper", name = "dfcaverns_level2_flooded_biome_upper",
y_min = subsea_level, y_min = subsea_level,
y_max = dfcaverns.config.level1_min, y_max = dfcaverns.config.level1_min,
heat_point = 20, heat_point = 50,
humidity_point = 0, humidity_point = 90,
_subterrane_ceiling_decor = level_2_moist_ceiling, _subterrane_ceiling_decor = level_2_moist_ceiling,
_subterrane_floor_decor = level_2_wet_floor, _subterrane_floor_decor = level_2_wet_floor,
_subterrane_fill_node = c_air, _subterrane_fill_node = c_air,
@ -294,8 +308,8 @@ minetest.register_biome({
name = "dfcaverns_level2_tower_cap_biome_lower", name = "dfcaverns_level2_tower_cap_biome_lower",
y_min = dfcaverns.config.level2_min, y_min = dfcaverns.config.level2_min,
y_max = subsea_level, y_max = subsea_level,
heat_point = 40, heat_point = 0,
humidity_point = 10, humidity_point = 40,
_subterrane_ceiling_decor = level_2_moist_ceiling, _subterrane_ceiling_decor = level_2_moist_ceiling,
_subterrane_floor_decor = level_2_tower_cap_floor, _subterrane_floor_decor = level_2_tower_cap_floor,
_subterrane_fill_node = c_air, _subterrane_fill_node = c_air,
@ -308,8 +322,8 @@ minetest.register_biome({
name = "dfcaverns_level2_tower_cap_biome_upper", name = "dfcaverns_level2_tower_cap_biome_upper",
y_min = subsea_level, y_min = subsea_level,
y_max = dfcaverns.config.level1_min, y_max = dfcaverns.config.level1_min,
heat_point = 40, heat_point = 0,
humidity_point = 10, humidity_point = 40,
_subterrane_ceiling_decor = level_2_moist_ceiling, _subterrane_ceiling_decor = level_2_moist_ceiling,
_subterrane_floor_decor = level_2_tower_cap_floor, _subterrane_floor_decor = level_2_tower_cap_floor,
_subterrane_fill_node = c_air, _subterrane_fill_node = c_air,
@ -322,8 +336,8 @@ minetest.register_biome({
name = "dfcaverns_level2_fungiwood_biome_lower", name = "dfcaverns_level2_fungiwood_biome_lower",
y_min = dfcaverns.config.level2_min, y_min = dfcaverns.config.level2_min,
y_max = subsea_level, y_max = subsea_level,
heat_point = 80, heat_point = 100,
humidity_point = 50, humidity_point = 60,
_subterrane_ceiling_decor = level_2_moist_ceiling, _subterrane_ceiling_decor = level_2_moist_ceiling,
_subterrane_floor_decor = level_2_fungiwood_floor, _subterrane_floor_decor = level_2_fungiwood_floor,
_subterrane_fill_node = c_air, _subterrane_fill_node = c_air,
@ -336,8 +350,8 @@ minetest.register_biome({
name = "dfcaverns_level2_fungiwood_biome_upper", name = "dfcaverns_level2_fungiwood_biome_upper",
y_min = subsea_level, y_min = subsea_level,
y_max = dfcaverns.config.level1_min, y_max = dfcaverns.config.level1_min,
heat_point = 80, heat_point = 100,
humidity_point = 50, humidity_point = 60,
_subterrane_ceiling_decor = level_2_moist_ceiling, _subterrane_ceiling_decor = level_2_moist_ceiling,
_subterrane_floor_decor = level_2_fungiwood_floor, _subterrane_floor_decor = level_2_fungiwood_floor,
_subterrane_fill_node = c_air, _subterrane_fill_node = c_air,
@ -350,8 +364,8 @@ minetest.register_biome({
name = "dfcaverns_level2_goblin_cap_biome_lower", name = "dfcaverns_level2_goblin_cap_biome_lower",
y_min = dfcaverns.config.level2_min, y_min = dfcaverns.config.level2_min,
y_max = subsea_level, y_max = subsea_level,
heat_point = 60, heat_point = 20,
humidity_point = 20, humidity_point = 60,
_subterrane_ceiling_decor = level_2_moist_ceiling, _subterrane_ceiling_decor = level_2_moist_ceiling,
_subterrane_floor_decor = level_2_goblin_cap_floor, _subterrane_floor_decor = level_2_goblin_cap_floor,
_subterrane_fill_node = c_air, _subterrane_fill_node = c_air,
@ -364,8 +378,8 @@ minetest.register_biome({
name = "dfcaverns_level2_goblin_cap_biome_upper", name = "dfcaverns_level2_goblin_cap_biome_upper",
y_min = subsea_level, y_min = subsea_level,
y_max = dfcaverns.config.level1_min, y_max = dfcaverns.config.level1_min,
heat_point = 60, heat_point = 20,
humidity_point = 20, humidity_point = 60,
_subterrane_ceiling_decor = level_2_moist_ceiling, _subterrane_ceiling_decor = level_2_moist_ceiling,
_subterrane_floor_decor = level_2_goblin_cap_floor, _subterrane_floor_decor = level_2_goblin_cap_floor,
_subterrane_fill_node = c_air, _subterrane_fill_node = c_air,
@ -380,7 +394,7 @@ minetest.register_biome({
y_min = dfcaverns.config.level2_min, y_min = dfcaverns.config.level2_min,
y_max = subsea_level, y_max = subsea_level,
heat_point = 60, heat_point = 60,
humidity_point = 80, humidity_point = 60,
_subterrane_ceiling_decor = level_2_moist_ceiling, _subterrane_ceiling_decor = level_2_moist_ceiling,
_subterrane_floor_decor = level_2_spore_tree_floor, _subterrane_floor_decor = level_2_spore_tree_floor,
_subterrane_fill_node = c_air, _subterrane_fill_node = c_air,
@ -394,7 +408,7 @@ minetest.register_biome({
y_min = subsea_level, y_min = subsea_level,
y_max = dfcaverns.config.level1_min, y_max = dfcaverns.config.level1_min,
heat_point = 60, heat_point = 60,
humidity_point = 80, humidity_point = 60,
_subterrane_ceiling_decor = level_2_moist_ceiling, _subterrane_ceiling_decor = level_2_moist_ceiling,
_subterrane_floor_decor = level_2_spore_tree_floor, _subterrane_floor_decor = level_2_spore_tree_floor,
_subterrane_fill_node = c_air, _subterrane_fill_node = c_air,
@ -407,8 +421,8 @@ minetest.register_biome({
name = "dfcaverns_level2_tunnel_tube_biome_lower", name = "dfcaverns_level2_tunnel_tube_biome_lower",
y_min = dfcaverns.config.level2_min, y_min = dfcaverns.config.level2_min,
y_max = subsea_level, y_max = subsea_level,
heat_point = 40, heat_point = 80,
humidity_point = 100, humidity_point = 40,
_subterrane_ceiling_decor = level_2_moist_ceiling, _subterrane_ceiling_decor = level_2_moist_ceiling,
_subterrane_floor_decor = level_2_tunnel_tube_floor, _subterrane_floor_decor = level_2_tunnel_tube_floor,
_subterrane_fill_node = c_air, _subterrane_fill_node = c_air,
@ -421,8 +435,8 @@ minetest.register_biome({
name = "dfcaverns_level2_tunnel_tube_biome_upper", name = "dfcaverns_level2_tunnel_tube_biome_upper",
y_min = subsea_level, y_min = subsea_level,
y_max = dfcaverns.config.level1_min, y_max = dfcaverns.config.level1_min,
heat_point = 40, heat_point = 80,
humidity_point = 100, humidity_point = 40,
_subterrane_ceiling_decor = level_2_moist_ceiling, _subterrane_ceiling_decor = level_2_moist_ceiling,
_subterrane_floor_decor = level_2_tunnel_tube_floor, _subterrane_floor_decor = level_2_tunnel_tube_floor,
_subterrane_fill_node = c_air, _subterrane_fill_node = c_air,
@ -435,8 +449,8 @@ minetest.register_biome({
name = "dfcaverns_level2_dry_biome_lower", name = "dfcaverns_level2_dry_biome_lower",
y_min = dfcaverns.config.level2_min, y_min = dfcaverns.config.level2_min,
y_max = subsea_level, y_max = subsea_level,
heat_point = 20, heat_point = 50,
humidity_point = 110, humidity_point = 0,
_subterrane_ceiling_decor = level_2_dry_ceiling, _subterrane_ceiling_decor = level_2_dry_ceiling,
_subterrane_floor_decor = level_2_dry_floor, _subterrane_floor_decor = level_2_dry_floor,
_subterrane_fill_node = c_air, _subterrane_fill_node = c_air,
@ -447,8 +461,8 @@ minetest.register_biome({
name = "dfcaverns_level2_dry_biome_upper", name = "dfcaverns_level2_dry_biome_upper",
y_min = subsea_level, y_min = subsea_level,
y_max = dfcaverns.config.level1_min, y_max = dfcaverns.config.level1_min,
heat_point = 20, heat_point = 50,
humidity_point = 110, humidity_point = 0,
_subterrane_ceiling_decor = level_2_dry_ceiling, _subterrane_ceiling_decor = level_2_dry_ceiling,
_subterrane_floor_decor = level_2_dry_floor, _subterrane_floor_decor = level_2_dry_floor,
_subterrane_fill_node = c_air, _subterrane_fill_node = c_air,

View File

@ -18,40 +18,29 @@ local c_ice = minetest.get_content_id("default:ice")
local c_dirt_moss = minetest.get_content_id("dfcaverns:dirt_with_cave_moss") 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_cobble_fungus = minetest.get_content_id("dfcaverns:cobble_with_floor_fungus")
local c_wet_flowstone = minetest.get_content_id("subterrane:wet_flowstone")
local c_dry_flowstone = minetest.get_content_id("subterrane:dry_flowstone")
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
local c_plump_helmet = minetest.get_content_id("dfcaverns:plump_helmet_4") -- param2 = 0-3
local c_pig_tail = minetest.get_content_id("dfcaverns:pig_tail_8") -- param2 = 3
local c_dimple_cup = minetest.get_content_id("dfcaverns:dimple_cup_4") -- param2 = 0
local c_cave_wheat = minetest.get_content_id("dfcaverns:cave_wheat_8") -- param2 = 3
local c_dead_fungus = minetest.get_content_id("dfcaverns:dead_fungus") -- param2 = 0 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 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.level3_min - dfcaverns.config.level2_min) * 0.3 + dfcaverns.config.level3_min
local level_3_blood_thorn_floor = function(area, data, ai, vi, bi, param2_data)
if data[bi] ~= c_stone then
return
end
if math.random() < 0.1 then
data[bi] = c_dirt_moss
else
data[bi] = c_sand
end
local drip_rand = subterrane:vertically_consistent_random(vi, area)
if math.random() < 0.1 then
dfcaverns.place_shrub(data, vi, 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)
elseif math.random() < 0.05 then
dfcaverns.spawn_blood_thorn_vm(vi, area, data, param2_data)
end
end
local level_3_moist_ceiling = function(area, data, ai, vi, bi, param2_data) local level_3_moist_ceiling = function(area, data, ai, vi, bi, param2_data)
if data[ai] ~= c_stone then if data[ai] ~= c_stone then
return return
end end
local drip_rand = subterrane:vertically_consistent_random(vi, area) local drip_rand = subterrane:vertically_consistent_random(vi, area)
if drip_rand < 0.075 then if drip_rand < 0.0025 then
subterrane:giant_stalactite(ai, area, data, 6, 15, c_wet_flowstone, c_wet_flowstone, c_wet_flowstone)
elseif drip_rand < 0.075 then
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4 local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
local height = math.floor(drip_rand/0.075 * 5) 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, true)
@ -75,7 +64,9 @@ local level_3_dry_floor = function(area, data, ai, vi, bi, param2_data)
end end
local drip_rand = subterrane:vertically_consistent_random(vi, area) local drip_rand = subterrane:vertically_consistent_random(vi, area)
if drip_rand < 0.05 then if drip_rand < 0.001 then
subterrane:giant_stalagmite(bi, area, data, 6, 20, c_dry_flowstone, c_dry_flowstone, c_dry_flowstone)
elseif drip_rand < 0.05 then
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4 local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
local height = math.floor(drip_rand/0.05 * 5) 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, false)
@ -127,6 +118,28 @@ local level_3_dry_ceiling = function(area, data, ai, vi, bi, param2_data)
end end
end end
local level_3_blood_thorn_floor = function(area, data, ai, vi, bi, param2_data)
if data[bi] ~= c_stone then
return
end
if math.random() < 0.1 then
data[bi] = c_dirt_moss
else
data[bi] = c_sand
end
local drip_rand = subterrane:vertically_consistent_random(vi, area)
if math.random() < 0.1 then
dfcaverns.place_shrub(data, vi, param2_data, {c_sweet_pod, c_sweet_pod, c_plump_helmet, c_dead_fungus, c_dead_fungus, c_dead_fungus, c_cavern_fungi})
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)
elseif math.random() < 0.05 then
dfcaverns.spawn_blood_thorn_vm(vi, area, data, param2_data)
end
end
local level_3_nether_cap_floor = function(area, data, ai, vi, bi, param2_data) local level_3_nether_cap_floor = function(area, data, ai, vi, bi, param2_data)
if data[bi] ~= c_stone then if data[bi] ~= c_stone then
@ -146,7 +159,7 @@ local level_3_nether_cap_floor = function(area, data, ai, vi, bi, param2_data)
local drip_rand = subterrane:vertically_consistent_random(vi, area) local drip_rand = subterrane:vertically_consistent_random(vi, area)
if math.random() < 0.01 and data[bi] ~= c_ice then if math.random() < 0.01 and data[bi] ~= c_ice then
dfcaverns.place_shrub(data, vi, param2_data) dfcaverns.place_shrub(data, vi, param2_data, {c_dimple_cup, c_plump_helmet, c_dead_fungus, c_dead_fungus, c_dead_fungus, c_cavern_fungi})
elseif drip_rand < 0.1 then elseif drip_rand < 0.1 then
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4 local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
local height = math.floor(drip_rand/0.1 * 5) local height = math.floor(drip_rand/0.1 * 5)
@ -172,7 +185,7 @@ local level_3_tunnel_tube_floor = function(area, data, ai, vi, bi, param2_data)
local drip_rand = subterrane:vertically_consistent_random(vi, area) local drip_rand = subterrane:vertically_consistent_random(vi, area)
if math.random() < 0.1 then if math.random() < 0.1 then
dfcaverns.place_shrub(data, vi, param2_data) dfcaverns.place_shrub(data, vi, param2_data, {c_pig_tail, c_quarry_bush, c_quarry_bush, c_cave_wheat, c_dead_fungus, c_cavern_fungi})
elseif drip_rand < 0.1 then elseif drip_rand < 0.1 then
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4 local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
local height = math.floor(drip_rand/0.1 * 5) local height = math.floor(drip_rand/0.1 * 5)
@ -196,7 +209,9 @@ local level_3_spore_tree_floor = function(area, data, ai, vi, bi, param2_data)
local drip_rand = subterrane:vertically_consistent_random(vi, area) local drip_rand = subterrane:vertically_consistent_random(vi, area)
if math.random() < 0.1 then if math.random() < 0.1 then
dfcaverns.place_shrub(data, vi, param2_data) dfcaverns.place_shrub(data, vi, param2_data, {c_pig_tail, c_quarry_bush, c_quarry_bush, c_dimple_cup, c_dead_fungus, c_cavern_fungi})
elseif drip_rand < 0.001 then
subterrane:giant_stalagmite(bi, area, data, 6, 15, c_wet_flowstone, c_wet_flowstone, c_wet_flowstone)
elseif drip_rand < 0.1 then elseif drip_rand < 0.1 then
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4 local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
local height = math.floor(drip_rand/0.1 * 5) local height = math.floor(drip_rand/0.1 * 5)
@ -220,7 +235,7 @@ local level_3_goblin_cap_floor = function(area, data, ai, vi, bi, param2_data)
local drip_rand = subterrane:vertically_consistent_random(vi, area) local drip_rand = subterrane:vertically_consistent_random(vi, area)
if math.random() < 0.1 then if math.random() < 0.1 then
dfcaverns.place_shrub(data, vi, param2_data) dfcaverns.place_shrub(data, vi, param2_data, {c_plump_helmet, c_sweet_pod, c_sweet_pod, c_quarry_bush, c_dead_fungus, c_cavern_fungi})
elseif drip_rand < 0.1 then elseif drip_rand < 0.1 then
local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4 local param2 = drip_rand*1000000 - math.floor(drip_rand*1000000/4)*4
local height = math.floor(drip_rand/0.1 * 5) local height = math.floor(drip_rand/0.1 * 5)
@ -235,7 +250,7 @@ local level_3_cave_floor = function(area, data, ai, vi, bi, param2_data)
data[bi] = c_dirt_moss data[bi] = c_dirt_moss
if math.random() < 0.25 then if math.random() < 0.25 then
if data[vi] == c_air then if data[vi] == c_air then
dfcaverns.place_shrub(data, vi, param2_data) dfcaverns.place_shrub(data, vi, param2_data, {c_plump_helmet, c_quarry_bush, c_dead_fungus, c_dead_fungus, c_cavern_fungi})
end end
end end
return return
@ -279,8 +294,8 @@ minetest.register_biome({
name = "dfcaverns_level3_flooded_biome_lower", name = "dfcaverns_level3_flooded_biome_lower",
y_min = dfcaverns.config.level3_min, y_min = dfcaverns.config.level3_min,
y_max = subsea_level, y_max = subsea_level,
heat_point = 20, heat_point = 50,
humidity_point = 0, humidity_point = 90,
_subterrane_fill_node = c_water, _subterrane_fill_node = c_water,
_subterrane_cave_fill_node = c_water, _subterrane_cave_fill_node = c_water,
_subterrane_floor_decor = level_3_underwater_floor, _subterrane_floor_decor = level_3_underwater_floor,
@ -290,8 +305,8 @@ minetest.register_biome({
name = "dfcaverns_level3_flooded_biome_upper", name = "dfcaverns_level3_flooded_biome_upper",
y_min = subsea_level, y_min = subsea_level,
y_max = dfcaverns.config.level2_min, y_max = dfcaverns.config.level2_min,
heat_point = 20, heat_point = 50,
humidity_point = 0, humidity_point = 90,
_subterrane_ceiling_decor = level_3_moist_ceiling, _subterrane_ceiling_decor = level_3_moist_ceiling,
_subterrane_floor_decor = level_3_wet_floor, _subterrane_floor_decor = level_3_wet_floor,
_subterrane_fill_node = c_air, _subterrane_fill_node = c_air,
@ -304,8 +319,8 @@ minetest.register_biome({
name = "dfcaverns_level3_blood_thorn_biome_lower", name = "dfcaverns_level3_blood_thorn_biome_lower",
y_min = dfcaverns.config.level3_min, y_min = dfcaverns.config.level3_min,
y_max = subsea_level, y_max = subsea_level,
heat_point = 40, heat_point = 20,
humidity_point = 100, humidity_point = 40,
_subterrane_ceiling_decor = level_3_dry_ceiling, _subterrane_ceiling_decor = level_3_dry_ceiling,
_subterrane_floor_decor = level_3_blood_thorn_floor, _subterrane_floor_decor = level_3_blood_thorn_floor,
_subterrane_fill_node = c_air, _subterrane_fill_node = c_air,
@ -318,8 +333,8 @@ minetest.register_biome({
name = "dfcaverns_level3_blood_thorn_biome_upper", name = "dfcaverns_level3_blood_thorn_biome_upper",
y_min = subsea_level, y_min = subsea_level,
y_max = dfcaverns.config.level2_min, y_max = dfcaverns.config.level2_min,
heat_point = 40, heat_point = 20,
humidity_point = 100, humidity_point = 40,
_subterrane_ceiling_decor = level_3_dry_ceiling, _subterrane_ceiling_decor = level_3_dry_ceiling,
_subterrane_floor_decor = level_3_blood_thorn_floor, _subterrane_floor_decor = level_3_blood_thorn_floor,
_subterrane_fill_node = c_air, _subterrane_fill_node = c_air,
@ -332,7 +347,7 @@ minetest.register_biome({
name = "dfcaverns_level3_nether_cap_biome_lower", name = "dfcaverns_level3_nether_cap_biome_lower",
y_min = dfcaverns.config.level3_min, y_min = dfcaverns.config.level3_min,
y_max = subsea_level, y_max = subsea_level,
heat_point = 80, heat_point = 90,
humidity_point = 50, humidity_point = 50,
_subterrane_ceiling_decor = level_3_dry_ceiling, _subterrane_ceiling_decor = level_3_dry_ceiling,
_subterrane_floor_decor = level_3_nether_cap_floor, _subterrane_floor_decor = level_3_nether_cap_floor,
@ -346,7 +361,7 @@ minetest.register_biome({
name = "dfcaverns_level3_nether_cap_biome_upper", name = "dfcaverns_level3_nether_cap_biome_upper",
y_min = subsea_level, y_min = subsea_level,
y_max = dfcaverns.config.level2_min, y_max = dfcaverns.config.level2_min,
heat_point = 80, heat_point = 90,
humidity_point = 50, humidity_point = 50,
_subterrane_ceiling_decor = level_3_dry_ceiling, _subterrane_ceiling_decor = level_3_dry_ceiling,
_subterrane_floor_decor = level_3_nether_cap_floor, _subterrane_floor_decor = level_3_nether_cap_floor,
@ -360,8 +375,8 @@ minetest.register_biome({
name = "dfcaverns_level3_goblin_cap_biome_lower", name = "dfcaverns_level3_goblin_cap_biome_lower",
y_min = dfcaverns.config.level3_min, y_min = dfcaverns.config.level3_min,
y_max = subsea_level, y_max = subsea_level,
heat_point = 60, heat_point = 20,
humidity_point = 20, humidity_point = 60,
_subterrane_ceiling_decor = level_3_moist_ceiling, _subterrane_ceiling_decor = level_3_moist_ceiling,
_subterrane_floor_decor = level_3_goblin_cap_floor, _subterrane_floor_decor = level_3_goblin_cap_floor,
_subterrane_fill_node = c_air, _subterrane_fill_node = c_air,
@ -374,8 +389,8 @@ minetest.register_biome({
name = "dfcaverns_level3_goblin_cap_biome_upper", name = "dfcaverns_level3_goblin_cap_biome_upper",
y_min = subsea_level, y_min = subsea_level,
y_max = dfcaverns.config.level2_min, y_max = dfcaverns.config.level2_min,
heat_point = 60, heat_point = 20,
humidity_point = 20, humidity_point = 60,
_subterrane_ceiling_decor = level_3_moist_ceiling, _subterrane_ceiling_decor = level_3_moist_ceiling,
_subterrane_floor_decor = level_3_goblin_cap_floor, _subterrane_floor_decor = level_3_goblin_cap_floor,
_subterrane_fill_node = c_air, _subterrane_fill_node = c_air,
@ -389,7 +404,7 @@ minetest.register_biome({
y_min = dfcaverns.config.level3_min, y_min = dfcaverns.config.level3_min,
y_max = subsea_level, y_max = subsea_level,
heat_point = 60, heat_point = 60,
humidity_point = 80, humidity_point = 60,
_subterrane_ceiling_decor = level_3_moist_ceiling, _subterrane_ceiling_decor = level_3_moist_ceiling,
_subterrane_floor_decor = level_3_spore_tree_floor, _subterrane_floor_decor = level_3_spore_tree_floor,
_subterrane_fill_node = c_air, _subterrane_fill_node = c_air,
@ -403,7 +418,7 @@ minetest.register_biome({
y_min = subsea_level, y_min = subsea_level,
y_max = dfcaverns.config.level2_min, y_max = dfcaverns.config.level2_min,
heat_point = 60, heat_point = 60,
humidity_point = 80, humidity_point = 60,
_subterrane_ceiling_decor = level_3_moist_ceiling, _subterrane_ceiling_decor = level_3_moist_ceiling,
_subterrane_floor_decor = level_3_spore_tree_floor, _subterrane_floor_decor = level_3_spore_tree_floor,
_subterrane_fill_node = c_air, _subterrane_fill_node = c_air,
@ -415,8 +430,8 @@ minetest.register_biome({
minetest.register_biome({ minetest.register_biome({
name = "dfcaverns_level3_tunnel_tube_biome_lower", name = "dfcaverns_level3_tunnel_tube_biome_lower",
y_min = dfcaverns.config.level3_min, y_min = dfcaverns.config.level3_min,
heat_point = 40, heat_point = 60,
humidity_point = 10, humidity_point = 40,
y_max = subsea_level, y_max = subsea_level,
_subterrane_ceiling_decor = level_3_moist_ceiling, _subterrane_ceiling_decor = level_3_moist_ceiling,
_subterrane_floor_decor = level_3_tunnel_tube_floor, _subterrane_floor_decor = level_3_tunnel_tube_floor,
@ -430,8 +445,8 @@ minetest.register_biome({
name = "dfcaverns_level3_tunnel_tube_biome_upper", name = "dfcaverns_level3_tunnel_tube_biome_upper",
y_min = subsea_level, y_min = subsea_level,
y_max = dfcaverns.config.level2_min, y_max = dfcaverns.config.level2_min,
heat_point = 40, heat_point = 60,
humidity_point = 10, humidity_point = 40,
_subterrane_ceiling_decor = level_3_moist_ceiling, _subterrane_ceiling_decor = level_3_moist_ceiling,
_subterrane_floor_decor = level_3_tunnel_tube_floor, _subterrane_floor_decor = level_3_tunnel_tube_floor,
_subterrane_fill_node = c_air, _subterrane_fill_node = c_air,
@ -445,8 +460,8 @@ minetest.register_biome({
name = "dfcaverns_level3_dry_biome_lower", name = "dfcaverns_level3_dry_biome_lower",
y_min = dfcaverns.config.level3_min, y_min = dfcaverns.config.level3_min,
y_max = subsea_level, y_max = subsea_level,
heat_point = 20, heat_point = 50,
humidity_point = 110, humidity_point = 0,
_subterrane_ceiling_decor = level_3_dry_ceiling, _subterrane_ceiling_decor = level_3_dry_ceiling,
_subterrane_floor_decor = level_3_dry_floor, _subterrane_floor_decor = level_3_dry_floor,
_subterrane_fill_node = c_air, _subterrane_fill_node = c_air,
@ -457,8 +472,8 @@ minetest.register_biome({
name = "dfcaverns_level3_dry_biome_upper", name = "dfcaverns_level3_dry_biome_upper",
y_min = subsea_level, y_min = subsea_level,
y_max = dfcaverns.config.level2_min, y_max = dfcaverns.config.level2_min,
heat_point = 20, heat_point = 50,
humidity_point = 110, humidity_point = 0,
_subterrane_ceiling_decor = level_3_dry_ceiling, _subterrane_ceiling_decor = level_3_dry_ceiling,
_subterrane_floor_decor = level_3_dry_floor, _subterrane_floor_decor = level_3_dry_floor,
_subterrane_fill_node = c_air, _subterrane_fill_node = c_air,

View File

@ -0,0 +1,24 @@
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_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
-------------------------------------------------------------------------------------------
minetest.register_biome({
name = "dfcaverns_underworld",
y_min = dfcaverns.config.ymin,
y_max = dfcaverns.config.lava_sea_min,
heat_point = 50,
humidity_point = 50,
})