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

@ -90,6 +90,8 @@ minetest.register_biome({
node_filler = "default:dirt",
depth_filler = 1,
node_stone = "default:desert_stone",
node_riverbed = "default:sand",
depth_riverbed = 2,
--node_water_top = "",
--depth_water_top = ,
--node_water = "",

View file

@ -89,8 +89,24 @@ minetest.register_node("fun_caves:glowing_fungus", {
groups = {dig_immediate = 3},
})
-- Iron, hot
newnode = fun_caves.clone_node("default:steelblock")
newnode.description = "Hot Iron Block"
newnode.tiles = {"default_steel_block.png^[colorize:#FF3000:150"}
newnode.groups.surface_hot=3
newnode.light_source = 3
minetest.register_node("fun_caves:hot_iron", newnode)
-- Brass, hot
newnode = fun_caves.clone_node("default:steelblock")
newnode.description = "Hot Brass Block"
newnode.tiles = {"default_steel_block.png^[colorize:#FFBF00:150"}
newnode.groups.surface_hot=3
newnode.light_source = 2
minetest.register_node("fun_caves:hot_brass", newnode)
-- moon glass (glows)
local newnode = fun_caves.clone_node("default:glass")
newnode = fun_caves.clone_node("default:glass")
newnode.light_source = default.LIGHT_MAX
minetest.register_node("fun_caves:moon_glass", newnode)
@ -313,6 +329,19 @@ newnode.sounds = default.node_sound_dirt_defaults({
})
minetest.register_node("fun_caves:stone_with_algae", newnode)
-- stone, hot
minetest.register_node("fun_caves:hot_stone", {
description = "Hot Stone",
tiles = {"default_desert_stone.png^[colorize:#FF0000:150"},
is_ground_content = true,
groups = {crumbly=2, surface_hot=3},
light_source = fun_caves.light_max - 5,
damage_per_second = 1,
sounds = default.node_sound_stone_defaults({
footstep = {name="default_stone_footstep", gain=0.25},
}),
})
-- stone with lichen
newnode = fun_caves.clone_node("default:stone")
newnode.description = "Cave Stone With Lichen"

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