summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-08-21 23:20:57 +0300
committerAndrei Karas <akaras@inbox.ru>2011-08-22 01:02:56 +0300
commit6dd62fd1082bad225e02312094332630b0debd07 (patch)
tree439b2b15eaee8c4a1edf229172d94e355cb544e0 /src
parenta19ff6d060d0be8a7cb25bde5c7ad9f0b8027231 (diff)
downloadmanaplus-6dd62fd1082bad225e02312094332630b0debd07.tar.gz
manaplus-6dd62fd1082bad225e02312094332630b0debd07.tar.bz2
manaplus-6dd62fd1082bad225e02312094332630b0debd07.tar.xz
manaplus-6dd62fd1082bad225e02312094332630b0debd07.zip
Show dead hp bar if monster have current damage more than counted
maximum value.
Diffstat (limited to 'src')
-rw-r--r--src/being.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/being.cpp b/src/being.cpp
index d3181c32a..cc88d8f6e 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -2039,14 +2039,28 @@ void Being::drawHpBar(Graphics *graphics, int maxHP, int hp, int damage,
int dx = static_cast<int>(static_cast<float>(width) / p);
+ if (!damage || (!hp && maxHP == damage))
+ {
+ graphics->setColor(userPalette->getColorWithAlpha(color1));
+
+ graphics->fillRectangle(gcn::Rectangle(
+ x, y, dx, height));
+ return;
+ }
+ else if (width - dx <= 0)
+ {
+ graphics->setColor(userPalette->getColorWithAlpha(color2));
+
+ graphics->fillRectangle(gcn::Rectangle(
+ x, y, width, height));
+ return;
+ }
+
graphics->setColor(userPalette->getColorWithAlpha(color1));
graphics->fillRectangle(gcn::Rectangle(
x, y, dx, height));
- if (width - dx <= 0)
- return;
-
graphics->setColor(userPalette->getColorWithAlpha(color2));
graphics->fillRectangle(gcn::Rectangle(