diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-19 13:18:57 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-19 13:18:57 +0000 |
commit | 2e844817bdd6d8b1fc73de9239dc6eb5b49404ea (patch) | |
tree | 99d831f2de0a96444edb4ec05c174b15052724da /crawl-ref/source/output.cc | |
parent | fada7cc9c6c230526a737d34e8f04cf22969b7f7 (diff) | |
download | crawl-ref-2e844817bdd6d8b1fc73de9239dc6eb5b49404ea.tar.gz crawl-ref-2e844817bdd6d8b1fc73de9239dc6eb5b49404ea.zip |
Extend the monster list merge handling to dancing weapons and mimics.
Player ghosts should never be merged (rare as that case may be), but I
can't test it because in wizard mode all ghosts are named "John Doe", so
they always automerge on account of having the same name.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5978 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/output.cc')
-rw-r--r-- | crawl-ref/source/output.cc | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc index 0b80630bbe..63f7a3dc41 100644 --- a/crawl-ref/source/output.cc +++ b/crawl-ref/source/output.cc @@ -1242,11 +1242,23 @@ monster_pane_info::less_than(const monster_pane_info& m1, else if (m1.m_difficulty < m2.m_difficulty) return (false); + // Force mimics of different types to be treated like the same one. + if (mons_is_mimic(m1.m_mon->type) + && mons_is_mimic(m2.m_mon->type)) + { + return (false); + } + if (m1.m_mon->type < m2.m_mon->type) return (true); else if (m1.m_mon->type > m2.m_mon->type) return (false); + // Never distinguish between dancing weapons. + // The above checks guarantee that *both* monsters are of this type. + if (m1.m_mon->type == MONS_DANCING_WEAPON) + return (false); + // Because of the type checks above, if one of the two is zombified, so is // the other, and of the same type. if (zombified && mons_is_zombified(m1.m_mon) @@ -1255,7 +1267,7 @@ monster_pane_info::less_than(const monster_pane_info& m1, return (true); } - if (m1.m_fullname && m2.m_fullname) + if (m1.m_fullname && m2.m_fullname || m1.m_mon->type == MONS_PLAYER_GHOST) return (m1.m_mon->name(DESC_PLAIN) < m1.m_mon->name(DESC_PLAIN)); #if 0 // for now, sort brands together. @@ -1276,14 +1288,18 @@ void monster_pane_info::to_string( int count, std::string& desc, if (count == 1) { - if (m_fullname) + if (m_fullname && !mons_is_mimic(m_mon->type)) out << m_mon->name(DESC_PLAIN); else out << mons_type_name(m_mon->type, DESC_PLAIN); } else { - if (m_fullname) + // Don't differentiate between dancing weapons or mimics + // of different types. + if (m_fullname + && m_mon->type != MONS_DANCING_WEAPON + && !mons_is_mimic(m_mon->type)) { out << count << " " << pluralise(m_mon->name(DESC_PLAIN)); |