diff options
author | Jude Brown <bookofjude@users.sourceforge.net> | 2009-11-12 22:08:45 +1000 |
---|---|---|
committer | Jude Brown <bookofjude@users.sourceforge.net> | 2009-11-12 22:11:20 +1000 |
commit | eae49c6fcb7586e447e4b2fe2a7f2eb5b6bb7a2e (patch) | |
tree | 8a9ca92bcf32762acccf8a43f9454006aa9ea18a /crawl-ref/source/mon-stuff.cc | |
parent | 078019644214628520c8116a9b4a16f30d8fadf2 (diff) | |
download | crawl-ref-eae49c6fcb7586e447e4b2fe2a7f2eb5b6bb7a2e.tar.gz crawl-ref-eae49c6fcb7586e447e4b2fe2a7f2eb5b6bb7a2e.zip |
Further tweaks to Dowan/Duvessa death effects.
New MF_GOING_BERSERK flag: monsters with this flag will go berserk the
next turn after they see you.
Remove sight limitations from Dowan/Duvessa death effects. Flavour
messages will now always occur, as will Dowan's fear effect, even if you
cannot see him.
Duvessa's berserk effect is only triggered if you are in her line of
sight upon Dowan's death. If you are not, she's given the
MF_GOING_BERSERK flag, and will go berserk when she next sees you.
Reasoning is that they have some magical ability to sense the other's
death.
Diffstat (limited to 'crawl-ref/source/mon-stuff.cc')
-rw-r--r-- | crawl-ref/source/mon-stuff.cc | 44 |
1 files changed, 26 insertions, 18 deletions
diff --git a/crawl-ref/source/mon-stuff.cc b/crawl-ref/source/mon-stuff.cc index d337cd45ab..2a5d903ebc 100644 --- a/crawl-ref/source/mon-stuff.cc +++ b/crawl-ref/source/mon-stuff.cc @@ -1224,7 +1224,7 @@ static void _elven_twin_died(monsters* twin) found_duvessa = true; break; } - else if (monster->type == MONS_DOWAN) + else if (mi->type == MONS_DOWAN) { monster = *mi; found_dowan = true; @@ -1232,29 +1232,37 @@ static void _elven_twin_died(monsters* twin) } } - 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 key = "_" + monster->name(DESC_CAP_THE, true) + "_" - + twin->name(DESC_CAP_THE) + "_dies_"; + if (!found_duvessa && !found_dowan) + return; - if (!monster->observable()) - key += "invisible_"; + // 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 key = "_" + monster->name(DESC_CAP_THE, true) + "_" + + twin->name(DESC_CAP_THE) + "_dies_"; - std::string death_message = getSpeakString(key); + if (mons_near(monster) && !monster->observable()) + key += "invisible_"; + else + key += "distance_"; - if (!death_message.empty()) - mons_speaks_msg(monster, death_message, MSGCH_TALK, silenced(you.pos())); - } + std::string death_message = getSpeakString(key); - if (found_duvessa && mons_near(monster)) + if (mons_near(monster) && !death_message.empty()) + mons_speaks_msg(monster, death_message, MSGCH_TALK, silenced(you.pos())); + else + mprf("%s", death_message.c_str()); + + if (found_duvessa) { - // Provides its own flavour message. - monster->go_berserk(true); + if (mons_near(monster)) + // Provides its own flavour message. + monster->go_berserk(true); + else + // She'll go berserk the next time she sees you + monster->flags |= MF_GOING_BERSERK; } - else if (found_dowan && mons_near(monster)) + else if (found_dowan) { // Doesn't provide any message, so needs one, but only if visible. if (monster->observable()) |