summaryrefslogtreecommitdiff
path: root/src/actormanager.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-05-11 19:28:57 +0300
committerAndrei Karas <akaras@inbox.ru>2014-05-11 19:28:57 +0300
commit87c59212f8590a8dd72fac3e320fcb2ada781355 (patch)
tree198d627c44f1164140659827a5c782d30bec375b /src/actormanager.cpp
parent02e91411eb9961e95f856bd717d6ca0d8ec0e435 (diff)
downloadplus-87c59212f8590a8dd72fac3e320fcb2ada781355.tar.gz
plus-87c59212f8590a8dd72fac3e320fcb2ada781355.tar.bz2
plus-87c59212f8590a8dd72fac3e320fcb2ada781355.tar.xz
plus-87c59212f8590a8dd72fac3e320fcb2ada781355.zip
Move player attributes into separate file.
Diffstat (limited to 'src/actormanager.cpp')
-rw-r--r--src/actormanager.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/actormanager.cpp b/src/actormanager.cpp
index 2c36b972a..855ff3265 100644
--- a/src/actormanager.cpp
+++ b/src/actormanager.cpp
@@ -26,6 +26,7 @@
#include "configuration.h"
#include "main.h"
+#include "being/attributes.h"
#include "being/localplayer.h"
#include "being/playerinfo.h"
#include "being/playerrelations.h"
@@ -1139,9 +1140,9 @@ void ActorManager::heal(const Being *const target) const
// self
if (target && player_node->getName() == target->getName())
{
- if (PlayerInfo::getAttribute(PlayerInfo::MP) >= 6
- && PlayerInfo::getAttribute(PlayerInfo::HP)
- != PlayerInfo::getAttribute(PlayerInfo::MAX_HP))
+ if (PlayerInfo::getAttribute(Attributes::MP) >= 6
+ && PlayerInfo::getAttribute(Attributes::HP)
+ != PlayerInfo::getAttribute(Attributes::MAX_HP))
{
if (!client->limitPackets(PACKET_CHAT))
return;
@@ -1152,7 +1153,7 @@ void ActorManager::heal(const Being *const target) const
else if (PlayerInfo::getSkillLevel(340) < 2
|| PlayerInfo::getSkillLevel(341) < 2)
{
- if (PlayerInfo::getAttribute(PlayerInfo::MP) >= 6)
+ if (PlayerInfo::getAttribute(Attributes::MP) >= 6)
{
if (target && target->getType() != Being::MONSTER)
{
@@ -1161,8 +1162,8 @@ void ActorManager::heal(const Being *const target) const
chatWindow->localChatInput(mSpellHeal1 + " "
+ target->getName());
}
- else if (PlayerInfo::getAttribute(PlayerInfo::HP)
- != PlayerInfo::getAttribute(PlayerInfo::MAX_HP))
+ else if (PlayerInfo::getAttribute(Attributes::HP)
+ != PlayerInfo::getAttribute(Attributes::MAX_HP))
{
if (!client->limitPackets(PACKET_CHAT))
return;
@@ -1174,7 +1175,7 @@ void ActorManager::heal(const Being *const target) const
else
{
// mp > 10 and target not monster
- if (PlayerInfo::getAttribute(PlayerInfo::MP) >= 10 && target
+ if (PlayerInfo::getAttribute(Attributes::MP) >= 10 && target
&& target->getType() != Being::MONSTER)
{
// target not enemy
@@ -1196,9 +1197,9 @@ void ActorManager::heal(const Being *const target) const
}
// heal self if selected monster or selection empty
else if ((!target || target->getType() == Being::MONSTER)
- && PlayerInfo::getAttribute(PlayerInfo::MP) >= 6
- && PlayerInfo::getAttribute(PlayerInfo::HP)
- != PlayerInfo::getAttribute(PlayerInfo::MAX_HP))
+ && PlayerInfo::getAttribute(Attributes::MP) >= 6
+ && PlayerInfo::getAttribute(Attributes::HP)
+ != PlayerInfo::getAttribute(Attributes::MAX_HP))
{
if (!client->limitPackets(PACKET_CHAT))
return;