diff options
author | Matthew Cline <zelgadis@sourceforge.net> | 2009-10-29 18:36:53 -0700 |
---|---|---|
committer | Matthew Cline <zelgadis@sourceforge.net> | 2009-10-29 18:36:53 -0700 |
commit | 2386094200a314bee252ca9cb6a229ee42953f5a (patch) | |
tree | 6b0e01aaa42532fb04b8fbb5d4dc128032f18e2c | |
parent | a7aeeaec768095f1feabe9474f0febf54feb1814 (diff) | |
download | crawl-ref-2386094200a314bee252ca9cb6a229ee42953f5a.tar.gz crawl-ref-2386094200a314bee252ca9cb6a229ee42953f5a.zip |
FR 2017276: '<' and '>' both work for portal/shop
Up and down ('<' and '>') now both work for entering shops and portals.
-rw-r--r-- | crawl-ref/source/acr.cc | 35 | ||||
-rw-r--r-- | crawl-ref/source/misc.cc | 29 |
2 files changed, 58 insertions, 6 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index 09b9232a7d..2b64b5c065 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -1221,6 +1221,13 @@ static void _go_upstairs() shop(); return; } + // Up and down both work for portals. + else if (get_feature_dchar(ygrd) == DCHAR_ARCH + && feat_stair_direction(ygrd) != CMD_NO_CMD + && ygrd != DNGN_ENTER_ZOT) + { + ; + } else if (feat_stair_direction(ygrd) != CMD_GO_UPSTAIRS) { if (ygrd == DNGN_STONE_ARCH) @@ -1248,8 +1255,10 @@ static void _go_downstairs() { ASSERT(!crawl_state.arena && !crawl_state.arena_suspended); + const dungeon_feature_type ygrd = grd(you.pos()); + const bool shaft = (get_trap_type(you.pos()) == TRAP_SHAFT - && grd(you.pos()) != DNGN_UNDISCOVERED_TRAP); + && ygrd != DNGN_UNDISCOVERED_TRAP); if (_stairs_check_mesmerised()) return; @@ -1260,11 +1269,29 @@ static void _go_downstairs() return; } - if (feat_stair_direction(grd(you.pos())) != CMD_GO_DOWNSTAIRS - && !shaft) + // Up and down both work for shops. + if (ygrd == DNGN_ENTER_SHOP) { - if (grd(you.pos()) == DNGN_STONE_ARCH) + if (you.duration[DUR_BERSERKER]) + canned_msg(MSG_TOO_BERSERK); + else + shop(); + return; + } + // Up and down both work for portals. + else if (get_feature_dchar(ygrd) == DCHAR_ARCH + && feat_stair_direction(ygrd) != CMD_NO_CMD + && ygrd != DNGN_ENTER_ZOT) + { + ; + } + else if (feat_stair_direction(ygrd) != CMD_GO_DOWNSTAIRS + && !shaft) + { + if (ygrd == DNGN_STONE_ARCH) mpr("There is nothing on the other side of the stone arch."); + else if (ygrd == DNGN_ABANDONED_SHOP) + mpr("This shop appears to be closed."); else mpr( "You can't go down here!" ); return; diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc index c70c8e5ec8..8df9415332 100644 --- a/crawl-ref/source/misc.cc +++ b/crawl-ref/source/misc.cc @@ -1731,14 +1731,23 @@ void up_stairs(dungeon_feature_type force_stair, const branch_type old_where = you.where_are_you; const level_area_type old_level_type = you.level_type; + // Up and down both work for shops. if (stair_find == DNGN_ENTER_SHOP) { shop(); return; } + // Up and down both work for portals. + if (get_feature_dchar(stair_find) == DCHAR_ARCH + && feat_stair_direction(stair_find) != CMD_NO_CMD + && stair_find != DNGN_ENTER_ZOT) + { + down_stairs(you.your_level, force_stair, entry_cause); + return; + } // Probably still need this check here (teleportation) -- bwr - if (feat_stair_direction(stair_find) != CMD_GO_UPSTAIRS) + else if (feat_stair_direction(stair_find) != CMD_GO_UPSTAIRS) { if (stair_find == DNGN_STONE_ARCH) mpr("There is nothing on the other side of the stone arch."); @@ -2063,11 +2072,27 @@ void down_stairs( int old_level, dungeon_feature_type force_stair, level_id shaft_dest; int shaft_level = -1; + // Up and down both work for shops. + if (stair_find == DNGN_ENTER_SHOP) + { + shop(); + return; + } + + // Up and down both work for portals. + if (get_feature_dchar(stair_find) == DCHAR_ARCH + && feat_stair_direction(stair_find) != CMD_NO_CMD + && stair_find != DNGN_ENTER_ZOT) + { + ; + } // Probably still need this check here (teleportation) -- bwr - if (feat_stair_direction(stair_find) != CMD_GO_DOWNSTAIRS && !shaft) + else if (feat_stair_direction(stair_find) != CMD_GO_DOWNSTAIRS && !shaft) { if (stair_find == DNGN_STONE_ARCH) mpr("There is nothing on the other side of the stone arch."); + else if (stair_find == DNGN_ABANDONED_SHOP) + mpr("This shop appears to be closed."); else mpr( "You can't go down here!" ); return; |