Not sure I like the placement. Light background colors don't work for me, so I stuck with the standard 8.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4004 c06c8d41-db1a-0410-9941-cceddc491573
HT2Z5ZWY5G2QVHXCKFDQT62FRNGPRRD3HHJ2UULBWRTMAJICUDGAC
if (m_mon->has_ench(ENCH_BERSERK))
out << " (berserk)";
else if (mons_looks_stabbable(m_mon))
out << " (resting)";
else if (mons_looks_distracted(m_mon))
out << " (distracted)";
else if (m_mon->has_ench(ENCH_INVIS))
out << " (invisible)";
// Damage (maybe too distracting/verbose?)
if (count == 1)
std::string damage_desc;
mon_dam_level_type damage_level;
mons_get_damage_level(m_mon, damage_desc, damage_level);
if (damage_level != MDAM_OKAY)
out << " (" << damage_desc << ")";
if (m_mon->has_ench(ENCH_BERSERK))
out << " (berserk)";
else if (mons_looks_stabbable(m_mon))
out << " (resting)";
else if (mons_looks_distracted(m_mon))
out << " (distracted)";
else if (m_mon->has_ench(ENCH_INVIS))
out << " (invisible)";
unsigned int glyph;
unsigned short glyph_color;
get_mons_glyph(mon, &glyph, &glyph_color);
textcolor(glyph_color);
cprintf( stringize_glyph(glyph).c_str() );
// one glyph for each monster
for (unsigned int i_mon=start; i_mon<end; i_mon++)
{
unsigned int glyph;
unsigned short glyph_color;
get_mons_glyph(mons[i_mon].m_mon, &glyph, &glyph_color);
textcolor(glyph_color);
cprintf( stringize_glyph(glyph).c_str() );
++ printed;
}
textcolor(LIGHTGREY);
textcolor(LIGHTGREY);
cprintf(" - ");
int desc_color;
std::string desc;
minfo.to_string(count, desc, desc_color);
textcolor(desc_color);
if (count == 1)
{
// Print an "icon" representing damage level
std::string damage_desc;
mon_dam_level_type damage_level;
mons_get_damage_level(mons[start].m_mon, damage_desc, damage_level);
int dam_color;
switch (damage_level)
{
// NOTE: in os x, light versions of foreground colors are OK,
// but not background colors. So stick wth standards.
case MDAM_DEAD:
case MDAM_ALMOST_DEAD:
case MDAM_HORRIBLY_DAMAGED: dam_color = RED; break;
case MDAM_HEAVILY_DAMAGED: dam_color = MAGENTA; break;
case MDAM_MODERATELY_DAMAGED: dam_color = BROWN; break;
case MDAM_LIGHTLY_DAMAGED: dam_color = GREEN; break;
case MDAM_OKAY: dam_color = GREEN; break;
default: dam_color = CYAN; break;
}
cprintf(" ");
textbackground(dam_color);
textcolor(dam_color);
cprintf(" ");
textcolor(LIGHTGREY);
textbackground(BLACK);
cprintf(" ");
printed += 3;
}
else
{
textcolor(LIGHTGREY);
cprintf(" ");
printed += 2;
}
// "-4" because 4 chars have been printed already
desc.resize(crawl_view.mlistsz.x-4, ' ');
cprintf("%s", desc.c_str());
if (printed < crawl_view.mlistsz.x)
{
int desc_color;
std::string desc;
mons[start].to_string(count, desc, desc_color);
textcolor(desc_color);
desc.resize(crawl_view.mlistsz.x-printed, ' ');
cprintf("%s", desc.c_str());
}