@@ -328,13 +328,13 @@ discard block |
||
328 | 328 | $batiment_construit = $this->getBatimentBase(); |
329 | 329 | |
330 | 330 | //recuperation de la liste complete des batiments |
331 | - $c_all_batiment = $this->getAllBatimentGame(); |
|
331 | + $c_all_batiment = $this->getAllBatimentGame(); |
|
332 | 332 | |
333 | 333 | //boucle qui recupere en tableau le champ pour_construire d'un batiment |
334 | 334 | //et compare la liste des batiments qu'il faut pour construire le batiment |
335 | 335 | //a ceux qui sont deja construit dans la base |
336 | 336 | //si tous les batments qu'il faut son batis on autorise la construction du batiment |
337 | - for ($i = 0 ; $i < $c_all_batiment ; $i++) { |
|
337 | + for ($i = 0; $i < $c_all_batiment; $i++) { |
|
338 | 338 | if (!in_array($this->all_batiment[$i], $batiment_construit)) { |
339 | 339 | $query = $dbc1->select("pour_construire") |
340 | 340 | ->select("temps_construction") |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | $ok_construction = false; |
359 | 359 | //test si tous les batiments sont construits et on le niveau nécéssaire |
360 | 360 | $count = count($pour_construire); |
361 | - for ($j = 0 ; $j < $count ; $j++) { |
|
361 | + for ($j = 0; $j < $count; $j++) { |
|
362 | 362 | if (in_array($pour_construire[$j][1], $batiment_construit)) { |
363 | 363 | if ($pour_construire[$j][2] <= $this->getNiveauBatiment($pour_construire[$j][1])) { |
364 | 364 | $ok_construction = true; |
@@ -443,8 +443,8 @@ discard block |
||
443 | 443 | $finx_batiment = $taille_batiment[0]+$posx_batiment; |
444 | 444 | $finy_batiment = $taille_batiment[1]+$posy_batiment; |
445 | 445 | |
446 | - for ($i = $posy ; $i < $finy ; $i++) { |
|
447 | - for ($j = $posx ; $j < $finx ; $j++) { |
|
446 | + for ($i = $posy; $i < $finy; $i++) { |
|
447 | + for ($j = $posx; $j < $finx; $j++) { |
|
448 | 448 | if ((($posx++ >= $posx_batiment) && ($posx++ <= $finx_batiment)) && (($posy++ >= $posy_batiment) && ($posy++ <= $finy_batiment))) { |
449 | 449 | FlashMessage::setFlash("Un batiment est déjà présent à cet emplacement, merci d'en choisir un autre"); |
450 | 450 | return false; |
@@ -630,7 +630,7 @@ discard block |
||
630 | 630 | $ressource = $this->getRessourceConstruireBatiment($this->nom_batiment_sql, $this->niveau_batiment); |
631 | 631 | |
632 | 632 | //si pas assez de ressource |
633 | - if (($ressource["eau"]["class"] || $ressource["electricite"]["class"] ||$ressource["fer"]["class"] || $ressource["fuel"]["class"]) == "rouge") { |
|
633 | + if (($ressource["eau"]["class"] || $ressource["electricite"]["class"] || $ressource["fer"]["class"] || $ressource["fuel"]["class"]) == "rouge") { |
|
634 | 634 | FlashMessage::setFlash("Pas assez de ressources pour construire ce batiment"); |
635 | 635 | return false; |
636 | 636 | } |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | * fonction qui renvoi la durée écoulée depuis le dernier check de la nourriture |
39 | 39 | */ |
40 | 40 | private function getLastCheckNourriture() { |
41 | - $dbc= App::getDb(); |
|
41 | + $dbc = App::getDb(); |
|
42 | 42 | |
43 | 43 | $query = $dbc->select("last_check_nourriture")->from("_bataille_base") |
44 | 44 | ->where("ID_identite", "=", Bataille::getIdIdentite(), "AND") |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | $nourriture_base = Bataille::getRessource()->getNourriture(); |
120 | 120 | $nourriture_consommee = ($nb_unite*$this->getConsommationNourritureUnite())*$nb_heure; |
121 | 121 | |
122 | - $nourriture_retirer = $nourriture_base - $nourriture_consommee; |
|
122 | + $nourriture_retirer = $nourriture_base-$nourriture_consommee; |
|
123 | 123 | |
124 | 124 | if ($nourriture_retirer < 0) { |
125 | 125 | $unite_tuer = abs(round($nourriture_retirer/100)); |