summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/acr.cc
diff options
context:
space:
mode:
authorMatthew Cline <zelgadis@sourceforge.net>2009-10-29 18:36:53 -0700
committerMatthew Cline <zelgadis@sourceforge.net>2009-10-29 18:36:53 -0700
commit2386094200a314bee252ca9cb6a229ee42953f5a (patch)
tree6b0e01aaa42532fb04b8fbb5d4dc128032f18e2c /crawl-ref/source/acr.cc
parenta7aeeaec768095f1feabe9474f0febf54feb1814 (diff)
downloadcrawl-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.
Diffstat (limited to 'crawl-ref/source/acr.cc')
-rw-r--r--crawl-ref/source/acr.cc35
1 files changed, 31 insertions, 4 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;