package org.project.entity.enemies;


import org.project.entity.Entity;


public class Skeleton extends Enemy {
    private final int attackDamage;
    private boolean hasRevived;

    public Skeleton(int hp, int mp, int attackDamage) {
        super(hp, mp);
        this.attackDamage = attackDamage;
        this.hasRevived = false;
    }

    public int getAttackDamage() {
        return attackDamage;
    }

    @Override
    public void takeDamage(int damage) {
        super.takeDamage(damage);
        if (!hasRevived && hp <= 0) {
            hp = maxHp / 2;
            hasRevived = true;
        }
    }

    @Override
    public void SpecialAbility(Entity target) {
        // Skeleton's revive is handled in takeDamage
    }

    @Override
    public boolean isAlive() {
        return hp > 0;
    }
}
