diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-05-11 19:28:57 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-05-11 19:28:57 +0300 |
commit | 87c59212f8590a8dd72fac3e320fcb2ada781355 (patch) | |
tree | 198d627c44f1164140659827a5c782d30bec375b /src/net/eathena | |
parent | 02e91411eb9961e95f856bd717d6ca0d8ec0e435 (diff) | |
download | manaplus-87c59212f8590a8dd72fac3e320fcb2ada781355.tar.gz manaplus-87c59212f8590a8dd72fac3e320fcb2ada781355.tar.bz2 manaplus-87c59212f8590a8dd72fac3e320fcb2ada781355.tar.xz manaplus-87c59212f8590a8dd72fac3e320fcb2ada781355.zip |
Move player attributes into separate file.
Diffstat (limited to 'src/net/eathena')
-rw-r--r-- | src/net/eathena/buysellhandler.cpp | 3 | ||||
-rw-r--r-- | src/net/eathena/charserverhandler.cpp | 16 | ||||
-rw-r--r-- | src/net/eathena/generalhandler.cpp | 10 | ||||
-rw-r--r-- | src/net/eathena/playerhandler.cpp | 4 |
4 files changed, 20 insertions, 13 deletions
diff --git a/src/net/eathena/buysellhandler.cpp b/src/net/eathena/buysellhandler.cpp index 31a831b25..65e955d91 100644 --- a/src/net/eathena/buysellhandler.cpp +++ b/src/net/eathena/buysellhandler.cpp @@ -25,6 +25,7 @@ #include "notifications.h" #include "notifymanager.h" +#include "being/attributes.h" #include "being/playerinfo.h" #include "gui/windows/buydialog.h" @@ -93,7 +94,7 @@ void BuySellHandler::processNpcBuy(Net::MessageIn &msg) const int sz = 11; const int n_items = (msg.getLength() - 4) / sz; mBuyDialog = new BuyDialog(mNpcId); - mBuyDialog->setMoney(PlayerInfo::getAttribute(PlayerInfo::MONEY)); + mBuyDialog->setMoney(PlayerInfo::getAttribute(Attributes::MONEY)); for (int k = 0; k < n_items; k++) { diff --git a/src/net/eathena/charserverhandler.cpp b/src/net/eathena/charserverhandler.cpp index f24c984ed..fdcf2ed22 100644 --- a/src/net/eathena/charserverhandler.cpp +++ b/src/net/eathena/charserverhandler.cpp @@ -25,6 +25,8 @@ #include "client.h" #include "configuration.h" +#include "being/attributes.h" + #include "net/logindata.h" #include "net/net.h" @@ -129,8 +131,8 @@ void CharServerHandler::readPlayerData(Net::MessageIn &msg, tempPlayer->setGender(token.sex); PlayerInfoBackend &data = character->data; - data.mAttributes[PlayerInfo::EXP] = msg.readInt32(); - data.mAttributes[PlayerInfo::MONEY] = msg.readInt32(); + data.mAttributes[Attributes::EXP] = msg.readInt32(); + data.mAttributes[Attributes::MONEY] = msg.readInt32(); Stat &jobStat = data.mStats[JOB]; jobStat.exp = msg.readInt32(); @@ -148,10 +150,10 @@ void CharServerHandler::readPlayerData(Net::MessageIn &msg, msg.readInt32(); // manner msg.readInt16(); // character points left - data.mAttributes[PlayerInfo::HP] = msg.readInt16(); - data.mAttributes[PlayerInfo::MAX_HP] = msg.readInt16(); - data.mAttributes[PlayerInfo::MP] = msg.readInt16(); - data.mAttributes[PlayerInfo::MAX_MP] = msg.readInt16(); + data.mAttributes[Attributes::HP] = msg.readInt16(); + data.mAttributes[Attributes::MAX_HP] = msg.readInt16(); + data.mAttributes[Attributes::MP] = msg.readInt16(); + data.mAttributes[Attributes::MAX_MP] = msg.readInt16(); msg.readInt16(); // speed tempPlayer->setSubtype(msg.readInt16(), 0); // class (used for race) @@ -160,7 +162,7 @@ void CharServerHandler::readPlayerData(Net::MessageIn &msg, tempPlayer->setSprite(SPRITE_WEAPON, weapon, "", 1, true); - data.mAttributes[PlayerInfo::LEVEL] = msg.readInt16(); + data.mAttributes[Attributes::LEVEL] = msg.readInt16(); msg.readInt16(); // skill point const int bottomClothes = msg.readInt16(); diff --git a/src/net/eathena/generalhandler.cpp b/src/net/eathena/generalhandler.cpp index 92afd945c..8a96bde05 100644 --- a/src/net/eathena/generalhandler.cpp +++ b/src/net/eathena/generalhandler.cpp @@ -26,6 +26,8 @@ #include "configuration.h" #include "logger.h" +#include "being/attributes.h" + #include "gui/windows/inventorywindow.h" #include "gui/windows/skilldialog.h" #include "gui/windows/socialwindow.h" @@ -257,10 +259,10 @@ void GeneralHandler::gameStarted() const statusWindow->addAttribute(FLEE, _("% Evade")); // xgettext:no-c-format statusWindow->addAttribute(CRIT, _("% Critical")); - statusWindow->addAttribute(PlayerInfo::ATTACK_DELAY, _("Attack Delay")); - statusWindow->addAttribute(PlayerInfo::WALK_SPEED, _("Walk Delay")); - statusWindow->addAttribute(PlayerInfo::ATTACK_RANGE, _("Attack Range")); - statusWindow->addAttribute(PlayerInfo::ATTACK_SPEED, _("Damage per sec.")); + statusWindow->addAttribute(Attributes::ATTACK_DELAY, _("Attack Delay")); + statusWindow->addAttribute(Attributes::WALK_SPEED, _("Walk Delay")); + statusWindow->addAttribute(Attributes::ATTACK_RANGE, _("Attack Range")); + statusWindow->addAttribute(Attributes::ATTACK_SPEED, _("Damage per sec.")); } void GeneralHandler::gameEnded() const diff --git a/src/net/eathena/playerhandler.cpp b/src/net/eathena/playerhandler.cpp index f4305f280..627e5479f 100644 --- a/src/net/eathena/playerhandler.cpp +++ b/src/net/eathena/playerhandler.cpp @@ -22,6 +22,8 @@ #include "net/eathena/playerhandler.h" +#include "being/attributes.h" + #include "net/net.h" #include "net/eathena/messageout.h" @@ -145,7 +147,7 @@ void PlayerHandler::increaseAttribute(const int attr) const void PlayerHandler::increaseSkill(const uint16_t skillId) const { - if (PlayerInfo::getAttribute(PlayerInfo::SKILL_POINTS) <= 0) + if (PlayerInfo::getAttribute(Attributes::SKILL_POINTS) <= 0) return; MessageOut outMsg(CMSG_SKILL_LEVELUP_REQUEST); |