"; 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.'

'; } if ($chantier_terrestre >= 1) { echo'
Arbre des technologies

'.$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 ($bat == 8) echo '


Chantier terrestre en construction'; else { if ($metal >= 500 && $cristal >= 200) { if ($temps_t < time()) { echo '



'; }} else { if ($unit_t<9 && $unit_t>0) echo '

Construction en cours dans le chantier terrestre'; } } 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 ($bat == 8) echo '


Chantier terrestre en construction'; else { if ($metal >= 4000 && $cristal >= 2000) { if ($temps_t < time()) { echo '



'; }} else { if ($unit_t<9 && $unit_t>0) echo '

Construction en cours dans le chantier terrestre'; } } 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 ($bat == 8) echo '


Chantier terrestre en construction'; else { if ($metal >= 4500 && $cristal >= 800 && $hydrogene >= 600) { if ($temps_t < time()) { echo '



'; }} else { if ($unit_t<9 && $unit_t>0) echo '

Construction en cours dans le chantier terrestre'; } } 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 ($bat == 8) echo '


Chantier terrestre en construction'; else { if ($metal >= 12000 && $cristal >= 10000 && $hydrogene >= 1000) { if ($temps_t < time()) { echo '



'; }} else { if ($unit_t<9 && $unit_t>0) echo '

Construction en cours dans le chantier terrestre'; } } 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'
'; if ($bat == 8) echo '


Chantier terrestre en construction'; else { if ($metal >= 15000 && $cristal >= 9500 && $hydrogene >= 1500) { if ($temps_t < time()) { echo '



'; }} else { if ($unit_t<9 && $unit_t>0) echo '

Construction en cours dans le chantier terrestre'; } } echo '

'; } } else { echo '
Vous devez d\'abord construire un chantier spatial !
'; } ?>