From 55e87c9a21b629ba34fc1229fecfd0137df552ef Mon Sep 17 00:00:00 2001 From: Charlie Darques <charlie.darques.etu@univ-lille.fr> Date: Thu, 5 Sep 2024 10:43:07 +0200 Subject: [PATCH] =?UTF-8?q?affichage=20d=C3=A9gats=20en=20int?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/bitFight/Level.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/bitFight/Level.java b/src/main/java/bitFight/Level.java index 40f3b93..97abb66 100644 --- a/src/main/java/bitFight/Level.java +++ b/src/main/java/bitFight/Level.java @@ -67,7 +67,7 @@ public class Level{ System.out.println("The ennemy attacks before you can !"); player.setCurrentHealth(player.getCurrentHealth() - attack.getDamage() * this.ennemy.getAttackMultiplier()); //Récupère une attaque aléatoire dans l'enum ennemy.exhaust(attack.getEnergyCost()); - System.out.println(attack.getName() + "!! You receive " + (int) attack.getDamage() * this.ennemy.getAttackMultiplier() + " damage!"); + System.out.println(attack.getName() + "!! You receive " + (int) (attack.getDamage() * this.ennemy.getAttackMultiplier()) + " damage!"); System.out.println(this.player.getName() + "'s life' : " + this.displayPlayerHealth()); Display.goToUserInput(); } @@ -91,6 +91,8 @@ public class Level{ System.out.print(" "); System.err.println(this.player.getCurrentEnergy() + "/" + this.player.getMaxEnergy()); } + + public String displayPlayerHealth(){ return (int )this.ennemy.getCurrentHealth() +" / " + (int) this.ennemy.getMaxHealth(); } -- GitLab