package org.project.item.consumables;

import org.project.entity.Entity;

public class Flask extends Consumable {

    public Flask(int quantity) {
        super("Healing Flask", quantity);
    }


    @Override
    public String getName() {
        return super.getName();
    }

    @Override
    public int getQuantity() {
        return super.getQuantity();
    }

    @Override
    public void addQuantity(int amount) {
        this.quantity += amount;
    }

    @Override
    public void use(Entity target) {
        if (canUse()) {
            int healAmount = target.getMaxHP() / 4;
            target.fillHealth(healAmount);
            quantity--;
            System.out.println(target.getName()+ " Used Healing Flask And Healed " + healAmount + " HP!");
            System.out.println("Remaining: " + quantity);
        } else {
            System.out.println("The Flask Is Empty!");
        }
    }
}
