summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/output.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2006-12-03 08:49:53 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2006-12-03 08:49:53 +0000
commitf5b7f9f83ba80c0e512b886fca3821290a949f79 (patch)
treec9f0604369bcb6b7dcccf4d1edc394fd7f0b0af9 /crawl-ref/source/output.cc
parent00033a21e5e9bce12e82e37cbfccd78a58cd8b4e (diff)
downloadcrawl-ref-f5b7f9f83ba80c0e512b886fca3821290a949f79.tar.gz
crawl-ref-f5b7f9f83ba80c0e512b886fca3821290a949f79.zip
Added hp_colour and mp_colour per 1606160. Removed hp_attention.
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
Diffstat (limited to 'crawl-ref/source/output.cc')
-rw-r--r--crawl-ref/source/output.cc35
1 files changed, 26 insertions, 9 deletions
diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc
index d63d2f9344..d10f59bf13 100644
--- a/crawl-ref/source/output.cc
+++ b/crawl-ref/source/output.cc
@@ -65,16 +65,19 @@ void print_stats(void)
if (you.redraw_hit_points)
{
const int max_max_hp = you.hp_max + player_rotted();
- 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;
+ }
+ }
+
gotoxy(44, 3);
- if (you.hp <= (you.hp_max * hp_warn) / 100)
- textcolor(RED);
- else if (you.hp <= (you.hp_max * hp_attent) / 100)
- textcolor(YELLOW);
-
cprintf( "%d", you.hp );
textcolor(LIGHTGREY);
@@ -94,9 +97,23 @@ void print_stats(void)
if (you.redraw_magic_points)
{
+
+ const int mp_percent = (you.magic_points * 100) / you.max_magic_points;
+ for ( unsigned int i = 0; i < Options.mp_colour.size(); ++i )
+ {
+ if ( i+1 == Options.mp_colour.size() ||
+ mp_percent > Options.mp_colour[i+1].first )
+ {
+ textcolor(Options.mp_colour[i].second);
+ break;
+ }
+ }
gotoxy(47, 4);
- cprintf( "%d/%d", you.magic_points, you.max_magic_points );
+ cprintf( "%d", you.magic_points);
+
+ textcolor(LIGHTGREY);
+ cprintf("/%d", you.max_magic_points );
#ifdef UNIX
clear_to_end_of_line();