summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/player.cc
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2009-10-22 19:13:56 +0200
committerRobert Vollmert <rvollmert@gmx.net>2009-10-22 22:37:09 +0200
commit1fdd4abbce290f4d656bf29ce65d70ab5025871d (patch)
treec258b3f9f522191f19f3c45315969905be4d9aa8 /crawl-ref/source/player.cc
parent8d4d79655dd503417920299808993cef658bdde0 (diff)
downloadcrawl-ref-1fdd4abbce290f4d656bf29ce65d70ab5025871d.tar.gz
crawl-ref-1fdd4abbce290f4d656bf29ce65d70ab5025871d.zip
Get rid of player_monster_visible.
The special casing for drowning monsters appears to have been obsoloted by checking ENCH_SUBMERGED instead of calling mons_is_submerged.
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r--crawl-ref/source/player.cc26
1 files changed, 1 insertions, 25 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index e98289b351..35ee075333 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -2702,30 +2702,6 @@ int player_shield_class(void) //jmf: changes for new spell
return (base_shield);
}
-// This does NOT do line of sight! It checks the monster's visibility
-// with respect to the players perception, but doesn't do walls or
-// range. To find if the square the monster is in LOS, see mons_near().
-bool player_monster_visible(const monsters *mon)
-{
- if (!you.can_see_invisible() && mon->invisible())
- return (false);
-
- if (!mons_is_submerged(mon))
- return (true);
-
- const dungeon_feature_type feat = grd(mon->pos());
-
- // Treat monsters who are submerged due to drowning as visible, so
- // we get proper messages when they die. Monsters can only drown in
- // lava or deep water, so monsters that are "submerged" in other
- // features (air elementals in air, trapdoor spiders in the floor)
- // are exempt from this check.
- if (feat != DNGN_LAVA && feat != DNGN_DEEP_WATER)
- return (false);
-
- return (mon->can_drown());
-}
-
// Returns true if player is mesmerised by a given monster.
bool player_mesmerised_by(const monsters *mon)
{
@@ -7173,7 +7149,7 @@ int player::hurt(const actor *agent, int amount, beam_type flavour,
{
const monsters *mon = dynamic_cast<const monsters*>(agent);
ouch(amount, mon->mindex(),
- KILLED_BY_MONSTER, "", player_monster_visible(mon));
+ KILLED_BY_MONSTER, "", mon->visible_to(&you));
}
else
{