/** * The menu shown before battles Switch statement on the input determines which menu action to * take * * @param player the current player */ public static void ShowPreBattleMenu(Student player) { boolean has_potions = player.checkIfPlayerHasItem("Potion"); boolean show_menu = true; while (show_menu) { System.out.println("Strength: " + player.getStrength()); System.out.println("Class starts soon, what do you want to do?"); System.out.println("1) Start class"); System.out.println("2) View inventory"); System.out.println("3) Dropout (Quit)"); if (has_potions) { System.out.println("4) Use Potion"); } System.out.print(BOLDTEXT + "Enter a choice> " + PLAINTEXT); show_menu = PerformPreBattleMenuAction(player, has_potions); } }
public static void GameOver(Student player, Teacher teacher, int battles) { System.out.println("The classwork was overwhelming! Beaten by " + teacher.getName()); System.out.println("Winner info:"); System.out.println("Name: " + teacher.getName()); System.out.println("Strength: " + teacher.getStrength()); System.out.println("Hitpoints: " + teacher.getHP()); teacher.showAbilities(); System.out.println(); System.out.println("Loser info:"); System.out.println("Name: " + player.getName()); System.out.println("Strength: " + player.getStrength()); System.out.println("Hitpoints: " + player.getHP()); System.out.println("Classes attended: " + battles); player.showPlayerInventory(false); System.exit(0); }
public static void WinScreen(Student player, Teacher teacher, int battles) { if (teacher == null) { Teacher teacher1 = new Teacher(); teacher = teacher1; } System.out.println( "Congratulations " + player + ", you passed " + teacher.getName() + "'s class!"); System.out.println("Winner info:"); System.out.println("Name: " + player.getName()); System.out.println("Strength: " + player.getStrength()); System.out.println("Hitpoints: " + player.getHP()); System.out.println("Classes attended: " + battles); player.showPlayerInventory(false); System.out.println(); System.out.println("Loser info:"); System.out.println("Name: " + teacher.getName()); System.out.println("Strength: " + teacher.getStrength()); teacher.showAbilities(); System.exit(0); }