]> git.localhorst.tv Git - l2e.git/blobdiff - src/battle/Hero.cpp
apply damage indicated by attack selection
[l2e.git] / src / battle / Hero.cpp
index ff411137773ee72a21fa20ec54ba5115f3cdd914..ab3b23e9b9c396e023516e539f640501a76ff831 100644 (file)
@@ -20,6 +20,7 @@ Hero::Hero()
 , ring(0)
 , jewel(0)
 
+, meleeAnimation(0)
 , attackAnimation(0)
 , spellAnimation(0)
 
@@ -44,4 +45,13 @@ Hero::~Hero() {
 
 }
 
+
+void Hero::SubtractHealth(int amount) {
+       if (amount > Health()) {
+               health = 0;
+       } else {
+               health -= amount;
+       }
+}
+
 }