Skip to content
Snippets Groups Projects
Commit 9f54102f authored by Charlie Darques's avatar Charlie Darques
Browse files

modif affichage fin de niveau

parent 60a46cd1
No related branches found
No related tags found
No related merge requests found
...@@ -110,6 +110,16 @@ public class Level{ ...@@ -110,6 +110,16 @@ public class Level{
System.out.println("Commands : \n \t a - attack \n\t q - exit"); System.out.println("Commands : \n \t a - attack \n\t q - exit");
} }
// affiche la fin du niveau
public void displayEndOfLevel() {
Display.clearDialogBox();
System.out.println('\n');
System.out.println(" Congrats! "+'\n');
System.out.println(" you won your first fight! + \n \t let's see what you can do with your second ennemy... Good luck! \n\t your currrent enemy level is "+level.getEnnemy().getLevel());
System.out.println(" \n this time your enemy health is "+ (int) this.getEnnemy().getCurrentHealth()+ "\n ... ");
}
// méthodes de combats // méthodes de combats
// liste des attaques et défenses possibles pour le joueur // liste des attaques et défenses possibles pour le joueur
public void possibleActions() throws IOException { public void possibleActions() throws IOException {
......
...@@ -46,27 +46,28 @@ class Main { ...@@ -46,27 +46,28 @@ class Main {
Display.goToDialogBox(); Display.goToDialogBox();
// arrivée de l'ennemi
level.ennemyShowing();
Display.newPrintln(enemy.toString()); Display.newPrintln(enemy.toString());
Display.newPrintln(Terminal.RED_BACKGROUND + "ATTAQUEZ" + Terminal.RESET + " ou " + Terminal.PURPLE_BACKGROUND + "QUITTEZ" + Terminal.RESET); Display.newPrintln(Terminal.RED_BACKGROUND + "ATTAQUEZ" + Terminal.RESET + " ou " + Terminal.PURPLE_BACKGROUND + "QUITTEZ" + Terminal.RESET);
Display.goToUserInput(); Display.goToUserInput();
// Récupère le nom de cahque attaque dans une ArrayList // Récupère le nom de cahque attaque dans une ArrayList
ArrayList<String> actionNames = new ArrayList<>(); ArrayList<String> actionNames = new ArrayList<>();
for (Attack a : Attack.values()) actionNames.add(a.getName()); for (Attack a : Attack.values()) actionNames.add(a.getName());
for (Defense d : Defense.values()) actionNames.add(d.getName()); for (Defense d : Defense.values()) actionNames.add(d.getName());
BufferedReader in= new BufferedReader( new InputStreamReader(System.in)); BufferedReader in= new BufferedReader( new InputStreamReader(System.in));
Random rand = new Random(); Random rand = new Random();
Input input = new Input(); Input input = new Input();
input.newInput(); input.newInput();
Display.goToDialogBox(); Display.goToDialogBox();
// arrivée de l'ennemi
level.ennemyShowing();
if (input.getInput().equals("a")) { if (input.getInput().equals("a")) {
...@@ -119,13 +120,7 @@ class Main { ...@@ -119,13 +120,7 @@ class Main {
enemy.revive(); enemy.revive();
enemy.levelUp(); enemy.levelUp();
level.levelGoingUp(); level.levelGoingUp();
Display.clearDialogBox(); level.displayEndOfLevel();
System.out.println('\n');
System.out.println(" Congrats! "+'\n');
System.out.println(" you won your first fight! + \n \t let's see what you can do with your second ennemy... Good luck! \n\t your currrent enemy level is "+level.getEnnemy().getLevel());
System.out.println(" \n this time your enemy health is "+ (int) level.getEnnemy().getCurrentHealth()+ "\n ... ");
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment