diff options
author | Philipp Sehmisch <tmw@crushnet.org> | 2008-02-27 13:54:18 +0000 |
---|---|---|
committer | Philipp Sehmisch <tmw@crushnet.org> | 2008-02-27 13:54:18 +0000 |
commit | 7dff43c3cc3733c7222e3f036b76e896aa86d4e9 (patch) | |
tree | 1ab421a28db6b7969a53efbe8cc39429021309a6 /src/net/beinghandler.cpp | |
parent | 9355a8113d0a3e084d67aa181ead54715702ee98 (diff) | |
download | mana-7dff43c3cc3733c7222e3f036b76e896aa86d4e9.tar.gz mana-7dff43c3cc3733c7222e3f036b76e896aa86d4e9.tar.bz2 mana-7dff43c3cc3733c7222e3f036b76e896aa86d4e9.tar.xz mana-7dff43c3cc3733c7222e3f036b76e896aa86d4e9.zip |
Implemented provisorical player respawn.
Diffstat (limited to 'src/net/beinghandler.cpp')
-rw-r--r-- | src/net/beinghandler.cpp | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/src/net/beinghandler.cpp b/src/net/beinghandler.cpp index 38299b8d..28791975 100644 --- a/src/net/beinghandler.cpp +++ b/src/net/beinghandler.cpp @@ -37,6 +37,12 @@ #include "../particle.h" #include "../sound.h" +#include "../gui/ok_dialog.h" + +#include "../utils/gettext.h" + +#include "gameserver/player.h" + const int EMOTION_TIME = 150; /**< Duration of emotion icon */ BeingHandler::BeingHandler() @@ -592,9 +598,32 @@ void BeingHandler::handleBeingsDamageMessage(MessageIn &msg) void BeingHandler::handleBeingActionChangeMessage(MessageIn &msg) { Being* being = beingManager->findBeing(msg.readInt16()); + Being::Action action = (Being::Action) msg.readInt8(); if (!being) return; - being->setAction((Being::Action) msg.readInt8()); + being->setAction(action); + + if (action == Being::DEAD && being==player_node) + { + static char const *const deadMsg[] = + { + _("You are dead."), + _("We regret to inform you that your character was killed in battle."), + _("You are not that alive anymore."), + _("The cold hands of the grim reaper are grabbing for your soul."), + _("Game Over!"), + _("No, kids. Your character did not really die. It... err... went to a better place."), + _("Your plan of breaking your enemies weapon by bashing it with your throat failed."), + _("I guess this did not run too well."), + _("Do you want your possessions identified?"), // Nethack reference + _("Sadly, no trace of you was ever found..."), // Secret of Mana reference + + }; + std::string message(deadMsg[rand()%10]); + message.append(" Press OK to respawn"); + OkDialog *dlg = new OkDialog(_("You died"), message); + dlg->addActionListener(&(Net::GameServer::Player::respawnListener)); + } } void BeingHandler::handleBeingLooksChangeMessage(MessageIn &msg) |