package org.project.entity.enemies;
import org.project.entity.Entity;
import org.project.item.weapons.Weapon;

public class Vampire extends Enemy {
    public Vampire(Weapon weapon) {
        //Has balanced stats with sustain ability.
        super(90, 30, weapon);
    }

    @Override
    public void attack(Entity target) {

        int damage = weapon.getDamage();

        target.takeDamage(damage);

        //Heals for 50% of the damage dealt.
        this.hp += damage / 2;

        //Ensure HP does not exceed maximum.
        if (this.hp > this.maxHp) {
            this.hp = this.maxHp;
        }
    }
}
