summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/docs/crawl_options.txt14
-rw-r--r--crawl-ref/docs/level-design.txt49
-rw-r--r--crawl-ref/source/dat/float.des2
-rw-r--r--crawl-ref/source/dat/large.des2
-rw-r--r--crawl-ref/source/dat/levdes.vim4
-rw-r--r--crawl-ref/source/dat/mini.des2
-rw-r--r--crawl-ref/source/dat/orc.des21
-rw-r--r--crawl-ref/source/dungeon.cc15
8 files changed, 61 insertions, 48 deletions
diff --git a/crawl-ref/docs/crawl_options.txt b/crawl-ref/docs/crawl_options.txt
index c1164b0d59..45229ea857 100644
--- a/crawl-ref/docs/crawl_options.txt
+++ b/crawl-ref/docs/crawl_options.txt
@@ -544,17 +544,17 @@ symmetric_scroll = true
This option is not relevant if view_lock or center_on_scroll
are set.
-scroll_margin_x = 4
+scroll_margin_x = 2
How far from the left or right edges scrolling starts. By
- default, if the PC's circle of line-of-sight is closer than 4
- squares from the edge, the viewport scrolls. If set at zero,
- the viewport scrolls only when the LOS circle reaches the
- viewport edge.
+ default, if the PC's circle of line-of-sight is closer than
+ two squares from the edge, the viewport scrolls. If set at
+ zero, the viewport scrolls only when the LOS circle reaches
+ the viewport edge.
-scroll_margin_y = 4
+scroll_margin_y = 2
How far from the top or bottom edges scrolling starts.
-scroll_margin = 4
+scroll_margin = 2
An aliased option that sets both scroll_margin_x and
scroll_margin_y.
diff --git a/crawl-ref/docs/level-design.txt b/crawl-ref/docs/level-design.txt
index f73700e49b..b37006cb44 100644
--- a/crawl-ref/docs/level-design.txt
+++ b/crawl-ref/docs/level-design.txt
@@ -79,9 +79,9 @@ attributes.
* Random minivaults:
-Random minivaults are small maps that are placed onto a level that the dungeon
-builder has already constructed fully otherwise (the level may include other
-vaults).
+Random minivaults are small maps that are placed onto a level that the
+dungeon builder has already constructed fully otherwise (the level may
+include other vaults).
Minivaults are distinguished from normal vaults solely by the absence
of an ORIENT: declaration. Any map without a specified ORIENT: is a
@@ -342,7 +342,9 @@ PLACE: Used to specify certain special levels. Existing special levels are:
PLACE can be used with random vaults and minivaults for testing them.
-TAGS: generate_awake, no_item_gen, no_monster_gen, no_pool_fixup, orc_entry
+TAGS: generate_awake, no_item_gen, no_monster_gen, no_pool_fixup, orc_entry,
+ mini_float
+
Tags go an a TAGS: line and are space-separated. Valid tags are:
* "dummy": this tag indicates that the vault is a stub; if the dungeon
builder picks a dummy vault, it pretends no vault was
@@ -365,6 +367,10 @@ TAGS: generate_awake, no_item_gen, no_monster_gen, no_pool_fixup, orc_entry
ebranch.des. If a branch has very few entries, a dummy entry is
advisable to make sure the player doesn't get bored of the same
few entries recycled ad nauseam.
+ * "mini_float": applicable only to minivaults, requests that
+ the dungeon builder pick random exits from the minivault and
+ connect it to the rest of the level, similar to the exit
+ behaviour for floating vaults.
* "mnoleg" or the name of some other pandemonium lord. This makes
the map eligible for said pan lord's lair.
@@ -481,7 +487,7 @@ SUBST: ?=xc, !:bv, 1=2 1:100
NSUBST: ? = 3:w / *:l
NSUBST is similar to SUBST, replacing placeholders with
- replacements values. Unlike SUBST, however, it allows you to
+ replacement values. Unlike SUBST, however, it allows you to
replace different instances of the same placeholder with
completely different substitutions. For instance:
@@ -779,25 +785,22 @@ G. Hints for level makers
rooms with no exit (use at least > or < to make it possible for players
to get away).
- Minivaults should generally be completely surrounded by one-space of
- floor for accessibility. Minivaults are not handled like regular
- vaults in terms of entry-points: the entry-point glyph @ is ignored
- for minivaults. In general, at least one square of a minivault will
- be reachable from the rest of the level, but there is no way to
- predict which one. If your minivault is intended to be accessible,
- surround it with floor.
-
+ Minivaults can use explicit @ exits, or be completely surrounded by
+ one space of floor for accessibility. Alternatively, you can request
+ that the dungeon builder pick appropriate exits as it does for
+ floating vaults by using the "mini_float" tag.
+
The entry point '@' must be present for all vaults (except
- full-screen vaults and minivaults where it must not, and floating
- vaults where it is optional). All @ will be connected to floor space
- in the rest of the map (multiple @ close together may merge into the
- same exit corridor). Make sure that no part of your entry level can
- be cut off! If no @ is present in a floating vault (and there are no
- doors on the edge of the map, see below), the level builder will put
- one or more on a random floor space '.' at the circumference. Note
- that it is not possible to predict which floor spaces the level
- builder will choose to connect; if you need predictability, use
- explicit @ exits on the edge.
+ full-screen vaults where it must not, and floating vaults and
+ minivaults where it is optional). All @ will be connected to floor
+ space in the rest of the map (multiple @ close together may merge
+ into the same exit corridor). Make sure that no part of your entry
+ level can be cut off! If no @ is present in a floating vault (and
+ there are no doors on the edge of the map, see below), the level
+ builder will use one or more random floor spaces '.' or doors at the
+ circumference as exits. Note that it is not possible to predict
+ which spaces the level builder will choose to connect; if you need
+ predictability, use explicit @ exits on the edge.
The level-builder will also implicitly treat doors and secret doors
on the edge of a map as explicit exits (the same as using @) and
diff --git a/crawl-ref/source/dat/float.des b/crawl-ref/source/dat/float.des
index 6bf4a80172..ffb2fb5ce3 100644
--- a/crawl-ref/source/dat/float.des
+++ b/crawl-ref/source/dat/float.des
@@ -12,7 +12,7 @@
# Set the default depth for vaults. Be sure to adapt the DEPTH of particulary
# easy or tough vaults. Also, exlucde unthemely branches with !Lair etc.
-default-depth: 12-26
+default-depth: D:12-26
##############################################################################
# Dummy probability balancer vault for depths 1-11.
diff --git a/crawl-ref/source/dat/large.des b/crawl-ref/source/dat/large.des
index 96672304be..b6c5aa8a46 100644
--- a/crawl-ref/source/dat/large.des
+++ b/crawl-ref/source/dat/large.des
@@ -6,7 +6,7 @@
# vaults.des.
###############################################################################
-default-depth: 12-26
+default-depth: D:12-26
# be careful to adapt these numbers for new vaults (using DEPTH)
##############################################################################
diff --git a/crawl-ref/source/dat/levdes.vim b/crawl-ref/source/dat/levdes.vim
index b643c9ee6b..f2c2206f9f 100644
--- a/crawl-ref/source/dat/levdes.vim
+++ b/crawl-ref/source/dat/levdes.vim
@@ -51,8 +51,8 @@ syn region desNsubst start=/^NSUBST:\s*/ end=/$/ contains=desNsubstDec,desSubstA
syn region desShuffle start=/^SHUFFLE:\s*/ end=/$/ contains=desShuffleDec,desMapFrag keepend
-syn keyword desDeclarator NAME: ORIENT: DEPTH: PLACE: MONS: FLAGS: default-depth: TAGS: CHANCE: ITEM: KFEAT: KMONS: KITEM:
-syn keyword desOrientation encompass north south east west northeast northwest southeast southwest float no_hmirror no_vmirror no_rotate entry pan no_pool_fixup no_monster_gen generate_awake
+syn keyword desDeclarator NAME: ORIENT: DEPTH: PLACE: MONS: FLAGS: default-depth: TAGS: CHANCE: WEIGHT: ITEM: KFEAT: KMONS: KITEM:
+syn keyword desOrientation encompass north south east west northeast northwest southeast southwest float no_hmirror no_vmirror no_rotate entry pan no_pool_fixup no_monster_gen generate_awake mini_float no_item_gen
syn match desComment "^\s*#.*$"
diff --git a/crawl-ref/source/dat/mini.des b/crawl-ref/source/dat/mini.des
index 3b03d95108..9ecc0f5d1a 100644
--- a/crawl-ref/source/dat/mini.des
+++ b/crawl-ref/source/dat/mini.des
@@ -33,7 +33,7 @@
# Default depth for minivaults. If your minivault is suitable for one of the
# branches below, add it via DEPTH: Lair or similar.
-default-depth: 8-27, !Orc, !Lair, !Swamp, !Shoal
+default-depth: D:8-27
##############################################################################
# Minivault balancer
diff --git a/crawl-ref/source/dat/orc.des b/crawl-ref/source/dat/orc.des
index 85a289718f..843321f166 100644
--- a/crawl-ref/source/dat/orc.des
+++ b/crawl-ref/source/dat/orc.des
@@ -428,6 +428,7 @@ ENDMAP
###################################
# mage tower -- either orc with assistants, or ogre with guards
NAME: mines4_lemuel
+TAGS: mini_float no_rotate
SUBST: ? = +=
SUBST: d = $d
SUBST: I = IG
@@ -435,17 +436,15 @@ SHUFFLE: 112/334
MONS: orc sorcerer, orc/orc wizard, ogre-mage, ogre/nothing
ITEM: any book
MAP
-...............
-...xxxx?xxxx...
-..xx2.....2xx..
-.xx.2xxxxx2.xx.
-.x..xxd1dxx..x.
-.x.Ix$$G$$xI.x.
-.x..xx222xx..x.
-.xx.2xx?xx2.xx.
-..xx..2.2..xx..
-...xxxxxxxxx...
-...............
+ xxxx?xxxx
+ xx2.....2xx
+xx.2xxxxx2.xx
+x..xxd1dxx..x
+x.Ix$$G$$xI.x
+x..xx222xx..x
+xx.2xx?xx2.xx
+ xx..2.2..xx
+ xxxxxxxxx
ENDMAP
###################################
diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc
index cd0ae021a5..2106a55c36 100644
--- a/crawl-ref/source/dungeon.cc
+++ b/crawl-ref/source/dungeon.cc
@@ -161,6 +161,10 @@ static int box_room_doors( int bx1, int bx2, int by1, int by2, int new_doors);
static void city_level(int level_number);
static void diamond_rooms(int level_number);
+static void pick_float_exits(vault_placement &place,
+ std::vector<coord_def> &targets);
+static void connect_vault(const vault_placement &vp);
+
// ITEM & SHOP FUNCTIONS
static void place_shops(int level_number);
static object_class_type item_in_shop(unsigned char shop_type);
@@ -2687,9 +2691,10 @@ static bool build_minivaults(int level_number, int force_vault,
apply_place_masks(place);
// these two are throwaways:
- std::vector<coord_def> dummy;
int num_runes = 0;
+ std::vector<coord_def> &target_connections = place.exits;
+
// paint the minivault onto the grid
for (int vx = v1x; vx < v1x + place.width; vx++)
{
@@ -2701,11 +2706,17 @@ static bool build_minivaults(int level_number, int force_vault,
altar_count = vault_grid( place,
level_number, vx, vy, altar_count,
acq_item_class,
- feat, dummy,
+ feat, target_connections,
num_runes );
}
}
+ if (target_connections.empty() && place.map.has_tag("mini_float"))
+ pick_float_exits(place, target_connections);
+
+ if (!target_connections.empty())
+ connect_vault(place);
+
return (true);
} // end build_minivaults()