Skip to content
Snippets Groups Projects
Commit d9a2d026 authored by Duane Robertson's avatar Duane Robertson
Browse files

Add control complexes and air ladders.

parent 74734f93
No related branches found
No related tags found
No related merge requests found
......@@ -72,6 +72,7 @@ do
biome_names[rarity][#biome_names[rarity]+1] = biome.name
end
end
biomes["control"] = {}
local cave_stones = {
"loud_walking:stone_with_moss",
......@@ -175,6 +176,7 @@ end
local function get_height(dx, dz, terrain_scale, ocean, index)
local terr
local half = math.floor(csize.y / 2 + 0.5)
terrain_scale = terrain_scale or 1
--if index == true then
-- terr = minetest.get_perlin(terrain_noise):get2d({x=dx, y=dz})
......@@ -203,14 +205,17 @@ local function get_height(dx, dz, terrain_scale, ocean, index)
end
local function get_biome(px, pz)
local sr = math.random(5)
local rarity = "common"
if sr > 4 then
rarity = "uncommon"
if px % 10 == 6 and pz % 10 == 6 then
return "control"
else
local sr = math.random(5)
local rarity = "common"
if sr > 4 then
rarity = "uncommon"
end
local biome = biome_names[rarity][math.random(#biome_names[rarity])]
return biome
end
local biome = biome_names[rarity][math.random(#biome_names[rarity])]
return biome
--return "savanna"
end
local function get_decoration(biome)
......@@ -234,8 +239,6 @@ function loud_walking.generate(p_minp, p_maxp, seed)
minp, maxp = p_minp, p_maxp
vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
vm:get_data(data)
vm:set_lighting({day = 15, night = 0}, minp, maxp)
lightmap = vm:get_light_data()
--p2data = vm:get_param2_data()
a = VoxelArea:new({MinEdge = emin, MaxEdge = emax})
csize = vector.add(vector.subtract(maxp, minp), 1)
......@@ -262,6 +265,10 @@ function loud_walking.generate(p_minp, p_maxp, seed)
cave_lining = nil
end
print(biome)
vm:set_lighting({day = 15, night = (biome == "control" and 15 or 0)}, minp, maxp)
lightmap = vm:get_light_data()
local node_top = biomes[biome].node_top or "default:dirt_with_grass"
local node_filler = biomes[biome].node_filler or "default:dirt"
local node_water_top = biomes[biome].node_water_top or "default:water_source"
......@@ -311,7 +318,9 @@ function loud_walking.generate(p_minp, p_maxp, seed)
for y = minp.y, maxp.y do
local dy = y - minp.y
if pod then
if math.min(dx, csize.x - dx) + math.min(dy, csize.y - dy) + math.min(dz, csize.z - dz) < bevel then
if biome == "control" and math.abs(dx - half) < 3 and math.abs(dz - half) < 3 then
data[ivm] = node("loud_walking:air_ladder")
elseif math.min(dx, csize.x - dx) + math.min(dy, csize.y - dy) + math.min(dz, csize.z - dz) < bevel then
data[ivm] = node("air")
lightmap[ivm] = 0
in_cave = false
......@@ -319,7 +328,9 @@ function loud_walking.generate(p_minp, p_maxp, seed)
if math.abs(dy - half - 2) < 2 and (dz == half or dx == half) then
data[ivm] = node("air")
else
if biome ~= "underground" and dy < half then
if biome == "control" then
data[ivm] = node(glass[3])
elseif biome ~= "underground" and dy < half then
data[ivm] = node("loud_walking:scrith")
lightmap[ivm] = 0
elseif dy == csize.y - 1 then
......@@ -329,6 +340,14 @@ function loud_walking.generate(p_minp, p_maxp, seed)
end
end
in_cave = false
elseif biome == "control" and dy % 5 == 0 then
data[ivm] = node("default:steelblock")
elseif biome == "control" and (math.abs(dx - half) < 3 or math.abs(dz - half) < 3) then
data[ivm] = node("air")
elseif biome == "control" and ((math.abs(dx - half) % 20 == 3 and (math.abs(dz - half) - 12) % 20 > 3) or (math.abs(dz - half) % 20 == 3 and (math.abs(dx - half) - 12) % 20 > 3)) then
data[ivm] = node("default:steelblock")
elseif biome == "control" then
--
elseif (((dx == 35 or dx == 45) and dz >= 35 and dz <= 45) or ((dz == 35 or dz == 45) and dx >= 35 and dx <= 45)) and dx ~= 40 and dz ~= 40 and dy == csize.y - 2 then
data[ivm] = node("loud_walking:controls")
elseif (((dx == 35 or dx == 45) and dz >= 35 and dz <= 45) or ((dz == 35 or dz == 45) and dx >= 35 and dx <= 45)) and dx ~= 40 and dz ~= 40 and dy > csize.y - 5 then
......@@ -410,6 +429,8 @@ function loud_walking.generate(p_minp, p_maxp, seed)
lightmap[ivm] = 0
in_cave = false
end
elseif biome == "control" and math.abs(dx - half) < 3 and math.abs(dz - half) < 3 then
data[ivm] = node("loud_walking:air_ladder")
elseif connection and dy == half and ((dx == half and connection % 4 == 0) or (dz == half and connection % 2 == 1)) then
data[ivm] = node("loud_walking:scrith")
lightmap[ivm] = 0
......@@ -425,7 +446,6 @@ function loud_walking.generate(p_minp, p_maxp, seed)
end
if pod then
print(biome)
for dz = 0, 75, 5 do
for dx = 0, 75, 5 do
if biomes[biome].special_tree_prob and math.random(biomes[biome].special_tree_prob) == 1 then
......
......@@ -173,3 +173,21 @@ end
register_flower("orchid", "Orchid", {"rainforest", "rainforest_swamp"}, 0.025)
register_flower("bird_of_paradise", "Bird of Paradise", {"rainforest", "desertstone_grassland"}, 0.025)
register_flower("gerbera", "Gerbera", {"savanna", "rainforest", "desertstone_grassland"}, 0.005)
minetest.register_node("loud_walking:air_ladder", {
description = "Air Ladder",
drawtype = "glasslike",
tiles = {"loud_walking_air_ladder.png"},
paramtype = "light",
sunlight_propagates = true,
walkable = false,
use_texture_alpha = true,
climbable = true,
is_ground_content = false,
selection_box = {
type = "fixed",
fixed = {0, 0, 0, 0, 0, 0},
},
})
textures/loud_walking_air_ladder.png

2.09 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment