summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Melenchuk <smelenchuk@gmail.com>2013-05-25 19:19:44 -0600
committerSteve Melenchuk <smelenchuk@gmail.com>2013-05-26 20:56:16 -0600
commit5ad725fafd9e892f77c7fe9a83c7659516bebfe7 (patch)
tree7232399c1b9acd9b8436bb0767122a9c21d27af6
parent65f519f29f21b78d568cbf1bfbd574a461031efb (diff)
downloadcrawl-ref-5ad725fafd9e892f77c7fe9a83c7659516bebfe7.tar.gz
crawl-ref-5ad725fafd9e892f77c7fe9a83c7659516bebfe7.zip
Adjust level layouts for Forest.
This makes layout_twisted_forest the sole layout for Forest (for now), and adjusts it to provide a border of trees in Forest. Vaults that have been tagged for Forest previously are given standard weights, and functionality has been added to the vault placer to allow vaults placing in Forest to overwrite trees so that the vaults can reliably place there.
-rw-r--r--crawl-ref/source/dat/des/branches/lair.des44
-rw-r--r--crawl-ref/source/dat/des/builder/layout.des20
-rw-r--r--crawl-ref/source/dat/des/builder/layout_loops.des6
-rw-r--r--crawl-ref/source/dat/des/builder/layout_woods.des20
-rw-r--r--crawl-ref/source/maps.cc3
5 files changed, 50 insertions, 43 deletions
diff --git a/crawl-ref/source/dat/des/branches/lair.des b/crawl-ref/source/dat/des/branches/lair.des
index c5936a54c0..5092d2ed69 100644
--- a/crawl-ref/source/dat/des/branches/lair.des
+++ b/crawl-ref/source/dat/des/branches/lair.des
@@ -1342,7 +1342,7 @@ NAME: wad_woods_pond
TAGS: uniq_wad_woods_large
DEPTH: Lair, Forest, D:2-16
ORIENT: float
-WEIGHT: 1
+WEIGHT: 1, 10 (Forest)
KFEAT: t = mangrove
KFEAT: q = tree
FTILE: '1 = floor_grass_dirt_mix
@@ -1390,7 +1390,7 @@ NAME: wad_woods_settlement
TAGS: uniq_wad_woods_large
DEPTH: Lair, Forest, D:2-16
ORIENT: float
-WEIGHT: 1
+WEIGHT: 1, 10 (Forest)
KFEAT: q = tree
FTILE: '2*+ = floor_dirt
FTILE: q13%OtI. = floor_woodground
@@ -1433,7 +1433,7 @@ NAME: wad_woods_tower
TAGS: uniq_wad_woods_med
DEPTH: Lair, Forest, D:2-16
ORIENT: float
-WEIGHT: 1
+WEIGHT: 1, 10 (Forest)
KFEAT: q = tree
FTILE: '2*+~T = floor_dirt
FTILE: q13%OI. = floor_woodground
@@ -1464,7 +1464,7 @@ NAME: wad_woods_stonehenge
TAGS: uniq_wad_woods_med
DEPTH: Lair, Forest, D:2-16
ORIENT: float
-WEIGHT: 1
+WEIGHT: 1, 10 (Forest)
KFEAT: q = tree
FTILE: '2*+T = floor_dirt
FTILE: q1C3%OI. = floor_woodground
@@ -1494,7 +1494,7 @@ ENDMAP
NAME: wad_woods_01
TAGS: mini_float uniq_wad_woods_small
DEPTH: Lair, Forest
-WEIGHT: 1
+WEIGHT: 1, 10 (Forest)
FTILE: '*+T = floor_dirt
FTILE: qt123C%OI. = floor_woodground
MARKER: O = lua:fog_machine { \
@@ -1521,7 +1521,7 @@ ENDMAP
NAME: wad_woods_02
TAGS: mini_float uniq_wad_woods_small
DEPTH: Lair, Forest
-WEIGHT: 1
+WEIGHT: 1, 10 (Forest)
FTILE: '*+T = floor_dirt
FTILE: tq123C%I. = floor_woodground
MONS: plant, gnoll, porcupine
@@ -1544,7 +1544,7 @@ ENDMAP
NAME: wad_woods_03
DEPTH: Lair, Forest
-WEIGHT: 1
+WEIGHT: 1, 10 (Forest)
FTILE: '*~0+T1 = floor_dirt
FTILE: tq23C%I. = floor_woodground
MONS: plant, gnoll, porcupine
@@ -1568,7 +1568,7 @@ ENDMAP
NAME: wad_woods_04
TAGS: mini_float extra
DEPTH: Lair, Forest
-WEIGHT: 1
+WEIGHT: 1, 10 (Forest)
FTILE: '+*~T = floor_dirt
FTILE: t*q123C%I. = floor_woodground
MONS: plant, bush, fungus
@@ -1595,7 +1595,7 @@ ENDMAP
NAME: wad_woods_06
TAGS: mini_float extra
DEPTH: Lair, Forest
-WEIGHT: 1
+WEIGHT: 1, 10 (Forest)
FTILE: '+T = floor_dirt
FTILE: t*q123C%0I. = floor_woodground
MONS: plant, bush, fungus
@@ -1616,7 +1616,7 @@ ENDMAP
NAME: wad_woods_antlair
TAGS: mini_float
DEPTH: Lair, Forest
-WEIGHT: 1
+WEIGHT: 1, 10 (Forest)
FTILE: t*q1234C%I. = floor_woodground
MONS: plant, soldier ant, queen ant, worker ant
MAP
@@ -1639,7 +1639,7 @@ ENDMAP
NAME: wad_woods_river_01
DEPTH: Lair, Forest, D:2-16
ORIENT: float
-WEIGHT: 1
+WEIGHT: 1, 10 (Forest)
FTILE: t+*q123C0%I. = floor_woodground
MONS: plant, bush, fungus
MAP
@@ -1669,7 +1669,7 @@ ENDMAP
NAME: wad_woods_river_02
TAGS: mini_float extra
DEPTH: Lair, Forest
-WEIGHT: 1
+WEIGHT: 1, 10 (Forest)
FTILE: t|+*q1203C%OI. = floor_woodground
MARKER: O = lua:fog_machine { \
pow_min = 4, pow_max = 9, delay = 32, \
@@ -1694,7 +1694,7 @@ ENDMAP
NAME: wad_woods_river_03
TAGS: mini_float extra
DEPTH: Lair, Forest
-WEIGHT: 1
+WEIGHT: 1, 10 (Forest)
FTILE: t+*q1203C%OI. = floor_woodground
MARKER: O = lua:fog_machine { \
pow_min = 3, pow_max = 7, delay = 32, \
@@ -1717,7 +1717,7 @@ ENDMAP
NAME: wad_woods_river_04
TAGS: no_vmirror no_rotate mini_float extra
DEPTH: D, Lair, Forest
-WEIGHT: 1
+WEIGHT: 1, 10 (Forest)
FTILE: t+*q1203C%I. = floor_woodground
TILE: X = wall_brick_dark_leak
TILE: x = wall_brick_dark
@@ -1743,7 +1743,7 @@ ENDMAP
NAME: wad_woods_road_01
TAGS: extra
DEPTH: Lair, Forest
-WEIGHT: 1
+WEIGHT: 1, 10 (Forest)
FTILE: @' = floor_dirt
FTILE: qt0123C%OIT. = floor_woodground
MONS: plant, bush, fungus
@@ -1772,7 +1772,7 @@ ENDMAP
NAME: wad_woods_road_02
TAGS: extra
DEPTH: Lair, Forest
-WEIGHT: 1
+WEIGHT: 1, 10 (Forest)
FTILE: @' = floor_dirt
FTILE: qt123C%0ITU. = floor_woodground
MONS: plant, bush, fungus
@@ -1795,7 +1795,7 @@ ENDMAP
NAME: wad_woods_road_03
TAGS: extra
DEPTH: Lair, Forest
-WEIGHT: 1
+WEIGHT: 1, 10 (Forest)
FTILE: @' = floor_dirt
FTILE: qt123C%*0ITU. = floor_woodground
MONS: plant, bush, fungus
@@ -1815,7 +1815,7 @@ ENDMAP
NAME: wad_woods_road_04
DEPTH: Lair, Forest
-WEIGHT: 1
+WEIGHT: 1, 10 (Forest)
FTILE: @'+T = floor_dirt
FTILE: t*q123C%I. = floor_woodground
MONS: plant, bush, oklob plant
@@ -1837,7 +1837,7 @@ ENDMAP
NAME: wad_woods_road_05
DEPTH: Lair, Forest
-WEIGHT: 1
+WEIGHT: 1, 10 (Forest)
FTILE: @'~*+T = floor_dirt
FTILE: tq123C%0I. = floor_woodground
MONS: plant, gnoll, porcupine
@@ -1858,7 +1858,7 @@ ENDMAP
NAME: wad_woods_road_06
TAGS: extra
DEPTH: Lair, Forest
-WEIGHT: 1
+WEIGHT: 1, 10 (Forest)
FTILE: @'~*+T = floor_dirt
FTILE: tq123C%0I. = floor_woodground
MONS: plant
@@ -1880,7 +1880,7 @@ NAME: wad_woods_minihive
TAGS: no_monster_gen
DEPTH: Lair, Forest, D:8-16
ORIENT: float
-WEIGHT: 5
+WEIGHT: 5, 10 (Forest)
KFEAT: O = mangrove
FTILE: ~%.12t3 = floor_woodground
TILE: x = wall_brick_brown
@@ -1916,7 +1916,7 @@ NAME: wad_woods_structure_01
TAGS: no_monster_gen
DEPTH: Lair, Forest, D:10-20
ORIENT: float
-WEIGHT: 5
+WEIGHT: 5, 10 (Forest)
FTILE: "2T = floor_grass
FTILE: @'~0+ = floor_dirt
FTILE: %*.1t3 = floor_woodground
diff --git a/crawl-ref/source/dat/des/builder/layout.des b/crawl-ref/source/dat/des/builder/layout.des
index 1e6aaa6d8c..5791bc7cb7 100644
--- a/crawl-ref/source/dat/des/builder/layout.des
+++ b/crawl-ref/source/dat/des/builder/layout.des
@@ -69,7 +69,7 @@
# room with a large hole in the middle.
#
NAME: layout_forbidden_donut
-DEPTH: 4-22, Pan, !Dis, !Geh
+DEPTH: 4-22, Pan, !Dis, !Geh, !Forest
WEIGHT: 10
ORIENT: encompass
TAGS: overwritable layout no_primary_vault allow_dup unrand layout_type_open
@@ -139,7 +139,7 @@ ENDMAP
# of varying width.
#
NAME: layout_cross
-DEPTH: Pan, 4-22, !Dis, !Geh
+DEPTH: Pan, 4-22, !Dis, !Geh, !Forest
WEIGHT: 10
ORIENT: encompass
TAGS: overwritable layout allow_dup unrand layout_type_cross
@@ -205,7 +205,7 @@ ENDMAP
# are generally all grouped together.
#
NAME: layout_big_octagon
-DEPTH: Pan, 4-22, !Dis, !Geh
+DEPTH: Pan, 4-22, !Dis, !Geh, !Forest
WEIGHT: 6 (Pan), 10
ORIENT: encompass
TAGS: overwritable layout no_primary_vault allow_dup unrand layout_type_open
@@ -372,7 +372,7 @@ ENDMAP
# This replaces dungeon.cc:_plan_3().
#
NAME: layout_rooms
-DEPTH: Pan, 1-, !Dis, !Tar
+DEPTH: Pan, 1-, !Dis, !Tar, !Forest
WEIGHT: 60 (Pan), 10 (Zot), 20
ORIENT: encompass
TAGS: overwritable layout allow_dup unrand layout_type_rooms
@@ -566,7 +566,7 @@ ENDMAP
#
# This replaces dungeon.cc:_plan_5().
NAME: layout_misc
-DEPTH: Pan, 1-, !Dis, !Tar
+DEPTH: Pan, 1-, !Dis, !Tar, !Forest
WEIGHT: 10
ORIENT: encompass
TAGS: overwritable layout allow_dup unrand layout_type_misc
@@ -607,7 +607,7 @@ ENDMAP
# walls.
#
NAME: layout_caves
-DEPTH: 9-22, !Dis, !Geh, Orc, Slime
+DEPTH: 9-22, !Dis, !Geh, Orc, Slime, !Forest
CHANCE: 100% (Orc), 100% (Slime)
ORIENT: encompass
TAGS: overwritable layout allow_dup unrand layout_type_caves
@@ -674,7 +674,7 @@ TAGS: overwritable layout allow_dup unrand layout_type_delve
##############################################################
## This replaces dungeon.cc:_roguey_level.
NAME: layout_roguey
-DEPTH: 2-, !Pan, !Zot, !Dis, !Geh, !Tar
+DEPTH: 2-, !Pan, !Zot, !Dis, !Geh, !Tar, !Forest
WEIGHT: 20
ORIENT: encompass
TAGS: overwritable layout no_primary_vault allow_dup unrand layout_type_rooms
@@ -1431,7 +1431,7 @@ ENDMAP
##############################################################
# Dummy layouts that just call C++ functions that do all the work.
NAME: layout_basic
-DEPTH: 1-, !Pan, !Dis, !Tar
+DEPTH: 1-, !Pan, !Dis, !Tar, !Forest
WEIGHT: 50, 10 (D:1), 20 (Geh), 10 (Zot)
ORIENT: encompass
TAGS: overwritable layout allow_dup unrand layout_type_basic
@@ -1443,7 +1443,7 @@ ENDMAP
# XXX: Disabled until we can annoy the player less with water monsters.
NAME: layout_bigger_room
-DEPTH: 9-22, !Crypt, !Pan, !Dis
+DEPTH: 9-22, !Crypt, !Pan, !Dis, !Forest
WEIGHT: 0
ORIENT: encompass
TAGS: overwritable layout no_primary_vault allow_dup unrand layout_type_open
@@ -1454,7 +1454,7 @@ MAP
ENDMAP
NAME: layout_chaotic_city
-DEPTH: Pan, 4-, !Zot, !Geh, !Tar
+DEPTH: Pan, 4-, !Zot, !Geh, !Tar, !Forest
WEIGHT: 10
ORIENT: encompass
TAGS: overwritable layout allow_dup unrand layout_type_city
diff --git a/crawl-ref/source/dat/des/builder/layout_loops.des b/crawl-ref/source/dat/des/builder/layout_loops.des
index cc89801fa8..5e9406dec5 100644
--- a/crawl-ref/source/dat/des/builder/layout_loops.des
+++ b/crawl-ref/source/dat/des/builder/layout_loops.des
@@ -1081,7 +1081,7 @@ end
# can be difficult to see in the final map.
#
NAME: layout_loops_misc
-DEPTH: 1-, !Dis, !Geh, !Tar
+DEPTH: 1-, !Dis, !Geh, !Tar, !Forest
WEIGHT: 5 (Pan), 10 (Zot), 20
ORIENT: encompass
TAGS: overwritable layout allow_dup unrand layout_type_misc
@@ -1198,7 +1198,7 @@ ENDMAP
# another (random) arm of the cross.
#
NAME: layout_loops_cross
-DEPTH: Pan, 1-, !Zot, !Dis, !Geh, !Tar
+DEPTH: Pan, 1-, !Zot, !Dis, !Geh, !Tar, !Forest
WEIGHT: 5 (Pan), 10
ORIENT: encompass
TAGS: overwritable layout allow_dup unrand
@@ -1452,7 +1452,7 @@ ENDMAP
# generated around the central rooms.
#
NAME: layout_loops_corners
-DEPTH: 1-, !Zot, !Dis, !Geh, !Tar
+DEPTH: 1-, !Zot, !Dis, !Geh, !Tar, !Forest
WEIGHT: 5
ORIENT: encompass
TAGS: overwritable layout allow_dup unrand layout_type_misc
diff --git a/crawl-ref/source/dat/des/builder/layout_woods.des b/crawl-ref/source/dat/des/builder/layout_woods.des
index 4f00b1e283..18330d684f 100644
--- a/crawl-ref/source/dat/des/builder/layout_woods.des
+++ b/crawl-ref/source/dat/des/builder/layout_woods.des
@@ -11,8 +11,8 @@
# A twisty turny forest maze. The idea was to have slight variations in tree
# types in Dis, Crypt, Tar...
NAME: layout_twisted_forest
-DEPTH: D:15-25,Lair
-WEIGHT: 2
+DEPTH: D:15-25,Lair,Forest
+WEIGHT: 2, 100 (Forest)
ORIENT: encompass
TAGS: overwritable layout allow_dup unrand layout_type_forest
{{
@@ -28,8 +28,12 @@ TAGS: overwritable layout allow_dup unrand layout_type_forest
local scale = 1 -- util.random_range_real(1,2)
local tree_feature = 't'
+ local fill = 'x'
local plant_mons = "plant"
- if you.in_branch("dis") then
+ if you.in_branch("forest") then
+ fill = 't'
+ scale = 0.55 - 0.05 * you.depth()
+ elseif you.in_branch("dis") then
plant_mons = "plant name:metallic n_adj col:darkgrey tile:mons_withered_plant / nothing"
streams = false
tile("t = dngn_tree_dead")
@@ -59,7 +63,7 @@ TAGS: overwritable layout allow_dup unrand layout_type_forest
kmons("1 = " .. plant_mons)
local gxm,gym = dgn.max_bounds()
- extend_map { width = gxm, height = gym, fill = 'x' }
+ extend_map { width = gxm, height = gym, fill = fill }
-- Setup worley functions
local fwall = procedural.sub(1, procedural.border { padding = 5 },
@@ -93,7 +97,7 @@ TAGS: overwritable layout allow_dup unrand layout_type_forest
procedural.render_map(_G,fwall,function(v,x,y)
-- Rock wall
- if v < 0 then return 'x' end
+ if v < 0 then return fill end
if streams then
local sm = procedural.minmax_map(fstreams(x,y),0.05,0.1)
if sm < (1 - fjitter1(x,y)) then return 'W' end
@@ -107,11 +111,11 @@ TAGS: overwritable layout allow_dup unrand layout_type_forest
-- Decide the local feature
rand1 = rand1/255
-- Trees
- local outer_feature, inner_feature, plant_feature = tree_feature,'x','1'
+ local outer_feature, inner_feature, plant_feature = tree_feature,fill,'1'
-- Clearing (maybe rock center)
if rand1 > 0.95 then outer_feature,inner_feature,plant_feature = '.','.','.'
-- Rock
- elseif rand1 > 0.9 then outer_feature,plant_feature = 'x', crawl.coinflip() and 'W' or '.'
+ elseif rand1 > 0.9 then outer_feature,plant_feature = fill, crawl.coinflip() and 'W' or '.'
-- Pools
elseif rand1 > 0.8 then outer_feature,inner_feature,plant_feature = 'W','w',crawl.coinflip() and '1' or '.' end
@@ -135,7 +139,7 @@ TAGS: overwritable layout allow_dup unrand layout_type_forest
end)
- zonify.map_fill_zones(_G, 1, 'x')
+ zonify.map_fill_zones(_G, 1, fill)
if you.in_branch("crypt") then
tile("t = dngn_tree_dead")
diff --git a/crawl-ref/source/maps.cc b/crawl-ref/source/maps.cc
index 54f9f36a03..b0ffdfe892 100644
--- a/crawl-ref/source/maps.cc
+++ b/crawl-ref/source/maps.cc
@@ -375,6 +375,9 @@ static bool _may_overwrite_feature(const coord_def p,
if (grid == DNGN_DEEP_WATER)
return water_ok;
+ if (grid == DNGN_TREE && player_in_branch(BRANCH_FOREST))
+ return true;
+
// Handle all other non-LOS blocking grids here.
if (!feat_is_opaque(grid)
&& grid != DNGN_FLOOR