diff options
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; } |