diff options
author | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-01-19 06:56:02 +0000 |
---|---|---|
committer | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-01-19 06:56:02 +0000 |
commit | 42937236bdf2420d77231c81aef1f01beac65096 (patch) | |
tree | 6445e8623ec9811a2930709a9c8fe54ce558302a /crawl-ref/source | |
parent | 6f1468c6da508e733e8e535c459a563e48151532 (diff) | |
download | crawl-ref-42937236bdf2420d77231c81aef1f01beac65096.tar.gz crawl-ref-42937236bdf2420d77231c81aef1f01beac65096.zip |
Fix shouting and "comes into view" messages for submerged mermaids.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8574 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r-- | crawl-ref/source/view.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc index b01456286b..f0e3faf8ff 100644 --- a/crawl-ref/source/view.cc +++ b/crawl-ref/source/view.cc @@ -1076,7 +1076,11 @@ void handle_monster_shouts(monsters* monster, bool force) // Tries to find an entry for "name seen" or "name unseen", // and if no such entry exists then looks simply for "name". - if (you.can_see(monster)) + // We don't use "you.can_see(monster)" here since that would return + // false for submerged monsters, but submerged monsters will be forced + // to surface before they shout, thus removing that source of + // non-visibility. + if (mons_near(monster) && (!monster->invisible() || player_see_invis())) suffix = " seen"; else suffix = " unseen"; @@ -1131,7 +1135,6 @@ void handle_monster_shouts(monsters* monster, bool force) } else { - msg = do_mon_str_replacements(msg, monster, s_type); msg_channel_type channel = MSGCH_TALK; std::string param = ""; @@ -1166,6 +1169,7 @@ void handle_monster_shouts(monsters* monster, bool force) } } + msg = do_mon_str_replacements(msg, monster, s_type); msg::streams(channel) << msg << std::endl; } @@ -1221,7 +1225,7 @@ void monster_grid(bool do_updates) if (monster->alive() && mons_near(monster)) { - if (mons_player_visible(monster)) + if (player_monster_visible(monster)) _handle_seen_interrupt(monster); if (do_updates && (mons_is_sleeping(monster) |