diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2007-08-23 14:14:51 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2007-08-23 14:14:51 +0000 |
commit | 5b755a2a6afdba9d07703c3bf5447bf314d842ab (patch) | |
tree | 9c8c1808283d5ecc954668fc53d76d0252eec430 /src/localplayer.cpp | |
parent | 4b8df221acc3bd3e681357df912bdbc7a1ce6c3f (diff) | |
download | mana-5b755a2a6afdba9d07703c3bf5447bf314d842ab.tar.gz mana-5b755a2a6afdba9d07703c3bf5447bf314d842ab.tar.bz2 mana-5b755a2a6afdba9d07703c3bf5447bf314d842ab.tar.xz mana-5b755a2a6afdba9d07703c3bf5447bf314d842ab.zip |
Changed XP gaining effect to appear on the player instead.
Diffstat (limited to 'src/localplayer.cpp')
-rw-r--r-- | src/localplayer.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp index 940934b8..e6a52e10 100644 --- a/src/localplayer.cpp +++ b/src/localplayer.cpp @@ -29,13 +29,18 @@ #include "inventory.h" #include "item.h" #include "main.h" +#include "particle.h" #include "sound.h" +#include "gui/gui.h" + #include "net/messageout.h" #include "net/protocol.h" #include "resources/equipmentinfo.h" +#include "utils/tostring.h" + LocalPlayer *player_node = NULL; LocalPlayer::LocalPlayer(Uint32 id, Uint16 job, Map *map): @@ -439,11 +444,15 @@ void LocalPlayer::revive() outMsg.writeInt8(0); } -void LocalPlayer::refreshXp(Uint32 xp) +void LocalPlayer::setXp(int xp) { - if (mTarget && xp > mXp) + if (mMap && xp > mXp) { - mTarget->showXP(xp-mXp); + const std::string text = toString(xp - mXp) + " xp"; + + // Show XP number + particleEngine->addTextRiseFadeOutEffect(text, hitYellowFont, + mPx + 16, mPy - 16); } mXp = xp; } |