diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2007-02-20 20:55:37 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2007-02-20 20:55:37 +0000 |
commit | e99b6aaeb119feabfa2f7c3c49908625981e9708 (patch) | |
tree | 00f599c90443be884b9b8b51618552c2f8834f2d /src/net/beinghandler.cpp | |
parent | eadbe0cb009b8c8fec622946f0b0109a2f07b1f1 (diff) | |
download | mana-e99b6aaeb119feabfa2f7c3c49908625981e9708.tar.gz mana-e99b6aaeb119feabfa2f7c3c49908625981e9708.tar.bz2 mana-e99b6aaeb119feabfa2f7c3c49908625981e9708.tar.xz mana-e99b6aaeb119feabfa2f7c3c49908625981e9708.zip |
Now different sounds can play when a monster misses the player.
Diffstat (limited to 'src/net/beinghandler.cpp')
-rw-r--r-- | src/net/beinghandler.cpp | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/src/net/beinghandler.cpp b/src/net/beinghandler.cpp index 46c44664..4734a710 100644 --- a/src/net/beinghandler.cpp +++ b/src/net/beinghandler.cpp @@ -187,35 +187,32 @@ void BeingHandler::handleMessage(MessageIn *msg) switch (type) { case 0: // Damage - if (dstBeing == NULL) break; - - dstBeing->setDamage(param1, SPEECH_TIME); - - if (srcBeing != NULL && - srcBeing != player_node) - { - srcBeing->setAction(Being::ATTACK); - srcBeing->mFrame = 0; - srcBeing->mWalkTime = tick_time; + if (dstBeing) { + dstBeing->takeDamage(param1); + } + if (srcBeing) { + srcBeing->handleAttack(dstBeing, param1); } break; case 2: // Sit - if (srcBeing == NULL) break; - srcBeing->mFrame = 0; - srcBeing->setAction(Being::SIT); + if (srcBeing) { + srcBeing->mFrame = 0; + srcBeing->setAction(Being::SIT); + } break; case 3: // Stand up - if (srcBeing == NULL) break; - srcBeing->mFrame = 0; - srcBeing->setAction(Being::STAND); + if (srcBeing) { + srcBeing->mFrame = 0; + srcBeing->setAction(Being::STAND); + } break; } break; case SMSG_BEING_LEVELUP: - if ((Uint32)msg->readInt32() == player_node->getId()) { + if ((Uint32) msg->readInt32() == player_node->getId()) { logger->log("Level up"); sound.playSfx("sfx/levelup.ogg"); } else { |