From 9cbffa6fca806a2dd9cee336ba6d04a631cf6308 Mon Sep 17 00:00:00 2001 From: Sokomine Date: Sat, 14 Mar 2015 19:25:27 +0100 Subject: [PATCH] added mg_villages.inside_village_terrain_blend_area --- mapgen.lua | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/mapgen.lua b/mapgen.lua index 893320b..83cc817 100644 --- a/mapgen.lua +++ b/mapgen.lua @@ -15,6 +15,8 @@ function mg_villages.get_bseed2(minp) end +-- if you change any of the 3 constants below, also change them in the function +-- mg_villages.village_area_mark_inside_village_area mg_villages.inside_village = function(x, z, village, vnoise) return mg_villages.get_vn(x, z, vnoise:get2d({x = x, y = z}), village) <= 40 end @@ -23,6 +25,11 @@ mg_villages.inside_village_area = function(x, z, village, vnoise) return mg_villages.get_vn(x, z, vnoise:get2d({x = x, y = z}), village) <= 80 end +mg_villages.inside_village_terrain_blend_area = function(x, z, village, vnoise) + return mg_villages.get_vn(x, z, vnoise:get2d({x = x, y = z}), village) <= 160 +end + + mg_villages.get_vnoise = function(x, z, village, vnoise) -- PM v return mg_villages.get_vn(x, z, vnoise:get2d({x = x, y = z}), village) end -- PM ^ @@ -394,15 +401,15 @@ mg_villages.village_area_mark_inside_village_area = function( village_area, vill -- do nothing here; the village area will be specificly marked later on -- the village core; this is where the houses stand (but there's no house or road at this particular spot) - elseif( vn <= 40 ) then + elseif( vn <= 40 ) then -- see mg_villages.inside_village village_area[ x ][ z ] = { village_nr, 6}; -- the flattened land around the village where wheat, cotton, trees or grass may be grown (depending on village type) - elseif( vn <= 80 ) then + elseif( vn <= 80 ) then -- see mg_villages.inside_village_area village_area[ x ][ z ] = { village_nr, 1}; -- terrain blending for the flattened land - elseif( vn <= 160 and mg_villages.ENABLE_TERRAIN_BLEND) then + elseif( vn <= 160 and mg_villages.ENABLE_TERRAIN_BLEND) then -- see mg_villages.inside_village_terrain_blend_area if n_rawnoise > -0.5 then -- leave some cliffs unblended local blend = (( vn - 80) / 80) ^ 2 -- 0 at village edge, 1 at normal terrain -- assign a negative value to terrain that needs to be adjusted in height