package org.project.item.weapons;

import org.project.entity.Entity;

public class Dagger extends Weapon {

    public Dagger() {
        super(10, 0);
    }

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

    @Override
    public void use(Entity target) {
        int damage = getDamage();

        if (target.isDefending()) {
            damage /= 2;
        }

        target.setHp(target.getHp() - damage);

        System.out.println("Dagger deals " + damage + " damage to " + target.getName());
    }
}
