]> git.localhorst.tv Git - l2e.git/blobdiff - src/battle/Hero.cpp
Merge branch 'master' into menus
[l2e.git] / src / battle / Hero.cpp
index 17ec08a2bbc8316abd84fadb827d02f087d80745..1d8393e0395daca372e466a0b069e83764a0d2a7 100644 (file)
@@ -20,47 +20,18 @@ using std::vector;
 namespace battle {
 
 Hero::Hero()
-: name("")
-, sprite(0)
-
-, weapon(0)
-, armor(0)
-, shield(0)
-, helmet(0)
-, ring(0)
-, jewel(0)
-
-, meleeAnimation(0)
-, attackAnimation(0)
-, spellAnimation(0)
-
-, maxHealth(0)
-, health(0)
-, maxMana(0)
-, mana(0)
-
-, level(0)
-, ip(0) {
+: master(0) {
 
 }
 
-Hero::~Hero() {
+Hero::Hero(common::Hero &h)
+: master(&h)
+, stats(h.GetStats()) {
 
 }
 
+Hero::~Hero() {
 
-void Hero::SubtractHealth(int amount) {
-       if (amount > Health()) {
-               health = 0;
-       } else {
-               health -= amount;
-               int ipGain(amount * 255 / health);
-               if (ip + ipGain > 255) {
-                       ip = 255;
-               } else {
-                       ip += ipGain;
-               }
-       }
 }