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