summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/output.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-07 05:29:18 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-07 05:29:18 +0000
commit324e57233fc4e5de5c43bdde2d7ee130b7f714e3 (patch)
tree177734c726a085a503e890848628980d8123f717 /crawl-ref/source/output.cc
parent3f366c0cc7dd7d8f7a2ebced592fcfa2d30b2da6 (diff)
downloadcrawl-ref-324e57233fc4e5de5c43bdde2d7ee130b7f714e3.tar.gz
crawl-ref-324e57233fc4e5de5c43bdde2d7ee130b7f714e3.zip
Implement [2557153]: Display HP boosted by Berserk or Divine Vigour in
light blue. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8948 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/output.cc')
-rw-r--r--crawl-ref/source/output.cc45
1 files changed, 37 insertions, 8 deletions
diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc
index acdda2a9ac..fbd37cd4c6 100644
--- a/crawl-ref/source/output.cc
+++ b/crawl-ref/source/output.cc
@@ -51,7 +51,7 @@ REVISION("$Rev$");
#include "view.h"
// Color for captions like 'Health:', 'Str:', etc.
-#define HUD_CAPTION_COLOR Options.status_caption_colour
+#define HUD_CAPTION_COLOUR Options.status_caption_colour
// Colour for values, which come after captions.
static const short HUD_VALUE_COLOUR = LIGHTGREY;
@@ -312,6 +312,13 @@ static void _print_stats_hp(int x, int y)
// Calculate colour
short hp_colour = HUD_VALUE_COLOUR;
+
+ const bool boosted = you.duration[DUR_DIVINE_VIGOUR]
+ || you.duration[DUR_BERSERKER];
+
+ if (boosted)
+ hp_colour = LIGHTBLUE;
+ else
{
const int hp_percent =
(you.hp * 100) / (max_max_hp ? max_max_hp : you.hp);
@@ -324,14 +331,17 @@ static void _print_stats_hp(int x, int y)
// 01234567890123456789
// Health: xxx/yyy (zzz)
cgotoxy(x, y, GOTO_STAT);
- textcolor(HUD_CAPTION_COLOR);
+ textcolor(HUD_CAPTION_COLOUR);
cprintf(max_max_hp != you.hp_max ? "HP: " : "Health: ");
textcolor(hp_colour);
cprintf( "%d", you.hp );
- textcolor(HUD_VALUE_COLOUR);
+ if (!boosted)
+ textcolor(HUD_VALUE_COLOUR);
cprintf( "/%d", you.hp_max );
if (max_max_hp != you.hp_max)
cprintf( " (%d)", max_max_hp );
+ if (boosted)
+ textcolor(HUD_VALUE_COLOUR);
int col = wherex() - crawl_view.hudp.x;
for (int i = 18-col; i > 0; i--)
@@ -954,7 +964,7 @@ void print_stats_level()
if (Options.show_gold_turns)
ypos++;
cgotoxy(19, ypos, GOTO_STAT);
- textcolor(HUD_CAPTION_COLOR);
+ textcolor(HUD_CAPTION_COLOUR);
cprintf("Place: ");
textcolor(HUD_VALUE_COLOUR);
@@ -1019,7 +1029,7 @@ void redraw_skill(const std::string &your_name, const std::string &class_name)
void draw_border(void)
{
- textcolor( HUD_CAPTION_COLOR );
+ textcolor(HUD_CAPTION_COLOUR);
clrscr();
redraw_skill( you.your_name, player_title() );
@@ -1866,12 +1876,31 @@ static std::vector<formatted_string> _get_overview_stats()
// 4 columns
column_composer cols1(4, 18, 28, 40);
+ const bool boosted = you.duration[DUR_DIVINE_VIGOUR]
+ || you.duration[DUR_BERSERKER];
+
if (!player_rotted())
- snprintf(buf, sizeof buf, "HP %3d/%d", you.hp, you.hp_max);
+ {
+ if (boosted)
+ {
+ snprintf(buf, sizeof buf, "HP <lightblue>%3d/%d</lightblue>",
+ you.hp, you.hp_max);
+ }
+ else
+ snprintf(buf, sizeof buf, "HP %3d/%d", you.hp, you.hp_max);
+ }
else
{
- snprintf(buf, sizeof buf, "HP %3d/%d (%d)",
- you.hp, you.hp_max, get_real_hp(true, true) );
+ if (boosted)
+ {
+ snprintf(buf, sizeof buf, "HP <lightblue>%3d/%d (%d)</lightblue>",
+ you.hp, you.hp_max, get_real_hp(true, true));
+ }
+ else
+ {
+ snprintf(buf, sizeof buf, "HP %3d/%d (%d)",
+ you.hp, you.hp_max, get_real_hp(true, true));
+ }
}
cols1.add_formatted(0, buf, false);