]> git.localhorst.tv Git - l2e.git/blobdiff - src/battle/Hero.cpp
apply damage indicated by attack selection
[l2e.git] / src / battle / Hero.cpp
index 3fbd320dc6e308d0e40651e4db1f66f239030f8b..ab3b23e9b9c396e023516e539f640501a76ff831 100644 (file)
@@ -13,6 +13,17 @@ 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)
@@ -34,4 +45,13 @@ Hero::~Hero() {
 
 }
 
+
+void Hero::SubtractHealth(int amount) {
+       if (amount > Health()) {
+               health = 0;
+       } else {
+               health -= amount;
+       }
+}
+
 }