diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-07-23 12:03:41 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-07-23 12:03:41 +0000 |
commit | d3e93c074746027e209a67a247c7a0be78c5f40e (patch) | |
tree | fdcb4fc3520eaebe070455e4a30c67e1cabfe777 /crawl-ref/source/acr.cc | |
parent | 25178bf21218cca469f1b05c0634c8e0c2bc2a41 (diff) | |
download | crawl-ref-d3e93c074746027e209a67a247c7a0be78c5f40e.tar.gz crawl-ref-d3e93c074746027e209a67a247c7a0be78c5f40e.zip |
Backport r10380, and also backport flavour messages for entering Zot.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.5@10381 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/acr.cc')
-rw-r--r-- | crawl-ref/source/acr.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index 61cc957ebf..9318b863ee 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -3666,6 +3666,30 @@ static void _move_player(coord_def move) // When confused, sometimes make a random move if (you.confused()) { + dungeon_feature_type dangerous = DNGN_FLOOR; + for (adjacent_iterator ai(you.pos(), false); ai; ++ai) + { + if (is_grid_dangerous(grd(*ai)) + && (dangerous == DNGN_FLOOR || grd(*ai) == DNGN_LAVA)) + { + dangerous = grd(*ai); + } + } + if (dangerous != DNGN_FLOOR) + { + std::string prompt = "Are you sure you want to move while confused " + "and next to "; + prompt += (dangerous == DNGN_LAVA ? "lava" + : "deep water"); + prompt += "? "; + + if (!yesno(prompt.c_str(), false, 'n')) + { + canned_msg(MSG_OK); + return; + } + } + if (!one_chance_in(3)) { move.x = random2(3) - 1; |