enhance chest object handling and save/load functionality

This commit is contained in:
2026-03-23 19:19:20 +01:00
parent 5dbf7fcf1f
commit 70a250f775
6 changed files with 83 additions and 10 deletions

View File

@@ -369,6 +369,18 @@ public class Player extends Entity {
public int getDefense() {
return defense = dexterity * currentShield.defenseValue;
}
public int getCurrentWeaponSlot() {
for(int i = 0; i < inventory.size(); i++) {
if(inventory.get(i) == currentWeapon) return i;
}
return -1;
}
public int getCurrentShieldSlot() {
for(int i = 0; i < inventory.size(); i++) {
if(inventory.get(i) == currentShield) return i;
}
return -1;
}
public void getPlayerImage() {
up1 = initEntitySprites("player/boy_up_1");
up2 = initEntitySprites("player/boy_up_2");