From d9a2d0262ee7d7d4ab7fd35eb5949b5ba70168c5 Mon Sep 17 00:00:00 2001 From: Duane Robertson Date: Fri, 8 Apr 2016 23:35:14 -0500 Subject: [PATCH] Add control complexes and air ladders. --- mapgen.lua | 44 +++++++++++++++++++-------- nodes.lua | 18 +++++++++++ textures/loud_walking_air_ladder.png | Bin 0 -> 2139 bytes 3 files changed, 50 insertions(+), 12 deletions(-) create mode 100644 textures/loud_walking_air_ladder.png diff --git a/mapgen.lua b/mapgen.lua index 0683bcd..0bb13bc 100644 --- a/mapgen.lua +++ b/mapgen.lua @@ -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 diff --git a/nodes.lua b/nodes.lua index 9f837c0..a84f6ee 100644 --- a/nodes.lua +++ b/nodes.lua @@ -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}, + }, +}) + diff --git a/textures/loud_walking_air_ladder.png b/textures/loud_walking_air_ladder.png new file mode 100644 index 0000000000000000000000000000000000000000..dbd2477905bc79cc15af96f8b3718592268bc0d8 GIT binary patch literal 2139 zcmV-h2&DIkP)ZnC5B(MXa>?Pa_3FN_Q&pKH0eHZY zG9qXBAjpliH{{>{g2Z^PAuN#P5Fhuc#=WKK+Hi{ro4sz5mRYuYaW<55gx9`0S{PAR>q= zDuPL+TEVQ)_MLM~-fssU&c0s|fe;WN-N_8_B;6Qi5(y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