diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-07-11 10:58:19 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-07-11 10:58:19 +0000 |
commit | 6b55f9401479d75015f5e930a528f43632a5ffe5 (patch) | |
tree | 0d24743a26261f13cf5ddfd4823f350c7b67e1d7 /crawl-ref/source/dungeon.cc | |
parent | 83e8ab596d26e449cb8749a4f91abb4ed417d031 (diff) | |
download | crawl-ref-6b55f9401479d75015f5e930a528f43632a5ffe5.tar.gz crawl-ref-6b55f9401479d75015f5e930a528f43632a5ffe5.zip |
Allow full-level (encompass) vaults to be placed outside the main dungeon.
Fixed a bug where secondary vaults and minivaults could overwrite special rooms.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1834 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/dungeon.cc')
-rw-r--r-- | crawl-ref/source/dungeon.cc | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc index 07c41b7274..b27f935d11 100644 --- a/crawl-ref/source/dungeon.cc +++ b/crawl-ref/source/dungeon.cc @@ -190,8 +190,9 @@ static void jelly_pit(int level_number, spec_room &sr); // VAULT FUNCTIONS static bool build_secondary_vault(int level_number, int vault, int rune_subst = -1); -static bool build_vaults(int level_number, int vault_number, int rune_subst = -1, - bool build_only = false); +static bool build_vaults(int level_number, int vault_number, + int rune_subst = -1, bool build_only = false, + bool check_vault_place = false); static bool build_minivaults(int level_number, int force_vault, coord_def where = coord_def() ); static int vault_grid( vault_placement &, @@ -1383,11 +1384,21 @@ 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) && use_random_maps && one_chance_in(vault_chance)) { vault = random_map_in_depth(level_id::current()); + + // We'll accept any kind of primary vault in the main dungeon, + // but only ORIENT: encompass primary vaults in other + // branches. Other kinds of vaults can still be placed in + // other branches as secondary vaults. + // + if (vault != -1 && !player_in_branch(BRANCH_MAIN_DUNGEON) + && map_by_index(vault)->orient != MAP_ENCOMPASS) + { + vault = -1; + } } if (vault != -1) @@ -1709,7 +1720,12 @@ static void place_extra_vaults() && vault_chance && one_chance_in(vault_chance)) { - const int vault = random_map_in_depth(level_id::current()); + int vault = random_map_in_depth(level_id::current()); + + // ORIENT: encompass maps are unsuitable as secondary vaults. + if (vault != -1 && map_by_index(vault)->orient == MAP_ENCOMPASS) + vault = -1; + if (vault != -1 && build_secondary_vault(you.your_level, vault, -1)) vault_chance = 0; } @@ -3194,7 +3210,7 @@ static void connect_vault(const vault_placement &vp) */ static bool build_secondary_vault(int level_number, int vault, int rune_subst) { - if (build_vaults(level_number, vault, rune_subst, true)) + if (build_vaults(level_number, vault, rune_subst, true, true)) { const vault_placement &vp = level_vaults[ level_vaults.size() - 1 ]; connect_vault(vp); @@ -3205,7 +3221,7 @@ static bool build_secondary_vault(int level_number, int vault, int rune_subst) } static bool build_vaults(int level_number, int force_vault, int rune_subst, - bool build_only) + bool build_only, bool check_collisions) { int altar_count = 0; FixedVector < char, 10 > stair_exist; @@ -3229,7 +3245,7 @@ static bool build_vaults(int level_number, int force_vault, int rune_subst, vault_placement place; std::vector<coord_def> &target_connections = place.exits; - const int gluggy = vault_main(vgrid, place, force_vault, &level_vaults); + const int gluggy = vault_main(vgrid, place, force_vault, check_collisions); if (gluggy == MAP_NONE || !gluggy) return (false); @@ -3275,7 +3291,7 @@ static bool build_vaults(int level_number, int force_vault, int rune_subst, #endif // If the map takes the whole screen or we were only requested to - // build, our work is done. + // build the vault, our work is done. if (gluggy == MAP_ENCOMPASS || build_only) return (true); |