debug Consumable.java

This commit is contained in:
2026-05-17 06:30:08 -07:00
parent 3ca0ce99db
commit 1f187ff4d8
@@ -1,8 +1,40 @@
package org.project.item.consumables;
import org.project.entity.players.Player;
// TODO: UPDATE IMPLEMENTATION
public abstract class Consumable {
/*
TODO: ADD OTHER REQUIRED AND BONUS METHODS
*/
private String name;
private int healAmount;
private int charges;
public Consumable(String name, int healAmount, int charges) {
this.name = name;
this.healAmount = healAmount;
this.charges = charges;
}
public void use(Player target) {
if (charges <= 0) {
System.out.println("The flask is empty!");
return;
}
target.heal(healAmount);
charges--;
}
public int getCharges() {
return charges;
}
public String getName() {
return name;
}
}