diff options
author | Adam Borowski <kilobyte@angband.pl> | 2013-11-03 13:01:25 +0100 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2013-11-03 13:01:25 +0100 |
commit | 7047b33b2768a838b2cea28f8738936c08f1d406 (patch) | |
tree | 27a0d4712509390031464a0d05d8eacdd53d2096 /crawl-ref/source/stairs.cc | |
parent | e06bfaaf8641758a91ec5978d28a55b4697be788 (diff) | |
download | crawl-ref-7047b33b2768a838b2cea28f8738936c08f1d406.tar.gz crawl-ref-7047b33b2768a838b2cea28f8738936c08f1d406.zip |
Shorten branch enums.
Seriously, even preparing this commit gave me a pain in the triangle between
the thumb and index finger's bases and the wrist.
Diffstat (limited to 'crawl-ref/source/stairs.cc')
-rw-r--r-- | crawl-ref/source/stairs.cc | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/crawl-ref/source/stairs.cc b/crawl-ref/source/stairs.cc index bc714b4f94..8693f30354 100644 --- a/crawl-ref/source/stairs.cc +++ b/crawl-ref/source/stairs.cc @@ -287,8 +287,8 @@ static void _update_travel_cache(const level_id& old_level, // to Hell as shortcuts between dungeon levels, which won't work, // and will confuse the dickens out of the player (well, it confused // the dickens out of me when it happened). - if (new_level_id == BRANCH_MAIN_DUNGEON - && old_level == BRANCH_VESTIBULE_OF_HELL) + if (new_level_id == BRANCH_DUNGEON + && old_level == BRANCH_VESTIBULE) { old_level_info.clear_stairs(DNGN_EXIT_HELL); } @@ -299,7 +299,7 @@ static void _update_travel_cache(const level_id& old_level, // and that we can descend that downstair and get back to where we // came from. This assumption is guaranteed false when climbing out // of one of the branches of Hell. - if (new_level_id != BRANCH_VESTIBULE_OF_HELL + if (new_level_id != BRANCH_VESTIBULE || !is_hell_subbranch(old_level.branch)) { // Set the new level's stair, assuming arbitrarily that going @@ -352,7 +352,7 @@ void up_stairs(dungeon_feature_type force_stair) return down_stairs(force_stair); } - if (player_in_branch(BRANCH_MAIN_DUNGEON) + if (player_in_branch(BRANCH_DUNGEON) && you.depth == RUNE_LOCK_DEPTH + 1 && (feat_is_stone_stair(stair_find) || feat_is_escape_hatch(stair_find))) { @@ -429,14 +429,14 @@ void up_stairs(dungeon_feature_type force_stair) _player_change_level_reset(); _player_change_level_upstairs(force_stair); - if (old_level.branch == BRANCH_VESTIBULE_OF_HELL - && !player_in_branch(BRANCH_VESTIBULE_OF_HELL)) + if (old_level.branch == BRANCH_VESTIBULE + && !player_in_branch(BRANCH_VESTIBULE)) { mpr("Thank you for visiting Hell. Please come again soon."); } // Fixup exits from the Hell branches. - if (player_in_branch(BRANCH_VESTIBULE_OF_HELL)) + if (player_in_branch(BRANCH_VESTIBULE)) { switch (old_level.branch) { @@ -462,7 +462,7 @@ void up_stairs(dungeon_feature_type force_stair) mprf("Welcome back to %s!", branches[you.where_are_you].longname); if ((brdepth[old_level.branch] > 1 - || old_level.branch == BRANCH_VESTIBULE_OF_HELL) + || old_level.branch == BRANCH_VESTIBULE) && !you.branches_left[old_level.branch]) { string old_branch_string = branches[old_level.branch].longname; @@ -562,7 +562,7 @@ level_id stair_destination(dungeon_feature_type feat, const string &dst, mpr("Error: no Hell exit level, how in the Vestibule did " "you get here? Let's go to D:1.", MSGCH_ERROR); } - return level_id(BRANCH_MAIN_DUNGEON, 1); + return level_id(BRANCH_DUNGEON, 1); } else die("hell exit without return destination"); @@ -599,12 +599,12 @@ level_id stair_destination(dungeon_feature_type feat, const string &dst, case DNGN_ENTER_HELL: if (for_real && !player_in_hell()) - brentry[BRANCH_VESTIBULE_OF_HELL] = level_id::current(); - return level_id(BRANCH_VESTIBULE_OF_HELL); + brentry[BRANCH_VESTIBULE] = level_id::current(); + return level_id(BRANCH_VESTIBULE); case DNGN_EXIT_ABYSS: if (you.char_direction == GDT_GAME_START) - return level_id(BRANCH_MAIN_DUNGEON, 1); + return level_id(BRANCH_DUNGEON, 1); case DNGN_EXIT_PORTAL_VAULT: case DNGN_EXIT_PANDEMONIUM: if (you.level_stack.empty()) @@ -616,7 +616,7 @@ level_id stair_destination(dungeon_feature_type feat, const string &dst, mpr("Error: no return path. You did create the exit manually, " "didn't you? Let's go to D:1.", MSGCH_ERROR); } - return level_id(BRANCH_MAIN_DUNGEON, 1); + return level_id(BRANCH_DUNGEON, 1); } die("no return path from a portal (%s)", level_id::current().describe().c_str()); @@ -691,7 +691,7 @@ void down_stairs(dungeon_feature_type force_stair) if (shaft) { - if (player_in_branch(BRANCH_MAIN_DUNGEON) + if (player_in_branch(BRANCH_DUNGEON) && you.depth == RUNE_LOCK_DEPTH) { mpr("If you take this shaft, you won't be able to return to this " @@ -742,7 +742,7 @@ void down_stairs(dungeon_feature_type force_stair) _maybe_destroy_trap(you.pos()); } - if (player_in_branch(BRANCH_MAIN_DUNGEON) + if (player_in_branch(BRANCH_DUNGEON) && you.depth == RUNE_LOCK_DEPTH && (feat_is_stone_stair(stair_find) || feat_is_escape_hatch(stair_find))) { |