summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Sehmisch <tmw@crushnet.org>2007-10-26 12:50:49 +0000
committerPhilipp Sehmisch <tmw@crushnet.org>2007-10-26 12:50:49 +0000
commiteb0f92fe8d919d3c98fbc4294c582514454dab99 (patch)
tree04c3deac433700ad5838237ae02acda40633fe76
parent60e1a82ed7d92f462238bf1666a14e6774d34a30 (diff)
downloadmana-client-eb0f92fe8d919d3c98fbc4294c582514454dab99.tar.gz
mana-client-eb0f92fe8d919d3c98fbc4294c582514454dab99.tar.bz2
mana-client-eb0f92fe8d919d3c98fbc4294c582514454dab99.tar.xz
mana-client-eb0f92fe8d919d3c98fbc4294c582514454dab99.zip
Implemented monster hurt sounds and added new sound effects by Cosmostrator.
-rw-r--r--ChangeLog5
-rw-r--r--src/monster.cpp7
-rw-r--r--src/monster.h7
3 files changed, 19 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 3cc718ad..73db67ff 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,11 @@
for the chatlog (length set by the config option "ChatLogLength").
* src/chat.cpp, src/chat.h: Removed some completely useless code
from the chat class.
+ * src/monster.cpp, src/monster.h, data/sfx/logmonster-hurt1.ogg,
+ data/sfx/logmonster-hurt2.ogg, data/sfx/logmonster-hurt3.ogg,
+ data/sfx/logmonster-hurt4.ogg, data/sfx/logmonster-hurt5.ogg:
+ Implemented monster hurt sounds and added new sound effects by
+ Cosmostrator.
2007-10-24 Philipp Sehmisch <tmw@crushnet.org>
diff --git a/src/monster.cpp b/src/monster.cpp
index 00e58648..230c72ad 100644
--- a/src/monster.cpp
+++ b/src/monster.cpp
@@ -103,6 +103,13 @@ Monster::handleAttack(Being *victim, int damage)
sound.playSfx(mi.getSound((damage > 0) ? MONSTER_EVENT_HIT : MONSTER_EVENT_MISS));
}
+void
+Monster::takeDamage(int amount)
+{
+ if (amount > 0) sound.playSfx(getInfo().getSound(MONSTER_EVENT_HURT));
+ Being::takeDamage(amount);
+}
+
Being::TargetCursorSize
Monster::getTargetCursorSize() const
{
diff --git a/src/monster.h b/src/monster.h
index 4a24068f..39556b44 100644
--- a/src/monster.h
+++ b/src/monster.h
@@ -52,6 +52,13 @@ class Monster : public Being
virtual void handleAttack(Being *victim, int damage);
/**
+ * Puts a damage bubble above this monster and plays the hurt sound
+ *
+ * @param amount The amount of damage.
+ */
+ virtual void takeDamage(int amount);
+
+ /**
* Returns the MonsterInfo, with static data about this monster.
*/
const MonsterInfo&