fixed enemy bug

This commit is contained in:
jslightham
2019-05-31 19:57:43 -04:00
parent 67839c569e
commit 788271ff3d
2 changed files with 10 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
Enemy Name: Henry Pellatt
Description: The owner of the Castle
Starting Room: Circle Room
Starting Room: Apple Hallway
Damage Given: 25
Loot: Crowbar
Enemy Name: Lady Pellatt

View File

@@ -162,10 +162,12 @@ class Game {
// Read the Loot
String loot = enemyScanner.nextLine().split(":")[1].trim();
e.setLoot(loot);
masterEnemyMap.put(e, e.getRoom());
}
}catch(Exception ex) {
}
masterEnemyMap.put(e, e.getRoom());
enemyScanner.close();
}
@@ -295,11 +297,17 @@ class Game {
nextRoom.setLocked(false);
player.removeFromInventory(new Lockpick());
System.out.println("After a little bit of picking, a click is heard and the door opens slightly!");
if(!nextRoom.getBoarded())
break;
}else{
System.out.println("That door is already unlocked!");
if(!nextRoom.getBoarded())
break;
}
}catch(Exception e) {
System.out.println("There is no door there!");
if(!nextRoom.getBoarded())
break;
}
}else if(!command.hasDirection()){
System.out.println("In what direction do you want to go in?");