@@ -50,29 +50,29 @@ discard block |
||
50 | 50 | $temps_recrutement = DateHeure::Secondeenheure($obj->temps_recrutement); |
51 | 51 | } |
52 | 52 | |
53 | - $coef = $this->coef_unite*$niveau; |
|
54 | - $coef_ameliorer = $this->coef_unite*($niveau+1); |
|
53 | + $coef = $this->coef_unite * $niveau; |
|
54 | + $coef_ameliorer = $this->coef_unite * ($niveau + 1); |
|
55 | 55 | |
56 | 56 | if ($niveau == 1) $coef = 1; |
57 | 57 | |
58 | 58 | return [ |
59 | 59 | "caracteristique" => [ |
60 | - "attaque" => round($base_carac["attaque"]*$coef), |
|
61 | - "defense" => round($base_carac["defense"]*$coef), |
|
62 | - "resistance" => round($base_carac["resistance"]*$coef), |
|
60 | + "attaque" => round($base_carac["attaque"] * $coef), |
|
61 | + "defense" => round($base_carac["defense"] * $coef), |
|
62 | + "resistance" => round($base_carac["resistance"] * $coef), |
|
63 | 63 | "vitesse" => $base_carac["vitesse"] |
64 | 64 | ], |
65 | 65 | "cout_recruter" => [ |
66 | - "eau" => $ressource["eau"]*$coef, |
|
67 | - "electricite" => $ressource["electricite"]*$coef, |
|
68 | - "fer" => $ressource["fer"]*$coef, |
|
69 | - "fuel" => $ressource["fuel"]*$coef, |
|
66 | + "eau" => $ressource["eau"] * $coef, |
|
67 | + "electricite" => $ressource["electricite"] * $coef, |
|
68 | + "fer" => $ressource["fer"] * $coef, |
|
69 | + "fuel" => $ressource["fuel"] * $coef, |
|
70 | 70 | ], |
71 | 71 | "cout_ameliorer" => [ |
72 | - "eau" => $ressource["eau"]*$coef_ameliorer, |
|
73 | - "electricite" => $ressource["electricite"]*$coef_ameliorer, |
|
74 | - "fer" => $ressource["fer"]*$coef_ameliorer, |
|
75 | - "fuel" => $ressource["fuel"]*$coef_ameliorer, |
|
72 | + "eau" => $ressource["eau"] * $coef_ameliorer, |
|
73 | + "electricite" => $ressource["electricite"] * $coef_ameliorer, |
|
74 | + "fer" => $ressource["fer"] * $coef_ameliorer, |
|
75 | + "fuel" => $ressource["fuel"] * $coef_ameliorer, |
|
76 | 76 | ], |
77 | 77 | "temps_recrutement" => $temps_recrutement |
78 | 78 | ]; |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | $unites = Bataille::getCentreRecherche()->getAllRechercheType($type); |
93 | 93 | |
94 | 94 | //recupérer les caractéristiques de l'unité en question |
95 | - for ($i=0 ; $i<count($unites) ; $i++) { |
|
95 | + for ($i = 0; $i < count($unites); $i++) { |
|
96 | 96 | $unites[$i] += $this->getCaracteristiqueUnite($unites[$i]["recherche"], $unites[$i]["niveau"], $type); |
97 | 97 | $unites[$i] += ["type" => $type]; |
98 | 98 | } |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | $today = Bataille::getToday(); |
114 | 114 | |
115 | 115 | foreach ($query as $obj) { |
116 | - if ($obj->date_fin-$today <= 0) { |
|
116 | + if ($obj->date_fin - $today <= 0) { |
|
117 | 117 | |
118 | 118 | } |
119 | 119 | else { |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | "nom" => $nom, |
130 | 130 | "type" => $type, |
131 | 131 | "nombre" => $nombre, |
132 | - "date_fin_recrutement" => $date_fin-$today, |
|
132 | + "date_fin_recrutement" => $date_fin - $today, |
|
133 | 133 | "id_recrutement" => $id_recrutement |
134 | 134 | ]; |
135 | 135 | |
@@ -166,17 +166,17 @@ discard block |
||
166 | 166 | |
167 | 167 | //on test si on a assez de ressource pour recruter les unites |
168 | 168 | //on test si assez de ressources dans la base |
169 | - $retirer_eau = $pour_recruter["eau"]*$nombre; |
|
170 | - $retirer_electricite = $pour_recruter["electricite"]*$nombre; |
|
171 | - $retirer_fer = $pour_recruter["fer"]*$nombre; |
|
172 | - $retirer_fuel = $pour_recruter["fuel"]*$nombre; |
|
169 | + $retirer_eau = $pour_recruter["eau"] * $nombre; |
|
170 | + $retirer_electricite = $pour_recruter["electricite"] * $nombre; |
|
171 | + $retirer_fer = $pour_recruter["fer"] * $nombre; |
|
172 | + $retirer_fuel = $pour_recruter["fuel"] * $nombre; |
|
173 | 173 | $eau = Bataille::getTestAssezRessourceBase("eau", $retirer_eau); |
174 | 174 | $electricite = Bataille::getTestAssezRessourceBase("electricite", $retirer_electricite); |
175 | 175 | $fer = Bataille::getTestAssezRessourceBase("fer", $retirer_fer); |
176 | 176 | $fuel = Bataille::getTestAssezRessourceBase("fuel", $retirer_fuel); |
177 | 177 | |
178 | 178 | |
179 | - if (($eau["class"] || $electricite["class"] || $fer["class"] || $fuel["class"]) == "rouge" ) { |
|
179 | + if (($eau["class"] || $electricite["class"] || $fer["class"] || $fuel["class"]) == "rouge") { |
|
180 | 180 | FlashMessage::setFlash("Pas assez de ressources pour recruter autant d'unités"); |
181 | 181 | return false; |
182 | 182 | } |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | //on retire les ressources |
185 | 185 | Bataille::getRessource()->setUpdateRessource($retirer_eau, $retirer_electricite, $retirer_fer, $retirer_fuel, 0, "-"); |
186 | 186 | |
187 | - $date_fin = Bataille::getToday()+($temps_recrutement*$nombre); |
|
187 | + $date_fin = Bataille::getToday() + ($temps_recrutement * $nombre); |
|
188 | 188 | |
189 | 189 | $dbc->insert("nom", $nom) |
190 | 190 | ->insert("type", $type) |