package org.project.entity.enemies;
import org.project.entity.Entity;
import org.project.item.weapons.Weapon;
// TODO: UPDATE IMPLEMENTATION
/*public class Skeleton {
    // TODO: DESIGN ENEMY AND IMPLEMENT THE CONSTRUCTOR
}*/
public class Skeleton extends Enemy {

    private boolean revived = false;
    public Skeleton(int hp, int mp, Weapon weapon) {
        super("Skeleton", hp, mp, weapon);
    }
    @Override
    public void heal(int health) {

        hp += health;

        if (hp > maxHP) {
            hp = maxHP;
        }
    }

    @Override
    public void fillMana(int mana) {

        mp += mana;

        if (mp > maxMP) {
            mp = maxMP;
        }
    }
    @Override
    public void attack(Entity target) {
        int damage = weapon.getDamage();
        target.takeDamage(damage);
        System.out.println(" Skeleton attacked and dealt " + damage + " damage!");
    }
    @Override
    public void defend() {
        System.out.println("Skeleton is defending!");
    }

    @Override
    public void takeDamage(int damage) {
        super.takeDamage(damage);

        if (!revived && hp <= 0) {
            revived = true;

            hp = maxHP / 2;

            System.out.println(
                    "💀 Skeleton revived with 50% HP!");
        }
    }

}