From e1fa7f473b27c1f8d1a9f96bd6627ac839fd1818 Mon Sep 17 00:00:00 2001 From: haranp Date: Sun, 1 Jul 2007 22:12:11 +0000 Subject: 1736793: slightly better teleport messages. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1709 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/spells3.cc | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'crawl-ref/source/spells3.cc') 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()); -- cgit v1.2.3-54-g00ecf