summaryrefslogtreecommitdiff
path: root/src/localplayer.cpp
diff options
context:
space:
mode:
authorPhilipp Sehmisch <tmw@crushnet.org>2007-07-11 12:58:11 +0000
committerPhilipp Sehmisch <tmw@crushnet.org>2007-07-11 12:58:11 +0000
commit84aafd27dad40f4033561052164c21fe68cf78ad (patch)
tree77fb9224634f95b1ede62c6605976feb4ee9455b /src/localplayer.cpp
parent8dd7eef0402cc6e22642f045e3cfde7f5b011d5b (diff)
downloadmana-client-84aafd27dad40f4033561052164c21fe68cf78ad.tar.gz
mana-client-84aafd27dad40f4033561052164c21fe68cf78ad.tar.bz2
mana-client-84aafd27dad40f4033561052164c21fe68cf78ad.tar.xz
mana-client-84aafd27dad40f4033561052164c21fe68cf78ad.zip
Weapon sprites are now (almost) threated like other equipment sprites through the equipment sprite database. (use -u to ignore updates)
Diffstat (limited to 'src/localplayer.cpp')
-rw-r--r--src/localplayer.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index 24976c0a..cc270296 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -34,6 +34,8 @@
#include "net/messageout.h"
#include "net/protocol.h"
+#include "resources/equipmentinfo.h"
+
LocalPlayer *player_node = NULL;
LocalPlayer::LocalPlayer(Uint32 id, Uint16 job, Map *map):
@@ -61,7 +63,8 @@ void LocalPlayer::logic()
case ATTACK:
int frames = 4;
- if (getWeapon() == 2)
+ if ( mEquippedWeapon
+ && mEquippedWeapon->getAttackType() == ACTION_ATTACK_BOW)
{
frames = 5;
}
@@ -392,10 +395,14 @@ void LocalPlayer::attack(Being *target, bool keep)
setAction(ATTACK);
mWalkTime = tick_time;
- if (getWeapon() == 2)
- sound.playSfx("sfx/bow_shoot_1.ogg");
- else
+ if (mEquippedWeapon)
+ {
+ std::string soundFile = mEquippedWeapon->getSound(EQUIP_EVENT_STRIKE);
+ if (soundFile != "") sound.playSfx(soundFile);
+ }
+ else {
sound.playSfx("sfx/fist-swish.ogg");
+ }
MessageOut outMsg(mNetwork);
outMsg.writeInt16(0x0089);