summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/dat
diff options
context:
space:
mode:
authorinfiniplex <infiniplex@hotmail.com>2014-07-07 12:25:50 -0600
committerreaverb <reaverb.Crawl@gmail.com>2014-07-23 22:05:30 -0400
commitcfb0d12409c2d1eb53071a377caf1d54866824f4 (patch)
tree35e1c7ceaa3641316fa82f82f486fd6c40f083a6 /crawl-ref/source/dat
parentfe5354c7f8115e95b0eafd434cd1bb0979c3477e (diff)
downloadcrawl-ref-cfb0d12409c2d1eb53071a377caf1d54866824f4.tar.gz
crawl-ref-cfb0d12409c2d1eb53071a377caf1d54866824f4.zip
Rework layout_gehenna_lava_caves
Diffstat (limited to 'crawl-ref/source/dat')
-rw-r--r--crawl-ref/source/dat/des/builder/layout_caves.des42
1 files changed, 34 insertions, 8 deletions
diff --git a/crawl-ref/source/dat/des/builder/layout_caves.des b/crawl-ref/source/dat/des/builder/layout_caves.des
index 04e409e692..1032423476 100644
--- a/crawl-ref/source/dat/des/builder/layout_caves.des
+++ b/crawl-ref/source/dat/des/builder/layout_caves.des
@@ -504,7 +504,8 @@ ENDMAP
##############################################################
# layout_gehenna_lava_caves
#
-# TODO: Add round buildings, depth convergence.
+# Basically perlin noise, with rock and lava at the extreme
+# values. The middle values become the paths.
#
NAME: layout_gehenna_lava_caves
DEPTH: Geh
@@ -516,7 +517,16 @@ TAGS: overwritable layout allow_dup unrand layout_type_narrow_caves
local gxm,gym = dgn.max_bounds()
extend_map { width = gxm, height = gym, fill = 'x' }
- local scale = util.random_range_real(.3,1.8)
+
+ -- choose some parameters based on depth
+ local depth_fraction = you.depth_fraction()
+ local scale = 1.6 - crawl.random_real() * 0.3 - depth_fraction * 0.4
+ local padding = crawl.random_range(6, 10)
+ local wall_break = 0.05 + crawl.random_real() * 0.05 + depth_fraction * 0.1
+ local lava_break = 0.15 + crawl.random_real() * 0.1 + depth_fraction * 0.15
+ local open_break = 0.55 + crawl.random_real() * 0.05 + depth_fraction * 0.15
+
+ -- set up the main perlin noise function
local perlin1 = procedural.simplex3d { scale = scale }
if crawl.coinflip() then
perlin1 = procedural.distort {
@@ -527,23 +537,39 @@ TAGS: overwritable layout allow_dup unrand layout_type_narrow_caves
}
end
- local padding = crawl.random_range(5,12)
+ -- set up the edges for the map
+ local boundary = 8
+ local min_hard = boundary
+ local min_padded = boundary + padding
+ local max_padded_x = gxm - 1 - boundary - padding
+ local max_hard_x = gxm - 1 - boundary
+ local max_padded_y = gym - 1 - boundary - padding
+ local max_hard_y = gym - 1 - boundary
+ -- render the map
for x = 1,gxm-2,1 do
for y = 1,gym-2,1 do
- local val = perlin1(x,y) * procedural.boundary_map(x,1,padding,gxm-2-padding,gxm-2) * procedural.boundary_map(y,1,padding,gym-2-padding,gym-2)
- if val < 0.1 then
+ local val = perlin1(x, y)
+ * procedural.boundary_map(x, min_hard, min_padded,
+ max_padded_x, max_hard_x)
+ * procedural.boundary_map(y, min_hard, min_padded,
+ max_padded_y, max_hard_y)
+ if val < wall_break then
mapgrd[x][y] = "x"
- elseif val < 0.25 then
+ elseif val < lava_break then
mapgrd[x][y] = "l"
- elseif val < 0.6 then
+ elseif val < open_break then
mapgrd[x][y] = "."
+ else
+ -- leave as 'x'
end
end
end
+ -- assorted fixups
+ theme.add_gehenna_buildings(_G)
zonify.map_fill_zones(_G, 1, 'l')
-
+ zonify.map_fill_lava_zones(_G, 1, 'x')
}}
MAP
ENDMAP