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 | |
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')
-rw-r--r-- | crawl-ref/source/dat/database/monspeak.txt | 12 | ||||
-rw-r--r-- | crawl-ref/source/enum.h | 4 | ||||
-rw-r--r-- | crawl-ref/source/mon-stuff.cc | 44 | ||||
-rw-r--r-- | crawl-ref/source/view.cc | 9 |
4 files changed, 50 insertions, 19 deletions
diff --git a/crawl-ref/source/dat/database/monspeak.txt b/crawl-ref/source/dat/database/monspeak.txt index a60da963d8..78c0f659af 100644 --- a/crawl-ref/source/dat/database/monspeak.txt +++ b/crawl-ref/source/dat/database/monspeak.txt @@ -1732,6 +1732,10 @@ Dowan w:2 @_Dowan_rare_@ %%%% +fleeing Dowan + +VISUAL:@The_monster@ cries in horror. +%%%% _Dowan_common_ VISUAL:@The_monster@ smirks and points a slender finger @at_foe@. @@ -1773,6 +1777,10 @@ _Dowan_Duvessa_dies_invisible_ @The_monster@ screams, "No! No! NO!" %%%% +_Dowan_Duvessa_dies_distance_ + +You hear a distant wail of despair. +%%%% ############ DUANE ### A mercenary guarding the dungeon Duane @@ -1825,6 +1833,10 @@ _Duvessa_Dowan_dies_invisible_ @The_monster@ shouts wrathfully, "No!" %%%% +_Duvessa_Dowan_dies_distance_ + +You hear a distant scream of rage. +%%%% ############ EDMUND ### A mercenary guarding the dungeon Edmund diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h index aab7442d05..4f0684d1d4 100644 --- a/crawl-ref/source/enum.h +++ b/crawl-ref/source/enum.h @@ -2153,8 +2153,10 @@ enum monster_flag_type MF_SPELLCASTER = 0x200000, MF_ACTUAL_SPELLS = 0x400000, // Can use spells and is a spellcaster for // Trog purposes. - MF_PRIEST = 0x800000 // Is a priest (divine spells) + MF_PRIEST = 0x800000, // Is a priest (divine spells) // for the conduct. + + MF_GOING_BERSERK = 0x1000000 // Is about to go berserk! }; // Adding slots breaks saves. YHBW. 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()) diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc index 35efb6d0a2..8bcadd08fe 100644 --- a/crawl-ref/source/view.cc +++ b/crawl-ref/source/view.cc @@ -139,6 +139,15 @@ void monster_grid_updates() beogh_follower_convert(*mi); slime_convert(*mi); fedhas_neutralise(*mi); + + // XXX: Probably quite hackish. Allows for monsters going berserk when + // they see the player. Currently only used for Duvessa, see the + // function _elven_twin_dies in mon-stuff.cc. + if (mi->flags & MF_GOING_BERSERK) + { + mi->flags &= ~MF_GOING_BERSERK; + mi->go_berserk(true); + } } } |