use new tcave function

This commit is contained in:
FaceDeer 2017-03-21 01:02:46 -06:00
parent 33753d4a3b
commit 4d64614ded
7 changed files with 72 additions and 30 deletions

View File

@ -18,16 +18,6 @@ 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")
dfcaverns.config.ymax = subterrane.config.ymax
dfcaverns.config.level1_min = -600
dfcaverns.config.level2_min = -1000
dfcaverns.config.level3_min = -1400
dfcaverns.config.lava_sea_min = -1600
dfcaverns.config.ymin = subterrane.config.ymin
-- default mapgen registers an "underground" biome that gets in the way of everything.
subterrane:override_biome({
name = "underground",
@ -37,6 +27,30 @@ subterrane:override_biome({
humidity_point = 50,
})
subterrane:set_tcave_array({
{dfcaverns.config.ymax, 1.5},
{dfcaverns.config.ymax-100, 0.5},
{dfcaverns.config.level1_min+100, 0.5},
{dfcaverns.config.level1_min, 1.0},
{dfcaverns.config.level1_min-100, 0.5},
{dfcaverns.config.level2_min+100, 0.5},
{dfcaverns.config.level2_min, 1.0},
{dfcaverns.config.level2_min-100, 0.5},
{dfcaverns.config.level3_min+100, 0.5},
{dfcaverns.config.level3_min, 1.0},
{dfcaverns.config.level3_min-100, 0.5},
{dfcaverns.config.lava_sea_min+100, 0.5},
{dfcaverns.config.lava_sea_min, 1.0},
{dfcaverns.config.lava_sea_min-100, 0.5},
{dfcaverns.config.ymin+100, 0.5},
{dfcaverns.config.ymin, 1.5},
})
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)

View File

@ -12,7 +12,6 @@ local c_cavern_fungi = minetest.get_content_id("dfcaverns:cavern_fungi") -- para
local subsea_level = (dfcaverns.config.level1_min - dfcaverns.config.ymax) * 0.3 + dfcaverns.config.level1_min
local level_1_tower_cap_floor = function(area, data, ai, vi, bi, param2_data)
subterrane:obsidian_floor_dam(area, data, ai, vi, bi)
if data[bi] ~= c_stone then
return
end
@ -37,7 +36,6 @@ local level_1_tower_cap_floor = function(area, data, ai, vi, bi, param2_data)
end
local level_1_moist_ceiling = function(area, data, ai, vi, bi, param2_data)
subterrane:obsidian_ceiling_plug(area, data, ai, vi, bi)
if data[ai] ~= c_stone then
return
end
@ -124,7 +122,6 @@ end
local level_1_fungiwood_floor = function(area, data, ai, vi, bi, param2_data)
subterrane:obsidian_floor_dam(area, data, ai, vi, bi)
if data[bi] ~= c_stone then
return
end
@ -204,6 +201,7 @@ minetest.register_biome({
_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({
@ -216,9 +214,9 @@ minetest.register_biome({
_subterrane_floor_decor = level_1_wet_floor,
_subterrane_fill_node = c_air,
_subterrane_cave_fill_node = c_water,
_subterrane_mitigate_lava = true,
})
minetest.register_biome({
name = "dfcaverns_level1_tower_cap_biome_lower",
y_min = dfcaverns.config.level1_min,
@ -230,6 +228,7 @@ minetest.register_biome({
_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({
@ -243,6 +242,7 @@ minetest.register_biome({
_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({
@ -256,6 +256,7 @@ minetest.register_biome({
_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({
@ -269,6 +270,7 @@ minetest.register_biome({
_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({
@ -280,6 +282,7 @@ minetest.register_biome({
_subterrane_ceiling_decor = level_1_dry_ceiling,
_subterrane_floor_decor = level_1_dry_floor,
_subterrane_fill_node = c_air,
_subterrane_mitigate_lava = false, -- let the lava spill in, nothing to protect
})
minetest.register_biome({
@ -291,4 +294,5 @@ minetest.register_biome({
_subterrane_ceiling_decor = level_1_dry_ceiling,
_subterrane_floor_decor = level_1_dry_floor,
_subterrane_fill_node = c_air,
_subterrane_mitigate_lava = false, -- let the lava spill in, nothing to protect
})

View File

@ -19,7 +19,6 @@ local subsea_level = (dfcaverns.config.level2_min - dfcaverns.config.level1_min)
local level_2_tower_cap_floor = function(area, data, ai, vi, bi, param2_data)
subterrane:obsidian_floor_dam(area, data, ai, vi, bi)
if data[bi] ~= c_stone then
return
end
@ -44,7 +43,6 @@ local level_2_tower_cap_floor = function(area, data, ai, vi, bi, param2_data)
end
local level_2_moist_ceiling = function(area, data, ai, vi, bi, param2_data)
subterrane:obsidian_ceiling_plug(area, data, ai, vi, bi)
if data[ai] ~= c_stone then
return
end
@ -131,7 +129,6 @@ end
local level_2_fungiwood_floor = function(area, data, ai, vi, bi, param2_data)
subterrane:obsidian_floor_dam(area, data, ai, vi, bi)
if data[bi] ~= c_stone then
return
end
@ -157,7 +154,6 @@ local level_2_fungiwood_floor = function(area, data, ai, vi, bi, param2_data)
end
local level_2_tunnel_tube_floor = function(area, data, ai, vi, bi, param2_data)
subterrane:obsidian_floor_dam(area, data, ai, vi, bi)
if data[bi] ~= c_stone then
return
end
@ -183,7 +179,6 @@ local level_2_tunnel_tube_floor = function(area, data, ai, vi, bi, param2_data)
end
local level_2_spore_tree_floor = function(area, data, ai, vi, bi, param2_data)
subterrane:obsidian_floor_dam(area, data, ai, vi, bi)
if data[bi] ~= c_stone then
return
end
@ -209,7 +204,6 @@ local level_2_spore_tree_floor = function(area, data, ai, vi, bi, param2_data)
end
local level_2_goblin_cap_floor = function(area, data, ai, vi, bi, param2_data)
subterrane:obsidian_floor_dam(area, data, ai, vi, bi)
if data[bi] ~= c_stone then
return
end
@ -288,6 +282,7 @@ minetest.register_biome({
_subterrane_fill_node = c_water,
_subterrane_cave_fill_node = c_water,
_subterrane_floor_decor = level_2_underwater_floor,
_subterrane_mitigate_lava = false,
})
minetest.register_biome({
@ -300,6 +295,7 @@ minetest.register_biome({
_subterrane_floor_decor = level_2_wet_floor,
_subterrane_fill_node = c_air,
_subterrane_cave_fill_node = c_water,
_subterrane_mitigate_lava = true,
})
@ -314,6 +310,7 @@ minetest.register_biome({
_subterrane_fill_node = c_air,
_subterrane_cave_floor_decor = level_2_cave_floor,
_subterrane_cave_ceiling_decor = level_2_cave_ceiling,
_subterrane_mitigate_lava = true,
})
minetest.register_biome({
@ -327,6 +324,7 @@ minetest.register_biome({
_subterrane_fill_node = c_air,
_subterrane_cave_floor_decor = level_2_cave_floor,
_subterrane_cave_ceiling_decor = level_2_cave_ceiling,
_subterrane_mitigate_lava = true,
})
minetest.register_biome({
@ -340,6 +338,7 @@ minetest.register_biome({
_subterrane_fill_node = c_air,
_subterrane_cave_floor_decor = level_2_cave_floor,
_subterrane_cave_ceiling_decor = level_2_cave_ceiling,
_subterrane_mitigate_lava = true,
})
minetest.register_biome({
@ -353,6 +352,7 @@ minetest.register_biome({
_subterrane_fill_node = c_air,
_subterrane_cave_floor_decor = level_2_cave_floor,
_subterrane_cave_ceiling_decor = level_2_cave_ceiling,
_subterrane_mitigate_lava = true,
})
minetest.register_biome({
@ -366,6 +366,7 @@ minetest.register_biome({
_subterrane_fill_node = c_air,
_subterrane_cave_floor_decor = level_2_cave_floor,
_subterrane_cave_ceiling_decor = level_2_cave_ceiling,
_subterrane_mitigate_lava = true,
})
minetest.register_biome({
@ -379,6 +380,7 @@ minetest.register_biome({
_subterrane_fill_node = c_air,
_subterrane_cave_floor_decor = level_2_cave_floor,
_subterrane_cave_ceiling_decor = level_2_cave_ceiling,
_subterrane_mitigate_lava = true,
})
@ -393,6 +395,7 @@ minetest.register_biome({
_subterrane_fill_node = c_air,
_subterrane_cave_floor_decor = level_2_cave_floor,
_subterrane_cave_ceiling_decor = level_2_cave_ceiling,
_subterrane_mitigate_lava = true,
})
minetest.register_biome({
@ -406,10 +409,9 @@ minetest.register_biome({
_subterrane_fill_node = c_air,
_subterrane_cave_floor_decor = level_2_cave_floor,
_subterrane_cave_ceiling_decor = level_2_cave_ceiling,
_subterrane_mitigate_lava = true,
})
minetest.register_biome({
name = "dfcaverns_level2_tunnel_tube_biome_lower",
y_min = dfcaverns.config.level2_min,
@ -421,6 +423,7 @@ minetest.register_biome({
_subterrane_fill_node = c_air,
_subterrane_cave_floor_decor = level_2_cave_floor,
_subterrane_cave_ceiling_decor = level_2_cave_ceiling,
_subterrane_mitigate_lava = true,
})
minetest.register_biome({
@ -434,9 +437,9 @@ minetest.register_biome({
_subterrane_fill_node = c_air,
_subterrane_cave_floor_decor = level_2_cave_floor,
_subterrane_cave_ceiling_decor = level_2_cave_ceiling,
_subterrane_mitigate_lava = true,
})
minetest.register_biome({
name = "dfcaverns_level2_dry_biome_lower",
y_min = dfcaverns.config.level2_min,
@ -446,6 +449,7 @@ minetest.register_biome({
_subterrane_ceiling_decor = level_2_dry_ceiling,
_subterrane_floor_decor = level_2_dry_floor,
_subterrane_fill_node = c_air,
_subterrane_mitigate_lava = false,
})
minetest.register_biome({
@ -457,4 +461,5 @@ minetest.register_biome({
_subterrane_ceiling_decor = level_2_dry_ceiling,
_subterrane_floor_decor = level_2_dry_floor,
_subterrane_fill_node = c_air,
_subterrane_mitigate_lava = false,
})

View File

@ -44,7 +44,6 @@ local level_3_blood_thorn_floor = function(area, data, ai, vi, bi, param2_data)
end
local level_3_moist_ceiling = function(area, data, ai, vi, bi, param2_data)
subterrane:obsidian_ceiling_plug(area, data, ai, vi, bi)
if data[ai] ~= c_stone then
return
end
@ -297,6 +296,7 @@ minetest.register_biome({
_subterrane_floor_decor = level_3_wet_floor,
_subterrane_fill_node = c_air,
_subterrane_cave_fill_node = c_water,
_subterrane_mitigate_lava = true,
})
@ -311,6 +311,7 @@ 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_mitigate_lava = true,
})
minetest.register_biome({
@ -324,6 +325,7 @@ 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_mitigate_lava = true,
})
minetest.register_biome({
@ -337,6 +339,7 @@ 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_mitigate_lava = true,
})
minetest.register_biome({
@ -350,6 +353,7 @@ 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_mitigate_lava = true,
})
minetest.register_biome({
@ -363,6 +367,7 @@ 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_mitigate_lava = true,
})
minetest.register_biome({
@ -376,9 +381,9 @@ 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_mitigate_lava = true,
})
minetest.register_biome({
name = "dfcaverns_level3_spore_tree_biome_lower",
y_min = dfcaverns.config.level3_min,
@ -390,6 +395,7 @@ 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_mitigate_lava = true,
})
minetest.register_biome({
@ -403,6 +409,7 @@ 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_mitigate_lava = true,
})
minetest.register_biome({
@ -416,6 +423,7 @@ 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_mitigate_lava = true,
})
minetest.register_biome({
@ -429,6 +437,7 @@ 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_mitigate_lava = true,
})
@ -441,6 +450,7 @@ minetest.register_biome({
_subterrane_ceiling_decor = level_3_dry_ceiling,
_subterrane_floor_decor = level_3_dry_floor,
_subterrane_fill_node = c_air,
_subterrane_mitigate_lava = false,
})
minetest.register_biome({
@ -452,4 +462,5 @@ minetest.register_biome({
_subterrane_ceiling_decor = level_3_dry_ceiling,
_subterrane_floor_decor = level_3_dry_floor,
_subterrane_fill_node = c_air,
_subterrane_mitigate_lava = false,
})

View File

@ -63,4 +63,12 @@ for _, plant in pairs(plants) do
setting("float", plant.name.."_timer_multiplier", plant.delay_multiplier, plant.name.." growth delay multiplier")
end
setting("bool", "light_kills_fungus", true, "Light kills fungus")
setting("bool", "light_kills_fungus", true, "Light kills fungus")
setting("int", "ymax", -300, "Upper limit of level 1")
setting("int", "level1_min", -600, "Upper limit of level 2")
setting("int", "level2_min", -1000, "Upper limit of level 3")
setting("int", "level3_min", -1400, "Upper limit of lava sea")
setting("int", "lava_sea_min", -1600, "Upper limit of underworld")
setting("int", "ymin", -2000, "Lower limit of underworld")

View File

@ -1,3 +1,4 @@
default
subterrane
farming
farming
harderstone?

View File

@ -59,9 +59,8 @@ minetest.register_ore({
"default:dirt_with_grass",
"default:dirt_with_dry_grass",
"default:dirt_with_snow",
"default:cobble",
"default:mossycobble",
},
"harderstone:weak_stone",
},
column_height_min = 2,
column_height_max = 6,
height_min = -31000,