added stackable functionality to items and improved inventory management
This commit is contained in:
@@ -21,16 +21,17 @@ public class PotionObj extends Entity {
|
||||
description = "[" + name + "]\nHeals your life by " + value + ".";
|
||||
|
||||
price = 50;
|
||||
stackable = true;
|
||||
}
|
||||
|
||||
public void use(Entity entity) {
|
||||
public boolean use(Entity entity) {
|
||||
panel.gameState = GameState.DIALOGUE;
|
||||
panel.ui.currentDialogue = "You drank a " + name + "!\n" +
|
||||
"Your life has been recovered by " + value + ".";
|
||||
entity.life += value;
|
||||
if(panel.player.life > panel.player.maxLife) panel.player.life = panel.player.maxLife;
|
||||
panel.playSE(2);
|
||||
panel.player.inventory.remove(this);
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user