summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spells3.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-07-01 22:12:11 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-07-01 22:12:11 +0000
commite1fa7f473b27c1f8d1a9f96bd6627ac839fd1818 (patch)
tree5dcc7aa6c2b072ec0ebd181c189998d45fc03dad /crawl-ref/source/spells3.cc
parentde3f47634db15c572abcdc67fb4856afdfa110a2 (diff)
downloadcrawl-ref-e1fa7f473b27c1f8d1a9f96bd6627ac839fd1818.tar.gz
crawl-ref-e1fa7f473b27c1f8d1a9f96bd6627ac839fd1818.zip
1736793: slightly better teleport messages.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1709 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spells3.cc')
-rw-r--r--crawl-ref/source/spells3.cc24
1 files changed, 17 insertions, 7 deletions
diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc
index 1e06306825..4504f277a6 100644
--- a/crawl-ref/source/spells3.cc
+++ b/crawl-ref/source/spells3.cc
@@ -681,17 +681,27 @@ static bool teleport_player( bool allow_control, bool new_abyss_area )
if (!is_controlled)
{
- mpr("Your surroundings suddenly seem different.");
+ int newx, newy;
do
{
- you.x_pos = 5 + random2( GXM - 10 );
- you.y_pos = 5 + random2( GYM - 10 );
+ newx = 5 + random2( GXM - 10 );
+ newy = 5 + random2( GYM - 10 );
}
- while ((grd[you.x_pos][you.y_pos] != DNGN_FLOOR
- && grd[you.x_pos][you.y_pos] != DNGN_SHALLOW_WATER)
- || mgrd[you.x_pos][you.y_pos] != NON_MONSTER
- || env.cgrid[you.x_pos][you.y_pos] != EMPTY_CLOUD);
+ while ((grd[newx][newy] != DNGN_FLOOR
+ && grd[newx][newy] != DNGN_SHALLOW_WATER)
+ || mgrd[newx][newy] != NON_MONSTER
+ || env.cgrid[newx][newy] != EMPTY_CLOUD);
+
+ if ( newx == you.x_pos && newy == you.y_pos )
+ mpr("Your surroundings flicker for a moment.");
+ else if ( see_grid(newx, newy) )
+ mpr("Your surroundings seem slightly different.");
+ else
+ mpr("Your surroundings suddenly seem different.");
+
+ you.x_pos = newx;
+ you.y_pos = newy;
// Necessary to update the view centre.
you.moveto(you.pos());