"; require_once 'bdd.php'; require_once 'ressource.php'; require_once 'chantier_terrestre_ajout.php'; require_once 'noms.php'; function sec ($time) { $output = ''; $tab = array ('jour' => '86400', 'heure' => '3600', 'minute' => '60', 'seconde' => '1'); foreach ($tab as $key => $value) { $compteur = 0; while ($time > ($value-1)) { $time = $time - $value; $compteur++; } if ($compteur != 0) { $output .= $compteur.' '.$key; if ($compteur > 1) $output .= 's'; if ($value != 1) $output .= ' '; } } echo $output; } $f = ceil(480/pow(1.25,($chantier_terrestre-1))); $g = ceil(1560/pow(1.25,($chantier_terrestre-3))); $h = ceil(1800/pow(1.25,($chantier_terrestre-4))); $i = ceil(6720/pow(1.25,($chantier_terrestre-4))); $j = ceil(12960/pow(1.25,($chantier_terrestre-8))); if ($temps_t > 0) $unit = $nomterra[--$unit_t]; ?>
0) { if ($temps_t > 0) { echo "Construction terminé dans : "; $tr=$temps_t-time(); echo ''; echo ''; echo ' |
Construction de : '.$cons_terrestre.' '.$unit.' |
'.$nomterrn[8].''; if ($def_1 > 0) echo" (".$def_1." unités)";
echo '
'.$nomterde[8].' Besoin de : '.$ressourc[0].' : 500 '.$ressourc[1].' : 200 Temps de construction : '; sec($f); echo ' ';
echo' '; } if ($chantier_terrestre >= 3 && $energie_t >=2) { echo'
'.$nomterrn[9].''; if ($def_2 > 0) echo" (".$def_2." unités)";
echo '
'.$nomterde[9].' Besoin de : '.$ressourc[0].' : 4.000 '.$ressourc[1].' : 2.000 Temps de construction : '; sec($g); echo ' ';
echo' '; } if ($chantier_terrestre >= 4 && $armement >= 1) { echo'
'.$nomterrn[10].''; if ($def_3 > 0) echo" (".$def_3." unités)";
echo '
'.$nomterde[10].' Besoin de : '.$ressourc[0].' : 4.500 '.$ressourc[1].' : 800 '.$ressourc[2].' : 600 Temps de construction : '; sec($h); echo ' ';
echo' '; } if ($chantier_terrestre >= 4 && $armement >= 3 && $energie_t >= 3) { echo'
'.$nomterrn[11].''; if ($def_4 > 0) echo" (".$def_4." unités)";
echo '
'.$nomterde[11].' Besoin de : '.$ressourc[0].' : 12.000 '.$ressourc[1].' : 10.000 '.$ressourc[2].' : 1.000 Temps de construction : '; sec($i); echo ' ';
echo' '; } if ($chantier_terrestre >= 8 && $armement >= 5 && $informatique >= 4) { echo'
'.$nomterrn[12].''; if ($def_5 > 0) echo" (".$def_5." unités)";
echo '
'.$nomterde[12].' Besoin de : '.$ressourc[0].' : 15.000 '.$ressourc[1].' : 9.500 '.$ressourc[2].' : 1.500 Temps de construction : '; sec($j); echo ' ';
echo' '; } } else { echo '
|