diff options
author | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-01-05 06:59:32 +0000 |
---|---|---|
committer | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-01-05 06:59:32 +0000 |
commit | cfc5e8cefc516db7e842518eb5afeff1b5aa46b5 (patch) | |
tree | e4364dcb162bc3c7bea69eacdb495d5f77bdb300 /crawl-ref/source/monstuff.cc | |
parent | dc942d2989c077985d1ba2ca9c87801ef58da35f (diff) | |
download | crawl-ref-cfc5e8cefc516db7e842518eb5afeff1b5aa46b5.tar.gz crawl-ref-cfc5e8cefc516db7e842518eb5afeff1b5aa46b5.zip |
Generalize the mechanism for Boris' death message, so that any monster can
potentially have a death message (or a message for when the monster is banished
or a summon runs out of time).
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8235 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/monstuff.cc')
-rw-r--r-- | crawl-ref/source/monstuff.cc | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index 6e4d895468..6be24e7ffe 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -996,6 +996,11 @@ void monster_die(monsters *monster, killer_type killer, if (invalid_monster(monster)) return; + // If a monster was banished to the abyss and then killed there, + // then it's death wasn't a banishment. + if (you.level_type == LEVEL_ABYSS) + monster->flags &= ~MF_BANISHED; + if (!silent && _monster_avoided_death(monster, killer, killer_index)) return; @@ -1012,7 +1017,9 @@ void monster_die(monsters *monster, killer_type killer, remove_auto_exclude(monster); int summon_type = 0; - const bool summoned = mons_is_summoned(monster, NULL, &summon_type); + int duration = 0; + const bool summoned = mons_is_summoned(monster, &duration, + &summon_type); const int monster_killed = monster_index(monster); const bool hard_reset = testbits(monster->flags, MF_HARD_RESET); const bool gives_xp = !summoned @@ -1574,17 +1581,18 @@ void monster_die(monsters *monster, killer_type killer, monster->foe = killer_index; } - if (monster->type == MONS_BORIS && monster->foe != MHITNOT && !in_transit) + + if (!silent && !wizard && see_grid(monster->pos())) { - // XXX: Actual blood curse effect for Boris? -- bwr + // Make sure that the monster looks dead. + if (monster->alive() && !in_transit && (!summoned || duration > 0)) + monster->hit_points = -1; + mons_speaks(monster); + } - // Provide the player with an ingame clue to Boris' return. -- bwr - std::string msg = getSpeakString("Boris return_speech"); - if (!msg.empty()) - { - msg = do_mon_str_replacements(msg, monster); - mpr(msg.c_str(), MSGCH_TALK); - } + if (monster->type == MONS_BORIS && !in_transit) + { + // XXX: Actual blood curse effect for Boris? -- bwr // Now that Boris is dead, he's a valid target for monster // creation again. -- bwr |