package org.project.item.consumables;

import org.project.entity.Entity;

public class StaminaPotion extends Consumable {

    public StaminaPotion(int quantity) {
        super("Stamina Potion", 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 staminaAmount = target.getMaxStamina() / 4;
            target.fillStamina(staminaAmount);
            quantity--;
            System.out.println(target.getName()+ " Used Stamina Potion And Added " + staminaAmount + " To His Stamina!");
            System.out.println("Remaining: " + quantity);
        } else {
            System.out.println("The Flask Is Empty!");
        }
    }
}
