package org.project.item.weapons;

import org.project.entity.Entity;

public class Dagger extends Weapon{

    private static final double CRIT_CHANCE = 0.3;

    public Dagger() {
        super(3, "Poison Dagger", 8);
    }

    public void uniqueAbility(Entity target) {
        if (target.isAlive())
        {
            int damage = this.getDamage();
            boolean isCrit = Math.random() < CRIT_CHANCE;

            if (isCrit)
            {
                damage *= 2;
                System.out.println("⚡ CRITICAL HIT!");
            }
            else
            {
                System.out.println("🗡️ " + this.getName() + " struck for " + damage + " damage.");
            }

            target.takeDamage(damage);
        }
    }
}

