summaryrefslogtreecommitdiff
path: root/src/localplayer.cpp
diff options
context:
space:
mode:
authorPhilipp Sehmisch <tmw@crushnet.org>2007-03-22 23:10:27 +0000
committerPhilipp Sehmisch <tmw@crushnet.org>2007-03-22 23:10:27 +0000
commit346bb6d670d630d65f8c35125831c75d031aac7f (patch)
treec79877ea0d6b46ae748bf4a6d6d3969dc483f0a4 /src/localplayer.cpp
parent6f9a2e74958d794fb049253833b98982e915df45 (diff)
downloadmana-client-346bb6d670d630d65f8c35125831c75d031aac7f.tar.gz
mana-client-346bb6d670d630d65f8c35125831c75d031aac7f.tar.bz2
mana-client-346bb6d670d630d65f8c35125831c75d031aac7f.tar.xz
mana-client-346bb6d670d630d65f8c35125831c75d031aac7f.zip
Redesigned the localplayer class to use getters and setters instead of direct access to the member variables. Implemented communication of attributes between server and client.
Diffstat (limited to 'src/localplayer.cpp')
-rw-r--r--src/localplayer.cpp61
1 files changed, 11 insertions, 50 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index 16d5b191..7f595ef1 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -38,10 +38,13 @@ LocalPlayer *player_node = NULL;
LocalPlayer::LocalPlayer():
Player(65535, 0, NULL),
- mLevel(1),
mInventory(new Inventory()),
+ mAttributeBase(NB_BASE_ATTRIBUTES, 0),
+ mAttributeEffective(NB_BASE_ATTRIBUTES, 0),
+ mLevel(1),
mTarget(NULL), mPickUpTarget(NULL),
- mTrading(false), mLastAction(-1)
+ mTrading(false),
+ mLastAction(-1)
{
}
@@ -235,54 +238,6 @@ void LocalPlayer::setWalkingDir(int dir)
}
}
-void LocalPlayer::raiseAttribute(Attribute attr)
-{
- // XXX Convert for new server
- /*
- MessageOut outMsg(CMSG_STAT_UPDATE_REQUEST);
-
- switch (attr)
- {
- case STR:
- outMsg.writeShort(0x000d);
- break;
-
- case AGI:
- outMsg.writeShort(0x000e);
- break;
-
- case VIT:
- outMsg.writeShort(0x000f);
- break;
-
- case INT:
- outMsg.writeShort(0x0010);
- break;
-
- case DEX:
- outMsg.writeShort(0x0011);
- break;
-
- case LUK:
- outMsg.writeShort(0x0012);
- break;
- }
- outMsg.writeByte(1);
- */
-}
-
-void LocalPlayer::raiseSkill(Uint16 skillId)
-{
- if (mSkillPoint <= 0)
- return;
-
- // XXX Convert for new server
- /*
- MessageOut outMsg(CMSG_SKILL_LEVELUP_REQUEST);
- outMsg.writeShort(skillId);
- */
-}
-
void LocalPlayer::toggleSit()
{
if (mLastAction != -1)
@@ -375,3 +330,9 @@ void LocalPlayer::revive()
outMsg.writeByte(0);
*/
}
+
+void LocalPlayer::raiseAttribute(size_t attr)
+{
+ mAttributeBase.at(attr)++;
+ // TODO: Inform the server about our desire to raise the attribute
+}