mirror of
https://github.com/FaceDeer/dfcaverns.git
synced 2024-11-16 07:30:27 +01:00
add a config setting to greatly reduce flooded caves
This commit is contained in:
parent
e8ddd1e4b1
commit
bf2c15258f
|
@ -11,8 +11,6 @@ local c_cobble_fungus = minetest.get_content_id("dfcaverns:cobble_with_floor_fun
|
||||||
local c_wet_flowstone = minetest.get_content_id("dfcaverns:wet_flowstone")
|
local c_wet_flowstone = minetest.get_content_id("dfcaverns:wet_flowstone")
|
||||||
local c_dry_flowstone = minetest.get_content_id("dfcaverns:dry_flowstone")
|
local c_dry_flowstone = minetest.get_content_id("dfcaverns:dry_flowstone")
|
||||||
|
|
||||||
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_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_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_plump_helmet = minetest.get_content_id("dfcaverns:plump_helmet_4") -- param2 = 0-3
|
||||||
|
@ -22,6 +20,9 @@ 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_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.ymax - dfcaverns.config.level1_min) * 0.3 + dfcaverns.config.level1_min
|
||||||
|
local flooded_biomes = dfcaverns.config.flooded_biomes
|
||||||
|
|
||||||
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
|
||||||
|
@ -161,12 +162,18 @@ local level_1_underwater_floor = function(area, data, ai, vi, bi, param2_data)
|
||||||
else
|
else
|
||||||
data[bi] = c_dirt
|
data[bi] = c_dirt
|
||||||
end
|
end
|
||||||
|
if flooded_biomes then
|
||||||
if data[vi] == c_air then
|
if data[vi] == c_air then
|
||||||
data[vi] = c_water
|
data[vi] = c_water
|
||||||
end
|
end
|
||||||
if data[ai] == c_air then
|
if data[ai] == c_air then
|
||||||
data[ai] = c_water
|
data[ai] = c_water
|
||||||
end
|
end
|
||||||
|
elseif math.random() < 0.01 then
|
||||||
|
if data[vi] == c_air then
|
||||||
|
data[vi] = c_water
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -209,6 +216,12 @@ end
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
local c_flood_fill
|
||||||
|
if flooded_biomes then
|
||||||
|
c_flood_fill = c_water
|
||||||
|
else
|
||||||
|
c_flood_fill = c_air
|
||||||
|
end
|
||||||
|
|
||||||
minetest.register_biome({
|
minetest.register_biome({
|
||||||
name = "dfcaverns_level1_flooded_biome_lower",
|
name = "dfcaverns_level1_flooded_biome_lower",
|
||||||
|
@ -217,7 +230,7 @@ minetest.register_biome({
|
||||||
heat_point = 50,
|
heat_point = 50,
|
||||||
humidity_point = 100,
|
humidity_point = 100,
|
||||||
_subterrane_fill_node = c_air,
|
_subterrane_fill_node = c_air,
|
||||||
_subterrane_cave_fill_node = c_water,
|
_subterrane_cave_fill_node = c_flood_fill,
|
||||||
_subterrane_floor_decor = level_1_underwater_floor,
|
_subterrane_floor_decor = level_1_underwater_floor,
|
||||||
_subterrane_mitigate_lava = true,
|
_subterrane_mitigate_lava = true,
|
||||||
})
|
})
|
||||||
|
@ -231,7 +244,7 @@ minetest.register_biome({
|
||||||
_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,
|
||||||
_subterrane_cave_fill_node = c_water,
|
_subterrane_cave_fill_node = c_flood_fill,
|
||||||
_subterrane_mitigate_lava = true,
|
_subterrane_mitigate_lava = true,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -298,7 +311,7 @@ minetest.register_biome({
|
||||||
heat_point = 20,
|
heat_point = 20,
|
||||||
humidity_point = 80,
|
humidity_point = 80,
|
||||||
_subterrane_fill_node = c_air,
|
_subterrane_fill_node = c_air,
|
||||||
_subterrane_cave_fill_node = c_water,
|
_subterrane_cave_fill_node = c_flood_fill,
|
||||||
_subterrane_floor_decor = level_1_underwater_floor,
|
_subterrane_floor_decor = level_1_underwater_floor,
|
||||||
_subterrane_mitigate_lava = true,
|
_subterrane_mitigate_lava = true,
|
||||||
})
|
})
|
||||||
|
@ -325,7 +338,7 @@ minetest.register_biome({
|
||||||
heat_point = 80,
|
heat_point = 80,
|
||||||
humidity_point = 80,
|
humidity_point = 80,
|
||||||
_subterrane_fill_node = c_air,
|
_subterrane_fill_node = c_air,
|
||||||
_subterrane_cave_fill_node = c_water,
|
_subterrane_cave_fill_node = c_flood_fill,
|
||||||
_subterrane_floor_decor = level_1_underwater_floor,
|
_subterrane_floor_decor = level_1_underwater_floor,
|
||||||
_subterrane_mitigate_lava = true,
|
_subterrane_mitigate_lava = true,
|
||||||
})
|
})
|
||||||
|
|
|
@ -18,7 +18,6 @@ local c_cobble_fungus = minetest.get_content_id("dfcaverns:cobble_with_floor_fun
|
||||||
local c_wet_flowstone = minetest.get_content_id("dfcaverns:wet_flowstone")
|
local c_wet_flowstone = minetest.get_content_id("dfcaverns:wet_flowstone")
|
||||||
local c_dry_flowstone = minetest.get_content_id("dfcaverns:dry_flowstone")
|
local c_dry_flowstone = minetest.get_content_id("dfcaverns:dry_flowstone")
|
||||||
|
|
||||||
|
|
||||||
local c_sweet_pod = minetest.get_content_id("dfcaverns:sweet_pod_6") -- param2 = 0
|
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_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_plump_helmet = minetest.get_content_id("dfcaverns:plump_helmet_4") -- param2 = 0-3
|
||||||
|
@ -29,7 +28,7 @@ local c_dead_fungus = minetest.get_content_id("dfcaverns:dead_fungus") -- param2
|
||||||
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.level1_min - dfcaverns.config.level2_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 flooded_biomes = dfcaverns.config.flooded_biomes
|
||||||
|
|
||||||
local level_2_tower_cap_floor = function(area, data, ai, vi, bi, param2_data)
|
local level_2_tower_cap_floor = function(area, data, ai, vi, bi, param2_data)
|
||||||
if data[bi] ~= c_stone then
|
if data[bi] ~= c_stone then
|
||||||
|
@ -296,8 +295,19 @@ local level_2_underwater_floor = function(area, data, ai, vi, bi, param2_data)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
data[bi] = c_dirt
|
data[bi] = c_dirt
|
||||||
if data[vi] == c_air then data[vi] = c_water end
|
|
||||||
if data[ai] == c_air then data[ai] = c_water end
|
if flooded_biomes then
|
||||||
|
if data[vi] == c_air then
|
||||||
|
data[vi] = c_water
|
||||||
|
end
|
||||||
|
if data[ai] == c_air then
|
||||||
|
data[ai] = c_water
|
||||||
|
end
|
||||||
|
elseif math.random() < 0.01 then
|
||||||
|
if data[vi] == c_air then
|
||||||
|
data[vi] = c_water
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local level_2_cave_floor = function(area, data, ai, vi, bi, param2_data)
|
local level_2_cave_floor = function(area, data, ai, vi, bi, param2_data)
|
||||||
|
@ -339,6 +349,12 @@ end
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
local c_flood_fill
|
||||||
|
if flooded_biomes then
|
||||||
|
c_flood_fill = c_water
|
||||||
|
else
|
||||||
|
c_flood_fill = c_air
|
||||||
|
end
|
||||||
|
|
||||||
minetest.register_biome({
|
minetest.register_biome({
|
||||||
name = "dfcaverns_level2_flooded_biome_lower",
|
name = "dfcaverns_level2_flooded_biome_lower",
|
||||||
|
@ -347,7 +363,7 @@ minetest.register_biome({
|
||||||
heat_point = 50,
|
heat_point = 50,
|
||||||
humidity_point = 90,
|
humidity_point = 90,
|
||||||
_subterrane_fill_node = c_air,
|
_subterrane_fill_node = c_air,
|
||||||
_subterrane_cave_fill_node = c_water,
|
_subterrane_cave_fill_node = c_flood_fill,
|
||||||
_subterrane_floor_decor = level_2_underwater_floor,
|
_subterrane_floor_decor = level_2_underwater_floor,
|
||||||
_subterrane_mitigate_lava = false,
|
_subterrane_mitigate_lava = false,
|
||||||
})
|
})
|
||||||
|
@ -361,7 +377,7 @@ minetest.register_biome({
|
||||||
_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,
|
||||||
_subterrane_cave_fill_node = c_water,
|
_subterrane_cave_fill_node = c_flood_fill,
|
||||||
_subterrane_mitigate_lava = true,
|
_subterrane_mitigate_lava = true,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,7 @@ local c_dead_fungus = minetest.get_content_id("dfcaverns:dead_fungus") -- param2
|
||||||
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.level2_min - dfcaverns.config.level3_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 flooded_biomes = dfcaverns.config.flooded_biomes
|
||||||
|
|
||||||
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
|
||||||
|
@ -128,8 +129,19 @@ local level_3_underwater_floor = function(area, data, ai, vi, bi, param2_data)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
data[bi] = c_dirt
|
data[bi] = c_dirt
|
||||||
if data[vi] == c_air then data[vi] = c_water end
|
|
||||||
if data[ai] == c_air then data[ai] = c_water end
|
if flooded_biomes then
|
||||||
|
if data[vi] == c_air then
|
||||||
|
data[vi] = c_water
|
||||||
|
end
|
||||||
|
if data[ai] == c_air then
|
||||||
|
data[ai] = c_water
|
||||||
|
end
|
||||||
|
elseif math.random() < 0.01 then
|
||||||
|
if data[vi] == c_air then
|
||||||
|
data[vi] = c_water
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local level_3_dry_ceiling = function(area, data, ai, vi, bi, param2_data)
|
local level_3_dry_ceiling = function(area, data, ai, vi, bi, param2_data)
|
||||||
|
@ -373,6 +385,12 @@ end
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
local c_flood_fill
|
||||||
|
if flooded_biomes then
|
||||||
|
c_flood_fill = c_water
|
||||||
|
else
|
||||||
|
c_flood_fill = c_air
|
||||||
|
end
|
||||||
|
|
||||||
minetest.register_biome({
|
minetest.register_biome({
|
||||||
name = "dfcaverns_level3_flooded_biome_lower",
|
name = "dfcaverns_level3_flooded_biome_lower",
|
||||||
|
@ -394,7 +412,7 @@ minetest.register_biome({
|
||||||
_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,
|
||||||
_subterrane_cave_fill_node = c_water,
|
_subterrane_cave_fill_node = c_flood_fill,
|
||||||
_subterrane_mitigate_lava = true,
|
_subterrane_mitigate_lava = true,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -83,6 +83,8 @@ 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("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")
|
setting("bool", "enable_lava_sea", true, "Enable magma sea level")
|
||||||
|
|
||||||
|
setting("bool", "flooded_biomes", true, "Add a lot of water to the most humid cavern biomes")
|
||||||
|
|
||||||
if minetest.get_modpath("tnt") then
|
if minetest.get_modpath("tnt") then
|
||||||
dfcaverns.config.enable_tnt = minetest.settings:get_bool("enable_tnt")
|
dfcaverns.config.enable_tnt = minetest.settings:get_bool("enable_tnt")
|
||||||
if dfcaverns.config.enable_tnt == nil then
|
if dfcaverns.config.enable_tnt == nil then
|
||||||
|
|
|
@ -49,3 +49,6 @@ dfcaverns_lava_sea_min (Lower limit of the lava sea) int -3500
|
||||||
dfcaverns_lava_sea_threshold (Cavern threshold for magma sea) float 0.2 0.0 1.0
|
dfcaverns_lava_sea_threshold (Cavern threshold for magma sea) float 0.2 0.0 1.0
|
||||||
#When true, the lava sea level is generated
|
#When true, the lava sea level is generated
|
||||||
dfcaverns_enable_lava_sea (Lower sea is lava) bool true
|
dfcaverns_enable_lava_sea (Lower sea is lava) bool true
|
||||||
|
#When true cavern biomes at the most extreme humidity range will be flooded
|
||||||
|
#with water, providing significant challenges in those areas.
|
||||||
|
dfcaverns_flooded_biomes (Add a lot of water to the most humid cavern biomes) bool true
|
Binary file not shown.
Before Width: | Height: | Size: 329 B After Width: | Height: | Size: 691 B |
Loading…
Reference in New Issue
Block a user