added stackable functionality to items and improved inventory management
This commit is contained in:
@@ -42,13 +42,12 @@ public class ChestObj extends Entity {
|
||||
panel.playSE(3);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("You open the chest and find a ").append(loot.name).append("!");
|
||||
if(panel.player.inventory.size() == panel.player.maxInvSize) {
|
||||
if(!panel.player.canObtainItem(loot)) {
|
||||
sb.append("\nBut your inventory is full...");
|
||||
panel.ui.currentDialogue = sb.toString();
|
||||
return;
|
||||
}
|
||||
sb.append("\nYou obtain the ").append(loot.name).append("!");
|
||||
panel.player.inventory.add(loot);
|
||||
down1 = image2;
|
||||
opened = true;
|
||||
panel.ui.currentDialogue = sb.toString();
|
||||
|
||||
Reference in New Issue
Block a user