package org.project.entity.enemies;

import org.project.entity.Entity;
import org.project.item.weapons.Sword;

public class Goblin extends Enemy {
    public Goblin() {
        super("Goblin", 30, 0, new Sword(), "Goblin Key");
        this.xpReward = 20;
    }

    @Override
    public void attack(Entity target) {
        if (isStunned) {
            System.out.println("💫 Goblin is stunned and skipped turn!");
            isStunned = false;
            return;
        }

        if (Math.random() < 0.35) {
            System.out.println("👹 Goblin used \u001B[35mCritical Strike!\u001B[0m");
            target.takeDamage(20);
        } else {
            System.out.println("👹 Goblin used Scratch!");
            target.takeDamage(10);
        }
    }
}