summaryrefslogtreecommitdiff
path: root/src/localplayer.cpp
diff options
context:
space:
mode:
authorPhilipp Sehmisch <tmw@crushnet.org>2008-02-22 15:58:41 +0000
committerPhilipp Sehmisch <tmw@crushnet.org>2008-02-22 15:58:41 +0000
commit49eb5c5779885e6b7580c0e8459609fb228c3ec8 (patch)
tree7ceef20e0f4e5d6797a15d4f9437ae6acec85ade /src/localplayer.cpp
parent3f0b0c1216f5e7a8947ff84f028c5c68e872636d (diff)
downloadmana-client-49eb5c5779885e6b7580c0e8459609fb228c3ec8.tar.gz
mana-client-49eb5c5779885e6b7580c0e8459609fb228c3ec8.tar.bz2
mana-client-49eb5c5779885e6b7580c0e8459609fb228c3ec8.tar.xz
mana-client-49eb5c5779885e6b7580c0e8459609fb228c3ec8.zip
Implemented skill name display in skill dialog and xp messages (based on a patch by rodge)
Diffstat (limited to 'src/localplayer.cpp')
-rw-r--r--src/localplayer.cpp32
1 files changed, 31 insertions, 1 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index 085c80c5..5a6457a4 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -380,12 +380,42 @@ void LocalPlayer::lowerAttribute(size_t attr)
Net::GameServer::Player::lowerAttribute(attr + CHAR_ATTR_BEGIN);
}
+const std::string& LocalPlayer::getSkillName(int skill)
+{
+ static const std::string skills[CHAR_SKILL_NB + 1] =
+ { "Unarmed", // CHAR_SKILL_WEAPON_NONE
+ "Knife", // CHAR_SKILL_WEAPON_KNIFE
+ "Sword", // CHAR_SKILL_WEAPON_SWORD
+ "Polearm", // CHAR_SKILL_WEAPON_POLEARM
+ "Staff", // CHAR_SKILL_WEAPON_STAFF
+ "Whip", // CHAR_SKILL_WEAPON_WHIP
+ "Bow", // CHAR_SKILL_WEAPON_BOW
+ "Shooting", // CHAR_SKILL_WEAPON_SHOOTING
+ "Mace", // CHAR_SKILL_WEAPON_MACE
+ "Axe", // CHAR_SKILL_WEAPON_AXE
+ "Thrown", // CHAR_SKILL_WEAPON_THROWN
+ "Magic", // CHAR_SKILL_MAGIC_IAMJUSTAPLACEHOLDER
+ "Craft", // CHAR_SKILL_CRAFT_IAMJUSTAPLACEHOLDER
+ "Unknown Skill"
+ };
+
+ if ((skill < 0) || (skill > CHAR_SKILL_NB))
+ {
+ return skills[CHAR_SKILL_NB];
+ }
+ else
+ {
+ return skills[skill];
+ }
+
+}
+
void LocalPlayer::setExperience(int skill, int current, int next)
{
int diff = current - mExpCurrent.at(skill);
if (mMap && mExpCurrent.at(skill) != -1 && diff > 0)
{
- const std::string text = toString(diff) + " xp skill" + toString(skill);
+ const std::string text = toString(diff) + " " + getSkillName(skill) + " xp";
mExpMessages.push_back(text);
}