Skip to content
Snippets Groups Projects
Commit 8f59bb6f authored by Mohamed Taarit's avatar Mohamed Taarit
Browse files

test

parent d5b0f8b1
No related branches found
No related tags found
No related merge requests found
package bitFight;
public enum Attack implements Action {
PUNCH(10);
PUNCH(10),
KICK(20),
SUPERMANPUNCH(50),
DOUBLEKICK(60)
;
private int damage;
Attack(int damage) {
......
......@@ -32,15 +32,33 @@ class Main {
}
System.out.println("input valide");
if (input.getInput().equals("a")) {
if (input.getInput().toUpperCase().equals("PUNCH")) {
JoueurEnnemi.damage(Attack.PUNCH.getDamage());
System.out.println("Ennemi" + " health : " + JoueurEnnemi.getCurrentHealth());
System.out.println("Ennemi" + " health : " + (int) JoueurEnnemi.getCurrentHealth());
input.setInput(in.nextLine());
}else if(input.getInput().toUpperCase().equals("KICK")) {
JoueurEnnemi.damage(Attack.KICK.getDamage());
System.out.println("Ennemi" + " health : " + (int) JoueurEnnemi.getCurrentHealth());
input.setInput(in.nextLine());
}else if (input.getInput().toUpperCase().equals("SUPERMAN PUNCH")) {
JoueurEnnemi.damage(Attack.SUPERMANPUNCH.getDamage());
System.out.println("Ennemi" + " health : " + (int) JoueurEnnemi.getCurrentHealth());
input.setInput(in.nextLine());
}else if (input.getInput().toUpperCase().equals("DOUBLE KICK")) {
JoueurEnnemi.damage(Attack.DOUBLEKICK.getDamage());
System.out.println("Ennemi" + " health : " + (int) JoueurEnnemi.getCurrentHealth());
input.setInput(in.nextLine());
}else{
System.out.println("cette attaque n'est pas disponible :( \n les attaques disponible sont : \n \t punch , kick , double kikck , superman punch . ");
}
if(Duration.between(timeBeforeAttack, LocalDateTime.now()).toSeconds() > attackTime){
//TODO, code pour joueur qui vient de se faire attaquer, FIN DE BOUCLE
System.out.println("attaque");
System.out.println("?? ");
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment