From d1f2361b6cdf709b00575861cf35671965240777 Mon Sep 17 00:00:00 2001 From: Julien Pouillart Date: Mon, 17 Feb 2020 15:07:25 +0100 Subject: [PATCH] =?UTF-8?q?r=C3=A9glage=20du=20bug=20d'attaque=20du=20jeu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pokemon.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pokemon.ts b/pokemon.ts index 699ffb9..8c604d2 100644 --- a/pokemon.ts +++ b/pokemon.ts @@ -19,7 +19,7 @@ export function display(p : Pokemon) : string{ */ export function attack(p1 : Pokemon, p2 : Pokemon) : Pokemon { console.log(display(p1)+ " attaque " + display(p2)); - //TODO Compléter cette fonction - + if ((p2.health - (5 * (p1.force/p2.armor) + 2)) >= 0){ + p2.health = p2.health - (5 * (p1.force/p2.armor) + 2);} return p2; } \ No newline at end of file -- GitLab