enhance chest object handling and save/load functionality
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user