summaryrefslogtreecommitdiff
path: root/src/being.cpp
diff options
context:
space:
mode:
authorAaron Marks <nymacro@gmail.com>2005-04-08 10:21:13 +0000
committerAaron Marks <nymacro@gmail.com>2005-04-08 10:21:13 +0000
commit722538cb38196237c0d503e8c07b3408c17989bc (patch)
tree851430d69fc7d7926adc7bfc3e94723999795609 /src/being.cpp
parent7c2c4d75a1f459b46c08883c282af0afb61fceb9 (diff)
downloadmana-client-722538cb38196237c0d503e8c07b3408c17989bc.tar.gz
mana-client-722538cb38196237c0d503e8c07b3408c17989bc.tar.bz2
mana-client-722538cb38196237c0d503e8c07b3408c17989bc.tar.xz
mana-client-722538cb38196237c0d503e8c07b3408c17989bc.zip
Created damage text seperate from speech & made it scroll.
Diffstat (limited to 'src/being.cpp')
-rw-r--r--src/being.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/being.cpp b/src/being.cpp
index 1f8cbd40..fd369a42 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -123,7 +123,8 @@ Being::Being():
emotion(0), emotion_time(0),
text_x(0), text_y(0),
hair_style(1), hair_color(1),
- weapon(0)
+ weapon(0),
+ damage(""), damage_time(0), damage_y(0.0)
{
}
@@ -158,6 +159,12 @@ void Being::setSpeech(const std::string &text, int time)
speech_time = time;
}
+void Being::setDamage(const std::string &text, int time)
+{
+ damage = text;
+ damage_time = time;
+}
+
void Being::nextStep()
{
if (!path.empty())
@@ -214,6 +221,13 @@ void Being::drawSpeech(Graphics *graphics)
gcn::Graphics::CENTER);
//}
}
+ if (damage_time > 0.0) {
+ graphics->drawText(damage,
+ text_x + 60, text_y - 60 - (int)damage_y,
+ gcn::Graphics::CENTER);
+ damage_y += 0.5;
+ } else
+ damage_y = 0;
}
void Being::tick()
@@ -221,4 +235,7 @@ void Being::tick()
if (speech_time > 0) {
speech_time--;
}
+ if (damage_time > 0) {
+ damage_time--;
+ }
}