summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/player.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-03-25 19:36:08 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-03-25 19:36:08 +0000
commitf080c133494f6430dd9078c438c90f9939e01b85 (patch)
treebf17e8c9e9de7034400abb76c00c1adf2fffd838 /crawl-ref/source/player.cc
parentc1e8bba8affbfe9bfd20eebb1fdc6c9c858b9c0a (diff)
downloadcrawl-ref-f080c133494f6430dd9078c438c90f9939e01b85.tar.gz
crawl-ref-f080c133494f6430dd9078c438c90f9939e01b85.zip
Fixed tile compile. (I was being a bit overzealous in my cleanup.)
Fix 1922815: blood potion assert. Implement 1828037: prompt before entering harmful clouds And tidy up fountain handling, dried non-magic fountains may now also start flowing again. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3878 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r--crawl-ref/source/player.cc29
1 files changed, 25 insertions, 4 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index 3a4d4b7da4..80057f0d37 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -123,6 +123,28 @@ bool move_player_to_grid( int x, int y, bool stepped, bool allow_shift,
ASSERT( mgrd[x][y] == NON_MONSTER
|| mons_is_submerged( &menv[ mgrd[x][y] ] ));
+ const int cloud = env.cgrid[x][y];
+ if (cloud != EMPTY_CLOUD)
+ {
+ const cloud_type ctype = env.cloud[ cloud ].type;
+ // don't prompt if already in a cloud of the same type
+ if (is_damaging_cloud(ctype, false)
+ && (env.cgrid[you.x_pos][you.y_pos] == EMPTY_CLOUD
+ || ctype != env.cloud[ env.cgrid[you.x_pos][you.y_pos] ].type))
+ {
+ std::string prompt = make_stringf(
+ "Really step into that cloud of %s?",
+ cloud_name(ctype).c_str());
+
+ if (!yesno(prompt.c_str(), false, 'n'))
+ {
+ canned_msg(MSG_OK);
+ you.turn_is_over = false;
+ return (false);
+ }
+ }
+ }
+
// if we're walking along, give a chance to avoid trap
if (stepped && !force && !you.confused())
{
@@ -161,17 +183,16 @@ bool move_player_to_grid( int x, int y, bool stepped, bool allow_shift,
const trap_type type = trap_type_at_xy(x,y);
if (type == TRAP_ZOT)
{
- if (! yes_or_no("Do you really want to step into the %s",
- "Zot trap"))
+ if (!yes_or_no("Do you really want to step into the Zot trap"))
{
canned_msg(MSG_OK);
you.turn_is_over = false;
return (false);
}
}
- else if (type == TRAP_SHAFT && you.airborne())
+ else if (new_grid != DNGN_TRAP_MAGICAL && you.airborne())
{
- // No prompt
+ // No prompt (shaft and mechanical traps ineffective, if flying)
}
else
#ifdef CLUA_BINDINGS