Add riverbeds to biomes and start hell levels.

This commit is contained in:
Duane 2016-06-06 19:54:42 -05:00
parent 5ea5f54a7d
commit 87c065153a
3 changed files with 93 additions and 8 deletions

View file

@ -191,9 +191,17 @@ local function generate(p_minp, p_maxp, seed)
math.randomseed(minetest.get_perlin(seed_noise):get2d({x=minp.x, y=minp.z}))
local write = false
local underzone
if minp.y % 4960 < 240 and maxp.y % 4960 > 0 then
underzone = true
local underzone, dis_map = nil, {}
if minp.y < -4000 and minp.y % 4960 < 160 and maxp.y % 4960 > 0 then
underzone = floor(minp.y / -4960 + 0.5)
if underzone == 3 then
for i = 0, 10, 2 do
dis_map[i] = {}
for j = 0, 10, 2 do
dis_map[i][j] = rand(4)
end
end
end
end
if not underzone and fun_caves.is_fortress(minp, csize) then
@ -327,10 +335,31 @@ local function generate(p_minp, p_maxp, seed)
end
for y = minp.y, maxp.y do
if column == 1 and data[ivm] ~= node['air'] and y % 4960 < cave_3[index] + 160 and y % 4960 > cave_3[index] + 80 then
-- Dis
if underzone == 3 then
if (x - minp.x) < 8 and (z - minp.z) < 8 then
data[ivm] = node["default:steelblock"]
elseif data[ivm] ~= node['air'] and y % 4960 < 160 and y % 4960 > 80 then
data[ivm] = node["air"]
end
write = true
-- Caina
elseif column == 2 and underzone == 1 and (data[ivm] == node['default:stone'] or data[ivm] == node['default:desert_stone']) then
if rand(70) == 1 then
data[ivm] = node["fun_caves:thin_ice"]
else
data[ivm] = node["default:ice"]
end
write = true
-- Phlegethos
elseif column == 2 and (data[ivm] == node['default:stone'] or data[ivm] == node['default:desert_stone']) and rand(70) == 1 then
data[ivm] = node["fun_caves:hot_stone"]
write = true
-- Dis
elseif column == 1 and underzone ~= 3 and data[ivm] ~= node['air'] and y % 4960 < cave_3[index] + 160 and y % 4960 > cave_3[index] + 80 then
data[ivm] = node["air"]
write = true
elseif column < 2 and data[ivm] ~= node['air'] and y < height - cave_3[index] and cave_1[index3d] * cave_2[index3d] > cave_width then
elseif column < 2 and underzone ~= 3 and data[ivm] ~= node['air'] and y < height - cave_3[index] and cave_1[index3d] * cave_2[index3d] > cave_width then
data[ivm] = node["air"]
write = true
@ -386,7 +415,18 @@ local function generate(p_minp, p_maxp, seed)
-------------------
--biome_val = -0.75
-------------------
if biome_val < -0.65 then
if underzone == 1 then
stone_type = node["default:ice"]
stone_depth = 2
elseif underzone == 3 then
stone_type = node["fun_caves:hot_brass"]
stone_depth = 1
elseif underzone and y % 4960 <= 145 then
stone_type = node["fun_caves:hot_cobble"]
elseif underzone and y % 4960 > 145 then
stone_type = node["fun_caves:black_sand"]
stone_depth = 2
elseif biome_val < -0.65 then
stone_type = node["default:ice"]
stone_depth = 2
elseif biome_val < -0.6 then
@ -487,6 +527,20 @@ local function generate(p_minp, p_maxp, seed)
end
end
-- Dis
if underzone == 3 and data[ivm] == node['air'] and floor((x - minp.x) / 8) % 2 == 0 and floor((z - minp.z) / 8) % 2 == 0 and y % 4960 < 82 + dis_map[floor((x - minp.x) / 8)][floor((z - minp.z) / 8)] * 4 and y % 4960 > 80 then
local dx = (x - minp.x) % 16
local dy = y % 4960 - 80
local dz = (z - minp.z) % 16
if ((dx == 0 or dx == 7) and (dz % 3 ~= 2 or dy % 4 == 0)) or ((dz == 0 or dz == 7) and (dx % 3 ~= 2 or dy % 4 == 0)) then
data[ivm] = node["fun_caves:hot_iron"]
elseif dy %4 == 0 then
data[ivm] = node["fun_caves:hot_brass"]
end
write = true
break
end
if data[ivm] == node["air"] and y < maxp.y then
-- hanging down
if node_above == node["default:stone"] and rand(12) == 1 then
@ -700,7 +754,7 @@ local function generate(p_minp, p_maxp, seed)
if write then
vm:set_data(data)
--vm:set_param2_data(p2data)
if underzone or fun_caves.DEBUG then
if fun_caves.DEBUG then
vm:set_lighting({day = 10, night = 10})
else
-- set_lighting causes shadows