diff options
author | nagdon <m1nagdon@gmail.com> | 2014-04-06 17:57:23 +0200 |
---|---|---|
committer | Chris Campbell <chriscampbell89@gmail.com> | 2014-04-29 02:28:40 +0100 |
commit | 0c658ddcb893c9d94c298733e0727e03977eb1f8 (patch) | |
tree | a99cd83998fe6a2c3f3e7ab6486c653e9956faa1 /crawl-ref/source/view.cc | |
parent | 339348ec42342f6e49bd812f730b5b5fba4c39b7 (diff) | |
download | crawl-ref-0c658ddcb893c9d94c298733e0727e03977eb1f8.tar.gz crawl-ref-0c658ddcb893c9d94c298733e0727e03977eb1f8.zip |
Always announce uniques by name when they come into view.
This commit disallows bundling together uniques with other monsters
of the same genus. (So "A goblin, 11 orcs, an ogre, and Nergalle come into
view." is printed instead of "A goblin, 12 orcs and an ogre come into view.")
Suggested at https://crawl.develz.org/tavern/viewtopic.php?f=8&t=11664.
Diffstat (limited to 'crawl-ref/source/view.cc')
-rw-r--r-- | crawl-ref/source/view.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc index af397cf33c..981d94e0fe 100644 --- a/crawl-ref/source/view.cc +++ b/crawl-ref/source/view.cc @@ -191,6 +191,11 @@ static string _desc_mons_type_map(map<monster_type, int> types) return make_stringf("%s come into view.", message.c_str()); } +static monster_type _mons_genus_keep_uniques(monster_type mc) +{ + return mons_is_unique(mc) ? mc : mons_genus(mc); +} + /* * Monster list simplification * @@ -226,7 +231,7 @@ static void _genus_factoring(map<monster_type, int> &types, it = types.begin(); do { - if (mons_genus(it->first) != genus) + if (_mons_genus_keep_uniques(it->first) != genus) { ++it; continue; @@ -292,7 +297,7 @@ void update_monsters_in_view() { const monster_type type = monsters[i]->type; types[type]++; - genera[mons_genus(type)]++; + genera[_mons_genus_keep_uniques(type)]++; } if (size == 1) |