summaryrefslogtreecommitdiff
path: root/src/localplayer.cpp
diff options
context:
space:
mode:
authorPhilipp Sehmisch <crush@themanaworld.org>2009-07-03 22:17:18 +0200
committerPhilipp Sehmisch <crush@themanaworld.org>2009-07-03 22:28:02 +0200
commit346d68307553c18777df4c49f9b3fe57955c5c0d (patch)
treed27d3fff4f5a366f597ae83d3fb62e2dbd4d69bf /src/localplayer.cpp
parente0de8a124bf94b79d9d64e5406b21e8598a05d56 (diff)
downloadmana-client-346d68307553c18777df4c49f9b3fe57955c5c0d.tar.gz
mana-client-346d68307553c18777df4c49f9b3fe57955c5c0d.tar.bz2
mana-client-346d68307553c18777df4c49f9b3fe57955c5c0d.tar.xz
mana-client-346d68307553c18777df4c49f9b3fe57955c5c0d.zip
Implemented display of spell recharge information from server in the magic gui (very, very hackish)
Diffstat (limited to 'src/localplayer.cpp')
-rw-r--r--src/localplayer.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index 2f8761e7..241cfe99 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -28,6 +28,7 @@
#include "graphics.h"
#include "inventory.h"
#include "item.h"
+#include "log.h"
#include "map.h"
#include "monster.h"
#include "particle.h"
@@ -183,6 +184,23 @@ void LocalPlayer::logic()
}
mExpMessageTime--;
}
+
+ if ((mSpecialRechargeUpdateNeeded%11) == 0)
+ {
+ mSpecialRechargeUpdateNeeded = 0;
+ for (std::map<int, Special>::iterator i = mSpecials.begin();
+ i != mSpecials.end();
+ i++)
+ {
+ i->second.currentMana += i->second.recharge;
+ if (i->second.currentMana > i->second.neededMana)
+ {
+ i->second.currentMana = i->second.neededMana;
+ }
+ }
+ }
+ mSpecialRechargeUpdateNeeded++;
+
#else
// Targeting allowed 4 times a second
if (get_elapsed_time(mLastTarget) >= 250)
@@ -669,6 +687,14 @@ void LocalPlayer::useSpecial(int special)
Net::GameServer::Player::useSpecial(special);
}
+void LocalPlayer::setSpecialStatus(int id, int current, int max, int recharge)
+{
+ logger->log("SpecialUpdate Skill #%d -- (%d/%d) -> %d", id, current, max, recharge);
+ mSpecials[id].currentMana = current;
+ mSpecials[id].neededMana = max;
+ mSpecials[id].recharge = recharge;
+}
+
#endif
void LocalPlayer::attack(Being *target, bool keep)