From 90f5308b717e6838fff3a50dcd9bf9318d24d2ca Mon Sep 17 00:00:00 2001 From: zelgadis Date: Sun, 18 Jan 2009 09:23:45 +0000 Subject: 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 --- crawl-ref/source/directn.cc | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'crawl-ref/source/directn.cc') 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()); -- cgit v1.2.3-54-g00ecf