diff options
author | Robert Vollmert <rvollmert@gmx.net> | 2009-10-27 15:37:07 +0100 |
---|---|---|
committer | Robert Vollmert <rvollmert@gmx.net> | 2009-10-27 15:37:07 +0100 |
commit | f8c9d635cd8985ca1cf3cd689d4c6e55e691369b (patch) | |
tree | 5efde05e1c0bf756877f2fcc83844134c01cd112 /crawl-ref/source | |
parent | eda188d2d5045e9fb02c416261d72a3c31b9cf57 (diff) | |
download | crawl-ref-f8c9d635cd8985ca1cf3cd689d4c6e55e691369b.tar.gz crawl-ref-f8c9d635cd8985ca1cf3cd689d4c6e55e691369b.zip |
Add glyph and damage info to monster_info.
Diffstat (limited to 'crawl-ref/source')
-rw-r--r-- | crawl-ref/source/mon-info.cc | 15 | ||||
-rw-r--r-- | crawl-ref/source/mon-info.h | 6 |
2 files changed, 21 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 diff --git a/crawl-ref/source/mon-info.h b/crawl-ref/source/mon-info.h index 92ef03b482..c5d559d4e9 100644 --- a/crawl-ref/source/mon-info.h +++ b/crawl-ref/source/mon-info.h @@ -1,6 +1,8 @@ #ifndef MON_INFO_H #define MON_INFO_H +#include "monstuff.h" + // Monster info used by the pane; precomputes some data // to help with sorting and rendering. class monster_info @@ -21,6 +23,10 @@ class monster_info int m_difficulty; int m_brands; bool m_fullname; + unsigned int m_glyph; + unsigned short m_glyph_colour; + std::string m_damage_desc; + mon_dam_level_type m_damage_level; }; void get_monster_info(std::vector<monster_info>& mons); |