diff options
author | Adam Borowski <kilobyte@angband.pl> | 2011-11-13 18:24:24 +0100 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2011-11-13 18:24:24 +0100 |
commit | 3db7517c15650a730e554a0822ea6d490453785b (patch) | |
tree | 508245ab2afd8aba3ff89629b15bc28a97c7003c /crawl-ref/source/dgn-overview.cc | |
parent | 578eceffa83a98942bb9ab62ba1b433e9de61a9c (diff) | |
download | crawl-ref-3db7517c15650a730e554a0822ea6d490453785b.tar.gz crawl-ref-3db7517c15650a730e554a0822ea6d490453785b.zip |
Special-case unique annotation for the Lernaean hydra to avoid # of heads.
It caused multiple annotations, one for every number of heads it had.
Diffstat (limited to 'crawl-ref/source/dgn-overview.cc')
-rw-r--r-- | crawl-ref/source/dgn-overview.cc | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/crawl-ref/source/dgn-overview.cc b/crawl-ref/source/dgn-overview.cc index b9e546c513..b6849e51c9 100644 --- a/crawl-ref/source/dgn-overview.cc +++ b/crawl-ref/source/dgn-overview.cc @@ -876,6 +876,16 @@ static void _update_unique_annotation(level_id level) set_level_unique_annotation(note, level); } +static std::string unique_name(monster* mons) +{ + std::string name = mons->name(DESC_PLAIN, true); + if (mons->type == MONS_LERNAEAN_HYDRA) + name = "Lernaean hydra"; + if (mons->type == MONS_PLAYER_GHOST) + name += ", " + short_ghost_description(mons, true); + return name; +} + void set_unique_annotation(monster* mons, const level_id level) { // Abyss persists its denizens. @@ -885,20 +895,15 @@ void set_unique_annotation(monster* mons, const level_id level) return; remove_unique_annotation(mons); - std::string name = mons->name(DESC_PLAIN, true); - if (mons->type == MONS_PLAYER_GHOST) - name += ", " + short_ghost_description(mons, true); auto_unique_annotations.insert(std::make_pair( - name, level)); + unique_name(mons), level)); _update_unique_annotation(level); } void remove_unique_annotation(monster* mons) { std::set<level_id> affected_levels; - std::string name = mons->name(DESC_PLAIN, true); - if (mons->type == MONS_PLAYER_GHOST) - name += ", " + short_ghost_description(mons, true); + std::string name = unique_name(mons); for (std::set<monster_annotation>::iterator i = auto_unique_annotations.begin(); i != auto_unique_annotations.end();) { |