summaryrefslogtreecommitdiff
path: root/src/localplayer.cpp
diff options
context:
space:
mode:
authorPhilipp Sehmisch <tmw@crushnet.org>2008-11-01 19:03:01 +0000
committerPhilipp Sehmisch <tmw@crushnet.org>2008-11-01 19:03:01 +0000
commit14ef52c7c3413f8c61b50147dcd22f4ed7238078 (patch)
tree82888985eeae2f3e21ce5e414d6ae9ac72e37d36 /src/localplayer.cpp
parentbabaec33e51991475ba2ab9ec06c95bbe5f220c0 (diff)
downloadmana-client-14ef52c7c3413f8c61b50147dcd22f4ed7238078.tar.gz
mana-client-14ef52c7c3413f8c61b50147dcd22f4ed7238078.tar.bz2
mana-client-14ef52c7c3413f8c61b50147dcd22f4ed7238078.tar.xz
mana-client-14ef52c7c3413f8c61b50147dcd22f4ed7238078.zip
Magic implementation phase 1 and 2 (added netcode and a very crude gui for using special actions like magic)
Diffstat (limited to 'src/localplayer.cpp')
-rw-r--r--src/localplayer.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index 6c802c5c..30ad7b2e 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -280,7 +280,7 @@ void LocalPlayer::walk(unsigned char dir)
if (dir & RIGHT)
dx += 32;
-
+
// Prevent skipping corners over colliding tiles
if (dx && !mMap->getWalk(((int) pos.x + dx) / 32,
(int) pos.y / 32, getWalkMask()))
@@ -293,12 +293,12 @@ void LocalPlayer::walk(unsigned char dir)
if (dx && dy && !mMap->getWalk((pos.x + dx) / 32,
(pos.y + dy) / 32, getWalkMask()))
dx = 16 - (int) pos.x % 32;
-
+
// Checks our path up to 5 tiles, if a blocking tile is found
// We go to the last good tile, and break out of the loop
for (dScaler = 1; dScaler <= 10; dScaler++)
{
- if ( (dx || dy) &&
+ if ( (dx || dy) &&
!mMap->getWalk( ((int) pos.x + (dx * dScaler)) / 32,
((int) pos.y + (dy * dScaler)) / 32, getWalkMask()) )
{
@@ -306,7 +306,7 @@ void LocalPlayer::walk(unsigned char dir)
break;
}
}
-
+
if (dScaler >= 0)
{
setDestination((int) pos.x + (dx * dScaler), (int) pos.y + (dy * dScaler));
@@ -477,6 +477,11 @@ void LocalPlayer::attack()
Net::GameServer::Player::attack(getSpriteDirection());
}
+void LocalPlayer::useSpecial(int special)
+{
+ Net::GameServer::Player::useSpecial(special);
+}
+
Being* LocalPlayer::getTarget() const
{
return mTarget;