diff options
author | José Ávila <linux@javila.net> | 2005-07-03 08:12:47 +0000 |
---|---|---|
committer | José Ávila <linux@javila.net> | 2005-07-03 08:12:47 +0000 |
commit | af08905182495e2f20622515b56be90d5ac53b14 (patch) | |
tree | 5b518c2f781268c96d57ee0bcb6c1cfbc763ae79 /src/being.cpp | |
parent | a3beebb0a5b900d70e44b96e4679621dc9fd95f5 (diff) | |
download | mana-af08905182495e2f20622515b56be90d5ac53b14.tar.gz mana-af08905182495e2f20622515b56be90d5ac53b14.tar.bz2 mana-af08905182495e2f20622515b56be90d5ac53b14.tar.xz mana-af08905182495e2f20622515b56be90d5ac53b14.zip |
Adding colors to hit points
Diffstat (limited to 'src/being.cpp')
-rw-r--r-- | src/being.cpp | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/being.cpp b/src/being.cpp index 88b2b9a0..ec12976d 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -27,6 +27,7 @@ #include "net/protocol.h" #include "net/network.h" #include "resources/resourcemanager.h" +#include "gui/gui.h" Being *player_node = NULL; @@ -71,9 +72,14 @@ void remove_node(unsigned int id) { if ((*i)->id == id) { - if (autoTarget == (*i)) { + if (autoTarget == (*i)) + { autoTarget = NULL; } + if (followBeing == (*i)) + { + followBeing = NULL; + } delete (*i); beings.erase(i); return; @@ -344,10 +350,27 @@ void Being::drawSpeech(Graphics *graphics) gcn::Graphics::CENTER); } if (showDamage) { + // Selecting the right color + if (damage == "miss") + { + graphics->setFont(hitYellowFont); + } + else if (isMonster()) + { + graphics->setFont(hitBlueFont); + } + else + { + graphics->setFont(hitRedFont); + } + graphics->drawText(damage, text_x + 60, text_y - 60 - get_elapsed_time(damage_time) / 100, gcn::Graphics::CENTER); + + // Backing to default font + graphics->setFont(gui->getFont()); } if (this == autoTarget) { graphics->drawText("[TARGET]", |