@@ -190,11 +190,11 @@ |
||
| 190 | 190 | |
| 191 | 191 | //soit on enelve ou on ajoute |
| 192 | 192 | if ($signe == "-") { |
| 193 | - $eau = $this->eau - $eau; |
|
| 194 | - $electricite = $this->electricite - $electricite; |
|
| 195 | - $fer = $this->fer - $fer; |
|
| 196 | - $fuel = $this->fuel - $fuel; |
|
| 197 | - $nourriture = $this->nourriture - $nourriture; |
|
| 193 | + $eau = $this->eau-$eau; |
|
| 194 | + $electricite = $this->electricite-$electricite; |
|
| 195 | + $fer = $this->fer-$fer; |
|
| 196 | + $fuel = $this->fuel-$fuel; |
|
| 197 | + $nourriture = $this->nourriture-$nourriture; |
|
| 198 | 198 | |
| 199 | 199 | if ($eau < 0) $eau = 0; |
| 200 | 200 | if ($electricite < 0) $electricite = 0; |
@@ -320,13 +320,13 @@ discard block |
||
| 320 | 320 | $batiment_construit = $this->getBatimentBase(); |
| 321 | 321 | |
| 322 | 322 | //recuperation de la liste complete des batiments |
| 323 | - $c_all_batiment = $this->getAllBatimentGame(); |
|
| 323 | + $c_all_batiment = $this->getAllBatimentGame(); |
|
| 324 | 324 | |
| 325 | 325 | //boucle qui recupere en tableau le champ pour_construire d'un batiment |
| 326 | 326 | //et compare la liste des batiments qu'il faut pour construire le batiment |
| 327 | 327 | //a ceux qui sont deja construit dans la base |
| 328 | 328 | //si tous les batments qu'il faut son batis on autorise la construction du batiment |
| 329 | - for ($i = 0 ; $i < $c_all_batiment ; $i++) { |
|
| 329 | + for ($i = 0; $i < $c_all_batiment; $i++) { |
|
| 330 | 330 | if (!in_array($this->all_batiment[$i], $batiment_construit)) { |
| 331 | 331 | $query = $dbc1->select("pour_construire") |
| 332 | 332 | ->select("temps_construction") |
@@ -351,7 +351,7 @@ discard block |
||
| 351 | 351 | $ok_construction = false; |
| 352 | 352 | //test si tous les batiments sont construits et on le niveau nécéssaire |
| 353 | 353 | $count = count($pour_construire); |
| 354 | - for ($j = 0 ; $j < $count ; $j++) { |
|
| 354 | + for ($j = 0; $j < $count; $j++) { |
|
| 355 | 355 | if (in_array($pour_construire[$j][1], $batiment_construit)) { |
| 356 | 356 | if ($pour_construire[$j][2] <= $this->getNiveauBatiment($pour_construire[$j][1])) { |
| 357 | 357 | $ok_construction = true; |
@@ -436,8 +436,8 @@ discard block |
||
| 436 | 436 | $finx_batiment = $taille_batiment[0]+$posx_batiment; |
| 437 | 437 | $finy_batiment = $taille_batiment[1]+$posy_batiment; |
| 438 | 438 | |
| 439 | - for ($i = $posy ; $i < $finy ; $i++) { |
|
| 440 | - for ($j = $posx ; $j < $finx ; $j++) { |
|
| 439 | + for ($i = $posy; $i < $finy; $i++) { |
|
| 440 | + for ($j = $posx; $j < $finx; $j++) { |
|
| 441 | 441 | if ((($posx++ >= $posx_batiment) && ($posx++ <= $finx_batiment)) && (($posy++ >= $posy_batiment) && ($posy++ <= $finy_batiment))) { |
| 442 | 442 | FlashMessage::setFlash("Un batiment est déjà présent à cet emplacement, merci d'en choisir un autre"); |
| 443 | 443 | return false; |
@@ -592,7 +592,7 @@ discard block |
||
| 592 | 592 | ->where("ID_".$this->nom_batiment_sql, "=", $this->niveau_batiment+1) |
| 593 | 593 | ->get(); |
| 594 | 594 | |
| 595 | - if ((is_array($query)) && (count($query) > 0)){ |
|
| 595 | + if ((is_array($query)) && (count($query) > 0)) { |
|
| 596 | 596 | foreach ($query as $obj) { |
| 597 | 597 | $this->info_batiment_next = $xml->$nom_batiment_sql->phrase_suivant.$obj->$champ.$xml->$nom_batiment_sql->complement; |
| 598 | 598 | } |
@@ -627,7 +627,7 @@ discard block |
||
| 627 | 627 | $ressource = $this->getRessourceConstruireBatiment($this->nom_batiment_sql, $this->niveau_batiment); |
| 628 | 628 | |
| 629 | 629 | //si pas assez de ressource |
| 630 | - if (($ressource["eau"]["class"] || $ressource["electricite"]["class"] ||$ressource["fer"]["class"] || $ressource["fuel"]["class"]) == "rouge") { |
|
| 630 | + if (($ressource["eau"]["class"] || $ressource["electricite"]["class"] || $ressource["fer"]["class"] || $ressource["fuel"]["class"]) == "rouge") { |
|
| 631 | 631 | FlashMessage::setFlash("Pas assez de ressources pour construire ce batiment"); |
| 632 | 632 | return false; |
| 633 | 633 | } |
@@ -592,7 +592,7 @@ |
||
| 592 | 592 | ->where("ID_".$this->nom_batiment_sql, "=", $this->niveau_batiment+1) |
| 593 | 593 | ->get(); |
| 594 | 594 | |
| 595 | - if ((is_array($query)) && (count($query) > 0)){ |
|
| 595 | + if ((is_array($query)) && (count($query) > 0)) { |
|
| 596 | 596 | foreach ($query as $obj) { |
| 597 | 597 | $this->info_batiment_next = $xml->$nom_batiment_sql->phrase_suivant.$obj->$champ.$xml->$nom_batiment_sql->complement; |
| 598 | 598 | } |