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

public class Dagger extends Weapon{
    private double criticalChance;

    public Dagger() {
        // Dagger is meant to be quick and efficient, not the highest raw damage weapon.
        super(12, 2);
        this.criticalChance = 0.30;
    }

    // Critical damage supports a high-risk, high-reward playstyle.
    public void criticalStrike(Entity target) {
        if (Math.random() < criticalChance) {
            target.takeDamage(getDamage() * 2);
        } else {
            target.takeDamage(getDamage());
        }
    }

    @Override
    public String getName() {
        return "Dagger";
    }

    @Override
    public String getDescription() {
        return "A light and deadly blade designed for quick strikes and critical hits.";
    }

    @Override
    public int getValue() {
        return 90;
    }
}
