hp_warning is still there for the * * * LOW HITPOINT WARNING * * * message.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@543 c06c8d41-db1a-0410-9941-cceddc491573
YWYXUCZKGNIAWAUKUESIPFCAL5HZOKOEWHUEUW7X4DMAX2HG2FSAC
const int hp_warn = MAXIMUM( 25, Options.hp_warning );
const int hp_attent = MAXIMUM( 10, Options.hp_attention );
const int hp_percent = (you.hp * 100) / max_max_hp;
for ( unsigned int i = 0; i < Options.hp_colour.size(); ++i )
{
if ( i+1 == Options.hp_colour.size() ||
hp_percent > Options.hp_colour[i+1].first )
{
textcolor(Options.hp_colour[i].second);
break;
}
}
hp_colour.clear();
hp_colour.push_back(std::pair<int,int>(100, LIGHTGREY));
hp_colour.push_back(std::pair<int,int>(50, YELLOW));
hp_colour.push_back(std::pair<int,int>(25, RED));
mp_colour.clear();
mp_colour.push_back(std::pair<int, int>(100, LIGHTGREY));
mp_colour.push_back(std::pair<int, int>(50, YELLOW));
mp_colour.push_back(std::pair<int, int>(25, RED));
field.c_str() );
}
}
else if (key == "hp_attention")
{
hp_attention = atoi( field.c_str() );
if (hp_attention < 0 || hp_attention > 100)
{
hp_attention = 0;
fprintf( stderr, "Bad HP attention percentage -- %s\n",
else if (key == "hp_colour" || key == "hp_color")
{
hp_colour.clear();
std::vector<std::string> thesplit = split_string(",", field);
for ( unsigned i = 0; i < thesplit.size(); ++i )
{
std::vector<std::string> insplit = split_string(":", thesplit[i]);
int hp_percent = 100;
if ( insplit.size() == 0 || insplit.size() > 2 ||
(insplit.size() == 1 && i != 0) )
{
fprintf(stderr, "Bad hp_colour string: %s\n", field.c_str());
break;
}
if ( insplit.size() == 2 )
hp_percent = atoi(insplit[0].c_str());
int scolour = str_to_colour(insplit[(insplit.size()==1) ? 0 : 1]);
hp_colour.push_back(std::pair<int, int>(hp_percent, scolour));
}
}
else if (key == "mp_color" || key == "mp_colour")
{
mp_colour.clear();
std::vector<std::string> thesplit = split_string(",", field);
for ( unsigned i = 0; i < thesplit.size(); ++i )
{
std::vector<std::string> insplit = split_string(":", thesplit[i]);
int mp_percent = 100;
if ( insplit.size() == 0 || insplit.size() > 2 ||
(insplit.size() == 1 && i != 0) )
{
fprintf(stderr, "Bad mp_colour string: %s\n", field.c_str());
break;
}
if ( insplit.size() == 2 )
mp_percent = atoi(insplit[0].c_str());
int scolour = str_to_colour(insplit[(insplit.size()==1) ? 0 : 1]);
mp_colour.push_back(std::pair<int, int>(mp_percent, scolour));
}
}
hp_attention = 25
hp_attention gives a less alert warning than hp_warning (it appears in
yellow instead of red).
hp_colour = lightgrey, 50:yellow, 25:red
hp_colour colours your HP appropriately in the display. In the
default setting, your HP will appear in red if at less then 25%,
yellow if at less than 50%, and lightgrey otherwise.