made scream command

This commit is contained in:
Luca Carnegie
2019-05-31 17:31:56 -04:00
parent ec64080aa1
commit 37aec4befc

View File

@@ -383,12 +383,12 @@ class Game {
String prizeName = prize.getName(); String prizeName = prize.getName();
System.out.println("Congratulations! You solved my riddle! As your reward, you get a " + prizeName + "!"); System.out.println("Congratulations! You solved my riddle! As your reward, you get a " + prizeName + "!");
if(player.addToInventory(prize)) { if(player.addToInventory(prize)) {
player.addToInventory(prize);
System.out.println("A " + prizeName + " has been added to your inventory."); System.out.println("A " + prizeName + " has been added to your inventory.");
currentRoom.removeRiddler();
System.out.println("I've got to go find Mr. Pellatt now. Good luck with your escape!"); System.out.println("I've got to go find Mr. Pellatt now. Good luck with your escape!");
currentRoom.removeRiddler();
}else { }else {
System.out.println("Sorry, you can't carry any more "); System.out.println("Sorry, you can't carry any more, but a " + prize + " has been added to your room.");
currentRoom.addItem(prize);
} }
}else { }else {
System.out.println("Sorry, that isn't the answer. Think about it, then try again."); System.out.println("Sorry, that isn't the answer. Think about it, then try again.");
@@ -396,7 +396,10 @@ class Game {
}else { }else {
System.out.println("Talk to who?"); System.out.println("Talk to who?");
} }
break; break;
case "scream":
System.out.println("Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaahhhhhhhhhhhhhhhhhhhhh!");
break;
case "take": case "take":
boolean hasAll = false; boolean hasAll = false;
for(String a : command.getOtherWords()) { for(String a : command.getOtherWords()) {