Add more dungeon-like fortresses.

This commit is contained in:
Duane 2016-08-01 03:54:05 -05:00
parent 138858c2a2
commit 5abe211fb6
5 changed files with 288 additions and 188 deletions

View file

@ -7,18 +7,7 @@ fun_caves.cave_noise_2 = {offset = 0, scale = 1, seed = -8402, spread = {x = 40,
local cave_noise_3 = {offset = 15, scale = 10, seed = 3721, spread = {x = 40, y = 40, z = 40}, octaves = 3, persist = 1, lacunarity = 2}
local ground_nodes = {}
ground_nodes[minetest.get_content_id('default:stone')] = true
ground_nodes[minetest.get_content_id('default:desert_stone')] = true
ground_nodes[minetest.get_content_id('default:sandstone')] = true
ground_nodes[minetest.get_content_id('default:dirt')] = true
ground_nodes[minetest.get_content_id('default:sand')] = true
ground_nodes[minetest.get_content_id('default:dirt_with_grass')] = true
ground_nodes[minetest.get_content_id('default:dirt_with_snow')] = true
ground_nodes[minetest.get_content_id('default:dirt_with_dry_grass')] = true
fun_caves.cavegen = function(minp, maxp, data, area, node, heightmap, underzone)
fun_caves.cavegen = function(minp, maxp, data, area, node, heightmap, underzone, ground_nodes)
if not (minp and maxp and data and area and node and type(data) == 'table' and fun_caves.underzones) then
return
end
@ -58,21 +47,6 @@ fun_caves.cavegen = function(minp, maxp, data, area, node, heightmap, underzone)
index = index + 1
local height = heightmap[index]
if height and height < maxp.y - 1 and height > minp.y then
--nop
else
height = - max_depth
local ivm2 = area:index(x, maxp.y + 8, z)
for y = maxp.y + 8, minp.y - 8, -1 do
if ground_nodes[data[ivm2]] then
height = (y < maxp.y + 8) and y or max_depth
break
end
ivm2 = ivm2 - area.ystride
end
heightmap[index] = height
end
if crater then
local dist = crater.y - math.sqrt((x - crater.x) ^ 2 + (z - crater.z) ^ 2)
if dist > 0 and (height > maxp.y or height < minp.y + crater.y) then