package org.project.item.weapons;

import org.project.entity.Entity;

public class Sword extends Weapon {

    public Sword() {
        super(15, 0);
    }

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

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

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

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

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