summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-11-27 05:58:14 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-11-27 05:58:14 +0000
commita740ffefc31bc85152d302d00c01d9414346e37d (patch)
treeb0e1cde602e7c04e313a61c9b2aabf96be00538e /crawl-ref/source
parent158387451269b0a382b98c7a9ec508e3f9e33514 (diff)
downloadcrawl-ref-a740ffefc31bc85152d302d00c01d9414346e37d.tar.gz
crawl-ref-a740ffefc31bc85152d302d00c01d9414346e37d.zip
Can now use wizard command &D to go down levels in a ziggurat.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7648 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/debug.cc38
1 files changed, 38 insertions, 0 deletions
diff --git a/crawl-ref/source/debug.cc b/crawl-ref/source/debug.cc
index 3128721ba4..c898c5929d 100644
--- a/crawl-ref/source/debug.cc
+++ b/crawl-ref/source/debug.cc
@@ -684,8 +684,46 @@ void wizard_place_stairs( bool down )
#endif
#ifdef WIZARD
+// Try to find and use stairs already in the portal vault level,
+// since this might be a multi-level portal vault like a ziggurat.
+bool _take_portal_vault_stairs( const bool down )
+{
+ ASSERT(you.level_type == LEVEL_PORTAL_VAULT);
+
+ const command_type cmd = down ? CMD_GO_DOWNSTAIRS : CMD_GO_UPSTAIRS;
+
+ coord_def stair_pos(-1, -1);
+
+ for (int x = 0; x < GXM; x++)
+ for (int y = 0; y < GYM; y++)
+ {
+ if (grid_stair_direction(grd[x][y]) == cmd)
+ {
+ stair_pos.set(x, y);
+ break;
+ }
+ }
+
+ if (!in_bounds(stair_pos))
+ return (false);
+
+ you.position = stair_pos;
+ if (down)
+ down_stairs(you.your_level);
+ else
+ up_stairs();
+
+ return (true);
+}
+#endif
+
+#ifdef WIZARD
void wizard_level_travel( bool down )
{
+ if (you.level_type == LEVEL_PORTAL_VAULT)
+ if (_take_portal_vault_stairs(down))
+ return;
+
dungeon_feature_type stairs = _find_appropriate_stairs(down);
if (stairs == DNGN_UNSEEN)