implement Flask.java (renamed to HealFlask.java)

This commit is contained in:
2026-05-17 06:34:06 -07:00
parent 1f187ff4d8
commit 3cca5e91a8
2 changed files with 24 additions and 16 deletions
@@ -1,16 +0,0 @@
package org.project.item.consumables;
import org.project.entity.Entity;
// TODO: UPDATE IMPLEMENTATION
public class Flask {
/*
THIS IS AN EXAMPLE OF A CONSUMABLE DESIGN.
*/
// TODO: UPDATE USE METHOD
@Override
public void use(Entity target) {
target.heal(target.getMaxHP() / 10);
}
}
@@ -0,0 +1,24 @@
package org.project.item.consumables;
import org.project.entity.Entity;
import org.project.entity.players.Player;
import org.project.item.Item;
public class HealFlask extends Consumable {
private int healAmount;
public HealFlask(String name, int healAmount, int charges) {
super(name, healAmount, charges);
}
public void use(Player target) {
super.use(target);
System.out.println(target.getName() + " healed for " + healAmount);
}
}