summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/monstuff.cc
diff options
context:
space:
mode:
authorJude Brown <bookofjude@users.sourceforge.net>2009-11-11 10:02:28 +1000
committerJude Brown <bookofjude@users.sourceforge.net>2009-11-11 10:07:31 +1000
commit9550aee5ca1674be4860bd1c44685f3084862099 (patch)
treee68580219aa5e0b7603d198ccb887fab3a73962b /crawl-ref/source/monstuff.cc
parent03c7a3c5ea8b33d6af5a0d4c58a98a331732f981 (diff)
downloadcrawl-ref-9550aee5ca1674be4860bd1c44685f3084862099.tar.gz
crawl-ref-9550aee5ca1674be4860bd1c44685f3084862099.zip
Tweak Dowan/Duvessa death effects + invisibility (jpeg).
Should now work even if one (the one being killed) or the other (the living twin) or bother are invisible. Add a new subset of flavour message to cope with this ("It weeps, then rights herself and shakes her weapon" doesn't work with invisible). Still needs to be tweaked, as Dowan will flee/Duvessa will go berserk if one of them is stabbed. Also, flavour messages may need to be adjusted to take into consideration trap deaths.
Diffstat (limited to 'crawl-ref/source/monstuff.cc')
-rw-r--r--crawl-ref/source/monstuff.cc23
1 files changed, 14 insertions, 9 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index 82788f6b40..201d374041 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -1225,28 +1225,33 @@ static void _elven_twin_died(monsters* twin)
}
}
- if ((found_duvessa || found_dowan) && monster->observable())
+ if ((found_duvessa || found_dowan) && mons_near(monster))
{
// Will generate strings such as 'Duvessa_Duvessa_dies' or, alternately
// 'Dowan_Dowan_dies', but as neither will match, these can safely be
// ignored.
- std::string death_message = getSpeakString("_"
- + monster->name(DESC_CAP_THE, true) + "_"
- + twin->name(DESC_CAP_THE) + "_dies_");
+ std::string key = "_" + monster->name(DESC_CAP_THE, true) + "_"
+ + twin->name(DESC_CAP_THE) + "_dies_";
+
+ if (!monster->observable())
+ key += "invisible_";
+
+ std::string death_message = getSpeakString(key);
if (!death_message.empty())
mons_speaks_msg(monster, death_message, MSGCH_TALK, silenced(you.pos()));
}
- if (found_duvessa && monster->observable())
+ if (found_duvessa && mons_near(monster))
{
// Provides its own flavour message.
monster->go_berserk(true);
}
- else if (found_dowan && monster->observable())
+ else if (found_dowan && mons_near(monster))
{
- // Doesn't provide any message, so needs one.
- simple_monster_message(monster, " turns to flee.");
+ // Doesn't provide any message, so needs one, but only if visible.
+ if (monster->observable())
+ simple_monster_message(monster, " turns to flee.");
monster->add_ench(mon_enchant(ENCH_FEAR, 0, KC_YOU));
behaviour_event(monster, ME_SCARE, MHITNOT);
}
@@ -2093,7 +2098,7 @@ int monster_die(monsters *monster, killer_type killer,
}
}
else if ((monster->type == MONS_DOWAN || monster->type == MONS_DUVESSA)
- && monster->observable())
+ && mons_near(monster))
{
_elven_twin_died(monster);
}