summaryrefslogtreecommitdiff
path: root/src/playerinfo.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-09-02 15:45:57 +0300
committerAndrei Karas <akaras@inbox.ru>2011-09-02 15:45:57 +0300
commitb17d7d87918b76323e08c0a5c09abd8fa1f3ed71 (patch)
tree03f523babd604b31bff687d50a5caa81723d3455 /src/playerinfo.cpp
parentcfcdacfd6ed49916890a93d7565bd2a2d1f1e8f5 (diff)
downloadmv-b17d7d87918b76323e08c0a5c09abd8fa1f3ed71.tar.gz
mv-b17d7d87918b76323e08c0a5c09abd8fa1f3ed71.tar.bz2
mv-b17d7d87918b76323e08c0a5c09abd8fa1f3ed71.tar.xz
mv-b17d7d87918b76323e08c0a5c09abd8fa1f3ed71.zip
Add to status window attribute "damage per second".
Diffstat (limited to 'src/playerinfo.cpp')
-rw-r--r--src/playerinfo.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/playerinfo.cpp b/src/playerinfo.cpp
index 3bb196921..769d24a16 100644
--- a/src/playerinfo.cpp
+++ b/src/playerinfo.cpp
@@ -31,6 +31,9 @@
#include "resources/itemdb.h"
#include "resources/iteminfo.h"
+#include "net/net.h"
+#include "net/playerhandler.h"
+
#include "debug.h"
namespace PlayerInfo
@@ -280,6 +283,23 @@ void setTrading(bool trading)
}
}
+void updateAttrs()
+{
+ int attr = Net::getPlayerHandler()->getAttackLocation();
+ if (attr != -1 && getStatBase(ATTACK_DELAY))
+ {
+ setStatBase(ATTACK_SPEED, getStatBase(attr) * 1000 / getStatBase(
+ ATTACK_DELAY), false);
+ setStatMod(ATTACK_SPEED, getStatMod(attr) * 1000 / getStatBase(
+ ATTACK_DELAY), true);
+ }
+ else
+ {
+ setStatBase(ATTACK_SPEED, 0, false);
+ setStatMod(ATTACK_SPEED, 0, true);
+ }
+}
+
class PlayerInfoListener : Mana::Listener
{
public: