package org.project.entity.enemies;

import org.project.entity.Entity;
import java.util.Random;

public class Goblin extends Enemy {
    private Random random;

    public Goblin() {
        super("Goblin", 30, 10);
        this.random = new Random();
    }

    @Override
    public void attackAction(Entity target) {
        if (!isStunned()) {
            if (random.nextInt(100) < 40) {
                System.out.println("\u001B[31m👹 Goblin used Critical Strike!\u001B[0m");
                target.takeDamage(baseDamage * 2);
            } else {
                System.out.println("👹 Goblin attacks normally!");
                target.takeDamage(baseDamage);
            }
        } else {
            System.out.println("👹 Goblin is stunned and skips the turn!");
            setStunned(false);
        }
    }
}