package org.project.entity.enemies;

import org.project.entity.players.Player;
import org.project.utilities.Colors;

public class Skeleton extends Enemy
{
    private boolean resurrected = false;

    public Skeleton()
    {
        super("Skeleton", 80, 14, 35);
    }

    @Override
    public void attack(Player player)
    {
        player.takeDamage(damage);
    }

    @Override
    public boolean isAlive()
    {

        if (health <= 0 && !resurrected)
        {
            resurrected = true;
            health = maxHealth / 2;

            System.out.println(Colors.PURPLE + "☠️ Skeleton resurrected!" + Colors.RESET);

            return true;
        }

        return health > 0;
    }
}
