summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/dungeon.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-07-09 11:08:36 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-07-09 11:08:36 +0000
commit240d458d718fcae5faaffb6d49ee0da27b585465 (patch)
tree205bfd43fcf2eea3abf79e4ceb8f04599b1147ab /crawl-ref/source/dungeon.cc
parent2517b1cf2451cab3e9466a8b85623ccbafc48fdb (diff)
downloadcrawl-ref-240d458d718fcae5faaffb6d49ee0da27b585465.tar.gz
crawl-ref-240d458d718fcae5faaffb6d49ee0da27b585465.zip
More debug stats for maps.
level_range was segfaulting when compared against Abyss and Pan level_ids, fixed. Fixed level_id operator < (). Enabled use of vaults in non-Dungeon areas (Lair specific vaults were unused). These vaults are placed as extras, and are subject to the same constraints as branch entry vaults (the smaller the vault, the better the chance of being placed). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1811 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/dungeon.cc')
-rw-r--r--crawl-ref/source/dungeon.cc21
1 files changed, 19 insertions, 2 deletions
diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc
index 7611428cb5..e385b628e4 100644
--- a/crawl-ref/source/dungeon.cc
+++ b/crawl-ref/source/dungeon.cc
@@ -116,6 +116,7 @@ static void place_specific_stair(dungeon_feature_type stair,
const std::string &tag = "",
int dl = 0);
static void place_branch_entrances(int dlevel, char level_type);
+static void place_extra_vaults();
static void place_special_minivaults(int level_number, int level_type);
static void place_traps( int level_number );
static void prepare_swamp();
@@ -205,6 +206,7 @@ typedef std::list<coord_def> coord_list;
// Places where monsters should not be randomly generated.
map_mask dgn_map_mask;
static dgn_region_list vault_zones;
+static int vault_chance = 9;
static std::vector<vault_placement> level_vaults;
static int minivault_chance = 3;
static bool dgn_level_vetoed = false;
@@ -284,6 +286,8 @@ static bool ensure_vault_placed(bool vault_success)
{
if (!vault_success)
dgn_level_vetoed = true;
+ else
+ vault_chance = 0;
return (vault_success);
}
@@ -541,6 +545,7 @@ static void build_dungeon_level(int level_number, int level_type)
prepare_shoals( level_number );
place_branch_entrances( level_number, level_type );
+ place_extra_vaults();
if (dgn_level_vetoed)
return;
@@ -1229,9 +1234,11 @@ static builder_rc_type builder_normal(int level_number, char level_type,
// Can't have vaults on you.where_are_you != BRANCH_MAIN_DUNGEON levels
if (vault == -1
- && player_in_branch( BRANCH_MAIN_DUNGEON )
- && one_chance_in(9))
+ && player_in_branch(BRANCH_MAIN_DUNGEON)
+ && one_chance_in(vault_chance))
+ {
vault = random_map_in_depth(level_id::current());
+ }
if (vault != -1)
{
@@ -1545,6 +1552,16 @@ static void place_specific_stair(dungeon_feature_type stair,
place_specific_feature(stair);
}
+static void place_extra_vaults()
+{
+ if (!player_in_branch(BRANCH_MAIN_DUNGEON) && one_chance_in(vault_chance))
+ {
+ const int vault = random_map_in_depth(level_id::current());
+ if (vault != -1 && build_secondary_vault(you.your_level, vault, -1))
+ vault_chance = 0;
+ }
+}
+
static void place_branch_entrances(int dlevel, char level_type)
{
int sx, sy;