diff options
author | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-29 09:32:50 +0000 |
---|---|---|
committer | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-29 09:32:50 +0000 |
commit | 45afdf8ec9515a1510b08acdde4e5f65b9c30262 (patch) | |
tree | 80c02d5fa3ddb14b7a3cc96a9edd8bc498e85891 /crawl-ref/source/monstuff.cc | |
parent | 7b0f7be346d60592245021c01c877748b0ac51dc (diff) | |
download | crawl-ref-45afdf8ec9515a1510b08acdde4e5f65b9c30262.tar.gz crawl-ref-45afdf8ec9515a1510b08acdde4e5f65b9c30262.zip |
Don't behold and and un-behold the player in the same instant if a mermaid
is behind a transparent wall, but instead give a message about being unable
to hear the mermaid.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6215 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/monstuff.cc')
-rw-r--r-- | crawl-ref/source/monstuff.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index ffb6f30b3e..de3cc7d7b5 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -4289,7 +4289,17 @@ static bool _handle_special_ability(monsters *monster, bolt & beem) if (one_chance_in(5) || monster->foe == MHITYOU && !already_beheld && coinflip()) { - if (player_monster_visible(monster)) + int walls = num_feats_between(you.x_pos, you.y_pos, + monster->x, monster->y, DNGN_UNSEEN, + DNGN_MAXWALL); + + if (walls > 0) + { + simple_monster_message(monster, " appears to sing, but you " + "can't hear her."); + break; + } + else if (player_monster_visible(monster)) { simple_monster_message(monster, make_stringf(" chants %s song.", |