summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/directn.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-18 09:23:45 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-18 09:23:45 +0000
commit90f5308b717e6838fff3a50dcd9bf9318d24d2ca (patch)
tree8028b759663d7018ca047b618ad4e79dd7e8891a /crawl-ref/source/directn.cc
parentf01756531daafbf0767b7b94e89250350f794676 (diff)
downloadcrawl-ref-90f5308b717e6838fff3a50dcd9bf9318d24d2ca.tar.gz
crawl-ref-90f5308b717e6838fff3a50dcd9bf9318d24d2ca.zip
During arena mode, don't describe a monster as "It's doesn't appear to have
noticed you." If a monster has an invisible foe that isn't the player, describe it as watching the foe rather than watching the player. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8540 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/directn.cc')
-rw-r--r--crawl-ref/source/directn.cc24
1 files changed, 17 insertions, 7 deletions
diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc
index aca1f2094a..5260c6f4bd 100644
--- a/crawl-ref/source/directn.cc
+++ b/crawl-ref/source/directn.cc
@@ -2891,7 +2891,7 @@ static void _describe_monster(const monsters *mon)
}
// hostile with target != you
else if (!mons_friendly(mon) && !mons_neutral(mon)
- && mon->foe != MHITYOU)
+ && mon->foe != MHITYOU && !crawl_state.arena_suspended)
{
// special case: batty monsters get set to BEH_WANDER as
// part of their special behaviour.
@@ -2926,20 +2926,30 @@ static void _describe_monster(const monsters *mon)
&& !mons_is_confused(mon)
&& (mons_see_invis(mon) || mons_sense_invis(mon)))
{
- if (you.invisible() && mon->foe == MHITYOU && !mons_is_fleeing(mon))
+ const actor* foe = mon->get_foe();
+ if (foe && foe->invisible() && !mons_is_fleeing(mon))
{
- if (mons_see_invis(mon))
+ if (!you.can_see(foe))
{
- mprf(MSGCH_EXAMINE, "%s is watching you carefully.",
+ mprf(MSGCH_EXAMINE, "%s is looking at something unseen.",
mon->pronoun(PRONOUN_CAP).c_str());
}
+ else if (mons_see_invis(mon))
+ {
+ mprf(MSGCH_EXAMINE, "%s is watching %s carefully.",
+ mon->pronoun(PRONOUN_CAP).c_str(),
+ foe->name(DESC_NOCAP_THE).c_str());
+ }
else
{
- mprf(MSGCH_EXAMINE, "%s is looking in your general direction.",
- mon->pronoun(PRONOUN_CAP).c_str());
+ std::string name = foe->atype() == ACT_PLAYER
+ ? "your" : (foe->name(DESC_NOCAP_THE) + "'s");
+ mprf(MSGCH_EXAMINE, "%s is looking in %s general direction.",
+ mon->pronoun(PRONOUN_CAP).c_str(),
+ name.c_str());
}
}
- else if (mon->foe == MHITNOT || mons_is_fleeing(mon))
+ else if (!foe || mons_is_fleeing(mon))
{
mprf(MSGCH_EXAMINE, "%s seems to be peering into the shadows.",
mon->pronoun(PRONOUN_CAP).c_str());