summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-info.cc
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2009-10-27 15:37:07 +0100
committerRobert Vollmert <rvollmert@gmx.net>2009-10-27 15:37:07 +0100
commitf8c9d635cd8985ca1cf3cd689d4c6e55e691369b (patch)
tree5efde05e1c0bf756877f2fcc83844134c01cd112 /crawl-ref/source/mon-info.cc
parenteda188d2d5045e9fb02c416261d72a3c31b9cf57 (diff)
downloadcrawl-ref-f8c9d635cd8985ca1cf3cd689d4c6e55e691369b.tar.gz
crawl-ref-f8c9d635cd8985ca1cf3cd689d4c6e55e691369b.zip
Add glyph and damage info to monster_info.
Diffstat (limited to 'crawl-ref/source/mon-info.cc')
-rw-r--r--crawl-ref/source/mon-info.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/crawl-ref/source/mon-info.cc b/crawl-ref/source/mon-info.cc
index 99677d1108..34c71b8a6d 100644
--- a/crawl-ref/source/mon-info.cc
+++ b/crawl-ref/source/mon-info.cc
@@ -1,3 +1,10 @@
+/*
+ * File: mon-info.cc
+ * Summary: Monster information that may be passed to the user.
+ *
+ * Used to fill the monster pane and to pass monster info to Lua.
+ */
+
#include "AppHdr.h"
#include "mon-info.h"
@@ -7,6 +14,7 @@
#include "mon-util.h"
#include "monster.h"
#include "religion.h"
+#include "view.h"
#include <sstream>
@@ -37,6 +45,13 @@ monster_info::monster_info(const monsters *m)
if (mons_looks_stabbable(m)) m_brands |= (1 << MB_STABBABLE);
if (mons_looks_distracted(m)) m_brands |= (1 << MB_DISTRACTED);
if (m->has_ench(ENCH_BERSERK)) m_brands |= (1 << MB_BERSERK);
+
+ get_mons_glyph(m_mon, &m_glyph, &m_glyph_colour);
+
+ mons_get_damage_level(m_mon, m_damage_desc, m_damage_level);
+ // If no messages about wounds, don't display damage level either.
+ if (monster_descriptor(m_mon->type, MDSC_NOMSG_WOUNDS))
+ m_damage_level = MDAM_OKAY;
}
// Needed because gcc 4.3 sort does not like comparison functions that take