package org.project.entity.enemies;

import org.project.entity.Entity;

public class Skeleton extends Enemy {
    private boolean hasResurrected;

    public Skeleton() {
        super("Skeleton", 40, 8);
        this.hasResurrected = false;
    }

    @Override
    public void takeDamage(int damage) {
        super.takeDamage(damage);
        if (hp == 0 && !hasResurrected) {
            System.out.println("\u001B[33m☠️ Skeleton resurrected with 50% HP!\u001B[0m");
            hasResurrected = true;
            hp = maxHP / 2;
        }
    }

    @Override
    public void attackAction(Entity target) {
        if (!isStunned()) {
            System.out.println("☠️ Skeleton uses Bone Strike!");
            target.takeDamage(baseDamage);
        } else {
            System.out.println("☠️ Skeleton is stunned and skips the turn!");
            setStunned(false);
        }
    }
}