//Fonction de dommages public void TakeDamage(int damage) { //L'ennemi à 1/4 chance de bloquer if (block == true) { int rand1 = Random.Range(0, 5); if (rand1 == 1) { damage = damage / 2; } } //L'ennemi à 1/6 chance d'esquiver if (dodge == true) { int rand2 = Random.Range(0, 7); if (rand2 == 1) { damage = 0; } } SoundManager.PlayHitSound(); life = life - (damage * 100) / armor; }