diff --git a/pokemon.ts b/pokemon.ts index 699ffb960e193594e9a27993c22a11345de928e5..8c604d216b79b3c7f50db0c1a4b1a68cae58c736 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