diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-12-30 16:03:40 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-12-30 16:03:40 +0000 |
commit | 65d21560291f113bca7f16dc6fc2bfc4929d7218 (patch) | |
tree | 0ba9c18de0cc0cbdf2fede11cb6d9ac79dfcfa45 /crawl-ref/source/monstuff.cc | |
parent | 55585681615a40eb8fb65adb1dc297bd6aaa5a71 (diff) | |
download | crawl-ref-65d21560291f113bca7f16dc6fc2bfc4929d7218.tar.gz crawl-ref-65d21560291f113bca7f16dc6fc2bfc4929d7218.zip |
Handle zombies and other monster modifiers correctly in notes.
When advising the user that greedy explore won't work, make sure they see the
message.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@745 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/monstuff.cc')
-rw-r--r-- | crawl-ref/source/monstuff.cc | 43 |
1 files changed, 16 insertions, 27 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index a5699afd4d..e43e33ec8e 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -699,23 +699,14 @@ void monster_die(struct monsters *monster, char killer, int i) if (killer != KILL_RESET && killer != KILL_DISMISSED) { - if ( MONST_INTERESTING(monster) || - // XXX yucky hack - monster->type == MONS_PLAYER_GHOST || - monster->type == MONS_PANDEMONIUM_DEMON ) { - /* make a note of it */ - char namebuf[ITEMNAME_SIZE]; - if ( monster->type == MONS_PLAYER_GHOST ) { - snprintf( namebuf, sizeof(namebuf), "the ghost of %s", - ghost.name ); - } - else if ( monster->type == MONS_PANDEMONIUM_DEMON ) { - strncpy( namebuf, ghost.name, sizeof(namebuf) ); - } - else - moname(monster->type, true, DESC_NOCAP_A, namebuf); - take_note(Note(NOTE_KILL_MONSTER, monster->type, 0, namebuf)); - } + if ( MONST_INTERESTING(monster) || + // XXX yucky hack + monster->type == MONS_PLAYER_GHOST || + monster->type == MONS_PANDEMONIUM_DEMON ) + { + take_note(Note(NOTE_KILL_MONSTER, monster->type, 0, + ptr_monam(monster, DESC_NOCAP_A))); + } you.kills.record_kill(monster, killer, pet_kill); @@ -997,12 +988,10 @@ bool monster_polymorph( struct monsters *monster, int targetc, int power ) // If old monster is visible to the player, and is interesting, // then note why the interesting monster went away. if (player_monster_visible(monster) && mons_near(monster) - && MONST_INTERESTING(monster)) { - - char namebuf[ITEMNAME_SIZE]; - moname(monster->type, true, DESC_NOCAP_A, namebuf); - take_note(Note(NOTE_POLY_MONSTER, monster->type, 0, namebuf)); - + && MONST_INTERESTING(monster)) + { + take_note(Note(NOTE_POLY_MONSTER, monster->type, 0, + ptr_monam(monster, DESC_NOCAP_A))); } // messaging: {dlb} @@ -5349,7 +5338,7 @@ static int map_wand_to_mspell(int wand_type) void seen_monster(struct monsters *monster) { if ( monster->flags & MF_SEEN ) - return; + return; // First time we've seen this particular monster monster->flags |= MF_SEEN; @@ -5358,9 +5347,9 @@ void seen_monster(struct monsters *monster) monster->type != MONS_PANDEMONIUM_DEMON && monster->type != MONS_PLAYER_GHOST ) { - char namebuf[ITEMNAME_SIZE]; - moname(monster->type, true, DESC_NOCAP_A, namebuf); - take_note(Note(NOTE_SEEN_MONSTER, monster->type, 0, namebuf)); + take_note( + Note(NOTE_SEEN_MONSTER, monster->type, 0, + ptr_monam(monster, DESC_NOCAP_A)) ); } } |