diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-07-10 22:17:23 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-07-10 23:13:13 +0300 |
commit | 68f5e88eb44ed76facaa7e56cd7641b762f7ca60 (patch) | |
tree | 3df1918042695308e806f09d00093f7b435e7e9d /src/net/ea/playerhandler.cpp | |
parent | 82de3bbe7580f65bf808c4fd48706fa9e0512a65 (diff) | |
download | manaverse-68f5e88eb44ed76facaa7e56cd7641b762f7ca60.tar.gz manaverse-68f5e88eb44ed76facaa7e56cd7641b762f7ca60.tar.bz2 manaverse-68f5e88eb44ed76facaa7e56cd7641b762f7ca60.tar.xz manaverse-68f5e88eb44ed76facaa7e56cd7641b762f7ca60.zip |
dehardcode death messages.
add deadmessages.xml for death messages.
Diffstat (limited to 'src/net/ea/playerhandler.cpp')
-rw-r--r-- | src/net/ea/playerhandler.cpp | 84 |
1 files changed, 3 insertions, 81 deletions
diff --git a/src/net/ea/playerhandler.cpp b/src/net/ea/playerhandler.cpp index 446766b56..2d477ad4a 100644 --- a/src/net/ea/playerhandler.cpp +++ b/src/net/ea/playerhandler.cpp @@ -35,6 +35,8 @@ #include "gui/statuswindow.h" #include "gui/viewport.h" +#include "resources/deaddb.h" + #include "net/npchandler.h" #include "net/ea/eaprotocol.h" @@ -86,86 +88,6 @@ namespace } // anonymous namespace -static const char *randomDeathMessage() -{ - static const char *const deadMsg[] = - { - // TRANSLATORS: death message - N_("You are dead."), - // TRANSLATORS: death message - N_("We regret to inform you that your character was killed in " - "battle."), - // TRANSLATORS: death message - N_("You are not that alive anymore."), - // TRANSLATORS: death message - N_("The cold hands of the grim reaper are grabbing for your soul."), - // TRANSLATORS: death message - N_("Game Over!"), - // TRANSLATORS: death message - N_("Insert coin to continue."), - // TRANSLATORS: death message - N_("No, kids. Your character did not really die. It... " - "err... went to a better place."), - // TRANSLATORS: death message - N_("Your plan of breaking your enemies weapon by " - "bashing it with your throat failed."), - // TRANSLATORS: death message - N_("I guess this did not run too well."), - // NetHack reference: - // TRANSLATORS: death message - N_("Do you want your possessions identified?"), - // Secret of Mana reference: - // TRANSLATORS: death message - N_("Sadly, no trace of you was ever found..."), - // Final Fantasy VI reference: - // TRANSLATORS: death message - N_("Annihilated."), - // Earthbound reference: - // TRANSLATORS: death message - N_("Looks like you got your head handed to you."), - // Leisure Suit Larry 1 reference: - // TRANSLATORS: death message - N_("You screwed up again, dump your body down the tubes " - "and get you another one."), - // Monty Python references (Dead Parrot sketch mostly): - // TRANSLATORS: death message - N_("You're not dead yet. You're just resting."), - // TRANSLATORS: death message - N_("You are no more."), - // TRANSLATORS: death message - N_("You have ceased to be."), - // TRANSLATORS: death message - N_("You've expired and gone to meet your maker."), - // TRANSLATORS: death message - N_("You're a stiff."), - // TRANSLATORS: death message - N_("Bereft of life, you rest in peace."), - // TRANSLATORS: death message - N_("If you weren't so animated, you'd be pushing up the daisies."), - // TRANSLATORS: death message - N_("Your metabolic processes are now history."), - // TRANSLATORS: death message - N_("You're off the twig."), - // TRANSLATORS: death message - N_("You've kicked the bucket."), - // TRANSLATORS: death message - N_("You've shuffled off your mortal coil, run down the " - "curtain and joined the bleedin' choir invisibile."), - // TRANSLATORS: death message - N_("You are an ex-player."), - // TRANSLATORS: death message - N_("You're pining for the fjords.") - }; - - const int sz = sizeof(deadMsg); - if (!sz) - return gettext(deadMsg[0]); - - const int random = static_cast<int>(rand() % (sz - / sizeof(deadMsg[0]))); - return gettext(deadMsg[random]); -} - namespace Ea { @@ -468,7 +390,7 @@ void PlayerHandler::processPlayerStatUpdate1(Net::MessageIn &msg) const { // TRANSLATORS: message header deathNotice = new OkDialog(_("Message"), - randomDeathMessage(), DIALOG_OK, false); + DeadDB::getRandomString(), DIALOG_OK, false); deathNotice->addActionListener(&deathListener); if (player_node->getCurrentAction() != Being::DEAD) { |