Added piety levels and penance to the resists screen. (Penance is signified by a * before the god name, piety levels by *s after the god name.)
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@535 c06c8d41-db1a-0410-9941-cceddc491573
CJ6OSJQPAZOGWC56OYBALICSITGVUEQERE7LWIYJL2AXWRZE523AC
}
int piety_rank( int piety )
{
const int breakpoints[] = { 161, 120, 100, 75, 50, 30, 6 };
const int numbreakpoints = sizeof(breakpoints) / sizeof(int);
if ( piety < 0 )
piety = you.piety;
for ( int i = 0; i < numbreakpoints; ++i )
if ( piety >= breakpoints[i] )
return numbreakpoints - i;
return 0;
char god_colour_tag[20];
god_colour_tag[0] = 0;
std::string godpowers(god_name(you.religion));
if ( you.religion != GOD_NO_GOD )
{
if ( player_under_penance() )
strcpy(god_colour_tag, "<red>*");
else
{
snprintf(god_colour_tag, sizeof god_colour_tag, "<%s>",
colour_to_str(god_colour(you.religion)));
// piety rankings
int prank = piety_rank() - 1;
if ( prank < 0 )
prank = 0;
// Careful about overflow. We erase some of the god's name
// if necessary.
godpowers = godpowers.substr(0, 17 - prank) +
std::string(prank, '*');
}
}