diff --git a/onyx2/include/Class/flotte.php b/onyx2/include/Class/flotte.php index aab618f..ed6457d 100644 --- a/onyx2/include/Class/flotte.php +++ b/onyx2/include/Class/flotte.php @@ -573,17 +573,17 @@ class Flotte if (($this->start_planete->technologies[1]& 67108864) == 67108864) { $espionnage_A = 3; } elseif (($this->start_planete->technologies[1]& 33554432) == 33554432) { - $espionnage_A = 3; + $espionnage_A = 2; } elseif (($this->start_planete->technologies[1]& 16777216) == 16777216) { - $espionnage_A = 3; + $espionnage_A = 1; } else { $espionnage_A = 0; } - if (($this->start_planete->technologies[1]& 536870912) == 536870912) { + if (($this->end_planete->technologies[1]& 536870912) == 536870912) { $contreespionnage_B = 3; - } elseif (($this->start_planete->technologies[1]& 268435456) == 268435456) { + } elseif (($this->end_planete->technologies[1]& 268435456) == 268435456) { $contreespionnage_B = 2; - } elseif (($this->start_planete->technologies[1]& 134217728) == 134217728) { + } elseif (($this->end_planete->technologies[1]& 134217728) == 134217728) { $contreespionnage_B = 1; } else { $contreespionnage_B = 0; @@ -592,8 +592,20 @@ class Flotte //Création du rapport $rapport = new Rapport(5, $this->start_planete, $this->end_planete, $this->start_time + $this->end_time); $rapport->addInfo($this->end_planete, 0); - $rapport->addInfo($contreespionnage_B/$espionnage_A/10, 1); - $rapport->addInfo($espionnage_A+2-$contreespionnage_B+1, 2); + //Rend aléatoire le niveau affiché des bâtiments + $diff_esp = $espionnage_A - $contreespionnage_B; + //Il y a au moins 2 niveaux d'erreur (soit 1 positif et 1 négatif) + if ($diff_esp == 0) { + $diff_esp = 1; + } + $rapport->addInfo($diff_esp, 1); + //Où x est le résultat de cette formule, si x >= y, ça donne accès a plus d'informations + // si y >= 1 : ressources + // si y >= 2 : batiment + // si y >= 3 : défenses + // si y >= 4 : flottes + $rapport->addInfo($espionnage_A + 2 - $contreespionnage_B + 1, 2); + //Si le joueur a au moins le niveau 1 du contre-espionnage, on le prévient qu'il a été espionné, sinon il n'en sait rien $rapport->addInfo($contreespionnage_B, 3); $rapport->send(); diff --git a/onyx2/include/Class/rapport.php b/onyx2/include/Class/rapport.php index 578081d..fded6c6 100644 --- a/onyx2/include/Class/rapport.php +++ b/onyx2/include/Class/rapport.php @@ -91,7 +91,7 @@ class Rapport if ($this->var[2] > 2) { $this->rapportA .= ""; foreach ($this->var[0]->batiments as $key => $batiment) { - $this->rapportA .= ""; + $this->rapportA .= ""; } $this->rapportA .= "
NiveauBâtiment
".rand($batiment * (1 - $this->var[1]), $batiment * (1 + $this->var[1]))."".$LANG[$this->var[0]->race]["batiments"]["noms_sing"][$key]."
".rand(($batiment - $this->var[1]), ($batiment + $this->var[1]))."".$LANG[$this->var[0]->race]["batiments"]["noms_sing"][$key]."

"; } @@ -101,20 +101,20 @@ class Rapport } //Flottes au sol - if ($this->var[2] > 5) { + if ($this->var[2] > 4) { $this->rapportA .= ""; foreach ($this->var[0]->vaisseaux as $key => $vaisseau) { - $this->rapportA .= ""; + $this->rapportA .= ""; } $this->rapportA .= "
NombreVaisseaux
".rand($vaisseau * (1 - $this->var[1]), $vaisseau * (1 + $this->var[1]))."".$LANG[$this->var[0]->race]["vaisseaux"]["noms_sing"][$key]."
".rand(($vaisseau - $this->var[1]), ($vaisseau + $this->var[1]))."".$LANG[$this->var[0]->race]["vaisseaux"]["noms_sing"][$key]."

"; } //Défenses - if ($this->var[2] > 4) { + if ($this->var[2] > 3) { $this->rapportA .= ""; foreach ($this->var[0]->terrestres as $key => $unite) { - if (!dTerrestre::type($key)) { - $this->rapportA .= ""; + if (!dTerrestre::type($key, $this->var[0])) { + $this->rapportA .= ""; } } $this->rapportA .= "
NombreDéfenses
".rand($unite * (1 - $this->var[1]), $unite * (1 + $this->var[1]))."".$LANG[$this->var[0]->race]["terrestre"]["noms_sing"][$key]."
".rand($unite * floor(1 - $this->var[1]), $unite * ceil(1 + $this->var[1]))."".$LANG[$this->var[0]->race]["terrestre"]["noms_sing"][$key]."

";