2007-10-27 10:00:00 +00:00
< ? php
session_start ();
$id = $_SESSION [ 'id' ];
$galaxy = $_SESSION [ 'galaxy' ];
$ss = $_SESSION [ 'ss' ];
$pos = $_SESSION [ 'pos' ];
2007-11-20 11:00:00 +00:00
$_SESSION [ 'dernPage' ] = 'chantier_spatial.php' ;
2007-11-04 11:00:00 +00:00
require_once 'bdd.php' ;
2007-11-13 11:00:00 +00:00
require_once ( '../securite.php' );
require_once 'ressourcetem.php' ;
2007-11-04 11:00:00 +00:00
require_once 'noms.php' ;
2007-11-13 11:00:00 +00:00
require ( '../template.php' );
$template = new Template ( '../templates/' . $templates );
function verification_des_ress ( $numtec , $metal , $calcium , $nourriture , $ress_ness_metal , $ress_ness_calcium , $ress_ness_nourriture ) {
if ( $metal >= $ress_ness_metal && $calcium >= $ress_ness_calcium && $nourriture >= $ress_ness_nourriture ) return '<form method="post" action="chantier_spatial_validation.php"><input type="text" class="zone_texte" size="4" maxlength="4" name="sa" /><input type="hidden" name="type" value="' . $numtec . '" /><br /><input type="submit" value="Envoyer" class="bouton"></form>' ;
else return '<font color="red">Vous n\'avez pas suffisament de ressources</font>' ;
}
function ressources ( $fer , $cristal , $ro , $need_fer , $need_cristal , $need_ro ) {
require 'noms.php' ;
$return = '' ;
if ( $need_fer > 0 ) {
if ( $fer <= $need_fer ) {
$z = floor ( $fer ) - $need_fer ;
$return .= '<font color="red">' . $ressourc [ 0 ] . ' : <acronym title="Manque : ' . abs ( $z ) . ' unit<69> s de ' . $ressourc [ 0 ] . '">' . $need_fer . '</acronym></font> ' ;
}
else $return .= $ressourc [ 0 ] . ' : <span class="rc">' . $need_fer . ' </span>' ;
}
if ( $need_cristal > 0 ) {
if ( $cristal <= $need_cristal ) {
$z = floor ( $cristal ) - $need_cristal ;
$return .= '<font color="red">' . $ressourc [ 1 ] . ' : <acronym title="Manque : ' . abs ( $z ) . ' unit<69> s de ' . $ressourc [ 0 ] . '">' . $need_cristal . '</acronym></font> ' ;
}
else $return .= $ressourc [ 1 ] . ' : <span class="rc">' . $need_cristal . ' </span>' ;
}
if ( $need_ro > 0 ) {
if ( $ro <= $need_ro ) {
$z = floor ( $ro ) - $need_ro ;
$return .= '<font color="red">' . $ressourc [ 2 ] . ' : <acronym title="Manque : ' . abs ( $z ) . ' unit<69> s de ' . $ ressourc [ 0 ] . '">' . $need_ro . '</acronym></font>' ;
}
else $return .= $ressourc [ 2 ] . ' : <span class="rc">' . $need_ro . '</span>' ;
}
return $return ;
}
2007-10-27 10:00:00 +00:00
2007-11-13 11:00:00 +00:00
function sec ( $time ) {
2007-10-27 10:00:00 +00:00
$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 .= ' ' ;
}
}
2007-11-13 11:00:00 +00:00
return $output ;
2007-10-27 10:00:00 +00:00
}
2007-11-13 11:00:00 +00:00
2007-11-04 11:00:00 +00:00
$f = ceil ( 1080 / pow ( 1.25 ,( $chantier_spatial - 1 )));
$g = ceil ( 6300 / pow ( 1.25 ,( $chantier_spatial - 5 )));
$h = ceil ( 8280 / pow ( 1.25 ,( $chantier_spatial - 5 )));
2007-11-13 11:00:00 +00:00
$iV = ceil ( 1440 / pow ( 1.25 ,( $chantier_spatial - 3 )));
2007-11-04 11:00:00 +00:00
$j = ceil ( 7380 / pow ( 1.25 ,( $chantier_spatial - 5 )));
$k = ceil ( 1200 / pow ( 1.25 ,( $chantier_spatial - 1 )));
$l = ceil ( 4680 / pow ( 1.25 ,( $chantier_spatial - 3 )));
$m = ceil ( 16800 / pow ( 1.25 ,( $chantier_spatial - 6 )));
2007-11-13 11:00:00 +00:00
$nV = ceil ( 18060 / pow ( 1.25 ,( $chantier_spatial - 6 )));
2007-11-04 11:00:00 +00:00
$p = ceil ( 32400 / pow ( 1.25 ,( $chantier_spatial - 8 )));
$q = ceil ( 117000 / pow ( 1.25 ,( $chantier_spatial - 12 )));
2007-10-27 10:00:00 +00:00
2007-11-04 11:00:00 +00:00
if ( $temps_spatial > 0 ) $unit = $nomvaisa [ -- $unit_s ];
2007-11-13 11:00:00 +00:00
2007-11-04 11:00:00 +00:00
if ( $chantier_spatial > 0 ) {
2007-11-13 11:00:00 +00:00
if ( ! isset ( $_GET [ 'err' ])) $_GET [ 'err' ] = '' ;
$ERREUR = '' ;
if ( $_GET [ 'err' ] == 1 ) $ERREUR = '<div class="centre"><table style="margin-left: auto; margin-right: auto;"><tr><td><font color="#FF0000"><b>Cette technologie est d<> j<EFBFBD> en cours de recherche, vous ne pouvez pas la rajouter dans la file d\'attente</b></font></td></tr></table></div><br />' ;
elseif ( $_GET [ 'err' ] == 2 ) $ERREUR = '<div class="centre"><table style="margin-left: auto; margin-right: auto;"><tr><td><font color="#FFCC00"><b>La production <20> la cha<68> ne a <20> t<EFBFBD> arr<72> t<EFBFBD> e</b></font></td></tr></table></div><br />' ;
elseif ( $_GET [ 'err' ] == 3 ) $ERREUR = '<div class="centre"><table style="margin-left: auto; margin-right: auto;"><tr><td><font color="#FF0000"><b>Vous n\'avez pas assez de ressources pour construire autant de vaisseaux</b></font></td></tr></table></div><br />' ;
2007-10-27 10:00:00 +00:00
2007-11-13 11:00:00 +00:00
$template -> set_filenames ( array ( 'ressourcestpl' => 'ressources.tpl' ));
$template -> assign_vars ( array ( 'RES_IMAGE' => $RES_IMAGE , 'NOM_METAL' => $NOM_METAL , 'NOM_CRISTAL' => $NOM_CRISTAL , 'NOM_HYDROGENE' => $NOM_HYDROGENE , 'NOM_ENERGIE' => $NOM_ENERGIE , 'RES_METAL' => $RES_METAL , 'RES_CRISTAL' => $RES_CRISTAL , 'RES_HYDROGENE' => $RES_HYDROGENE , 'RES_ENERGIE' => $RES_ENERGIE , 'ERREUR' => $ERREUR , 'HEADER' => $HEADER , 'PUB' => $PUB ));
for ( $i = 0 ; $i < count ( $Aplan_value ) ; $i ++ ) {
$template -> assign_block_vars ( 'planetes' , array ( 'RES_VALUE' => $Aplan_value [ $i ], 'RES_MORE' => $Aplan_more [ $i ], 'RES_REF' => $Aplan_ref [ $i ]));
}
2007-11-04 11:00:00 +00:00
2007-11-13 11:00:00 +00:00
$template -> set_filenames ( array ( 'chantier_spatial' => 'chantier_spatial.tpl' ));
$template -> assign_var_from_handle ( 'RESSOURCES' , 'ressourcestpl' );
$CHAINE = '' ;
if ( ! empty ( $fileVai [ 0 ])) {
$comp = 1 ;
for ( $i = 0 ; $i < count ( $fileVai ) ; $i ++ ) {
if ( $fileVai [ $i ] != 'e' ) {
if ( $fileVai [ $i + 1 ] == $fileVai [ $i ]) $comp ++ ;
else {
$template -> assign_block_vars ( 'file' , array ( 'NOM' => $comp . ' ' . $nomvaisa [ $fileVai [ $i ] - 1 ], 'NUM' => $fileVai [ $i ], 'I' => $i ));
$comp = 1 ;
}
2007-11-04 11:00:00 +00:00
2007-11-13 11:00:00 +00:00
}
//else $CHAINE = ' <br /> <a href="annul_tec.php?tec=e"><i>Arr<72> ter de produire <20> la cha<68> ne</i></a>';
}
$FILETXT = '' ;
//if ($i == 1 && $vai_boucle == false) $CHAINE = ' <br /> <a href="construction.php?tec=e"><i>Produire <20> la cha<68> ne</i></a>';
}
else $FILETXT = 'Aucun vaisseau en attente' ;
2007-11-04 11:00:00 +00:00
2007-11-13 11:00:00 +00:00
$tr = $fileTemps_s [ 0 ] + $fileTemps_s [ 1 ] - time ();
if ( ! empty ( $fileVai [ 0 ])) $RESTE = $action = '<script type="text/javascript">reste(' . $tr . ');</script>' ;
else $RESTE = '' ;
2007-11-04 11:00:00 +00:00
2007-11-13 11:00:00 +00:00
$template -> assign_vars ( array ( 'RACE' => $race , 'FILETXT' => $FILETXT , 'CHAINE' => $CHAINE , 'RESTE' => $RESTE ));
2007-11-04 11:00:00 +00:00
2007-11-13 11:00:00 +00:00
$a = 0 ; $b = 0 ; $c = 0 ;
2007-11-04 11:00:00 +00:00
2007-11-13 11:00:00 +00:00
// Vaisseau n<> 1 : Cargos de classe Inquisitor/Transporteur Leger/Cargos de classe Parabola ; planete.vaisseau_1
if ( $chantier_spatial >= 1 && $reacteur >= 4 ) {
$i = 0 ;
$nom_bdd = 'vaisseau_' . ( $i + 1 );
if ( ${$nom_bdd} > 0 ) $niveau = '(' . ${$nom_bdd} . ' vaisseau(x))' ; else $niveau = '' ;
$n = ( ${$nom_bdd} - 1 ); $a = 1000 ; $b = 800 ;
if ( $bat == 9 ) $action = 'Le chantier spatial est en cours d\'<27> volution' ;
else $action = verification_des_ress ( $i + 1 , $metal , $cristal , $hydrogene , $a , $b , $c );
if ( ! empty ( $nomvaisn [ $i ])) $template -> assign_block_vars ( 'vaisseau' , array ( 'IMAGE' => $nomvaisi [ $i ], 'NOM' => $nomvaisn [ $i ], 'NUM' => $i , 'NIVEAU' => $niveau , 'DESCRIPTION' => $nomvaisd [ $i ], 'BESOIN' => ressources ( $metal , $cristal , $hydrogene , $a , $b , $c , $mine_m , $mine_c , $mine_h ), 'TEMPS' => sec ( $f ), 'ACTION' => $action ));
}
2007-11-04 11:00:00 +00:00
2007-11-13 11:00:00 +00:00
// Vaisseau n<> 2 : Cargos de classe Interdictor/Transporteur Lourd/Cargos de classe Laden ; planete.vaisseau_2
if ( $chantier_spatial >= 5 && $reacteur_f >= 2 ) {
$i = 1 ;
$nom_bdd = 'vaisseau_' . ( $i + 1 );
if ( ${$nom_bdd} > 0 ) $niveau = '(' . ${$nom_bdd} . ' vaisseau(x))' ; else $niveau = '' ;
$n = ( ${$nom_bdd} - 1 ); $a = 4000 ; $b = 3000 ;
if ( $bat == 9 ) $action = 'Le chantier spatial est en cours d\'<27> volution' ;
else $action = verification_des_ress ( $i + 1 , $metal , $cristal , $hydrogene , $a , $b , $c );
if ( ! empty ( $nomvaisn [ $i ])) $template -> assign_block_vars ( 'vaisseau' , array ( 'IMAGE' => $nomvaisi [ $i ], 'NOM' => $nomvaisn [ $i ], 'NUM' => $i , 'NIVEAU' => $niveau , 'DESCRIPTION' => $nomvaisd [ $i ], 'BESOIN' => ressources ( $metal , $cristal , $hydrogene , $a , $b , $c , $mine_m , $mine_c , $mine_h ), 'TEMPS' => sec ( $g ), 'ACTION' => $action ));
}
2007-11-04 11:00:00 +00:00
2007-11-13 11:00:00 +00:00
// Vaisseau n<> 3 : Vaisseau de colonisation de classe Returning/Colonisateur/Vaisseaux de colonisation de classe Odyssey ; planete.vaisseau_3
if ( $chantier_spatial >= 5 && $reacteur_ff >= 1 ) {
$i = 2 ;
$nom_bdd = 'vaisseau_' . ( $i + 1 );
if ( ${$nom_bdd} > 0 ) $niveau = '(' . ${$nom_bdd} . ' vaisseau(x))' ; else $niveau = '' ;
$n = ( ${$nom_bdd} - 1 ); $a = 9000 ; $b = 9000 ; $c = 1000 ;
if ( $bat == 9 ) $action = 'Le chantier spatial est en cours d\'<27> volution' ;
else $action = verification_des_ress ( $i + 1 , $metal , $cristal , $hydrogene , $a , $b , $c );
if ( ! empty ( $nomvaisn [ $i ])) $template -> assign_block_vars ( 'vaisseau' , array ( 'IMAGE' => $nomvaisi [ $i ], 'NOM' => $nomvaisn [ $i ], 'NUM' => $i , 'NIVEAU' => $niveau , 'DESCRIPTION' => $nomvaisd [ $i ], 'BESOIN' => ressources ( $metal , $cristal , $hydrogene , $a , $b , $c , $mine_m , $mine_c , $mine_h ), 'TEMPS' => sec ( $h ), 'ACTION' => $action ));
}
2007-11-04 11:00:00 +00:00
2007-11-13 11:00:00 +00:00
// Vaisseau n<> 4 : Sonde de reconnaissance de classe Perception/0/Drones d<> espionnage de classe Clarion ; planete.vaisseau_4
if ( $chantier_spatial >= 3 && $reacteur >= 5 && $detection >= 2 ) {
$i = 3 ;
$nom_bdd = 'vaisseau_' . ( $i + 1 );
if ( ${$nom_bdd} > 0 ) $niveau = '(' . ${$nom_bdd} . ' vaisseau(x))' ; else $niveau = '' ;
$n = ( ${$nom_bdd} - 1 ); $a = 1000 ; $b = 1200 ; $c = 100 ;
if ( $bat == 9 ) $action = 'Le chantier spatial est en cours d\'<27> volution' ;
else $action = verification_des_ress ( $i + 1 , $metal , $cristal , $hydrogene , $a , $b , $c );
if ( ! empty ( $nomvaisn [ $i ])) $template -> assign_block_vars ( 'vaisseau' , array ( 'IMAGE' => $nomvaisi [ $i ], 'NOM' => $nomvaisn [ $i ], 'NUM' => $i , 'NIVEAU' => $niveau , 'DESCRIPTION' => $nomvaisd [ $i ], 'BESOIN' => ressources ( $metal , $cristal , $hydrogene , $a , $b , $c , $mine_m , $mine_c , $mine_h ), 'TEMPS' => sec ( $iV ), 'ACTION' => $action ));
}
2007-11-04 11:00:00 +00:00
2007-11-13 11:00:00 +00:00
// Vaisseau n<> 5 : Charognard/Recycleur/Recycleurs de classe Minotaur ; planete.vaisseau_5
if ( $chantier_spatial >= 5 && $reacteur_f >= 4 && $blindage >= 5 ) {
$i = 4 ;
$nom_bdd = 'vaisseau_' . ( $i + 1 );
if ( ${$nom_bdd} > 0 ) $niveau = '(' . ${$nom_bdd} . ' vaisseau(x))' ; else $niveau = '' ;
$n = ( ${$nom_bdd} - 1 ); $a = 15000 ; $b = 9000 ; $c = 1000 ;
if ( $bat == 9 ) $action = 'Le chantier spatial est en cours d\'<27> volution' ;
else $action = verification_des_ress ( $i + 1 , $metal , $cristal , $hydrogene , $a , $b , $c );
if ( ! empty ( $nomvaisn [ $i ])) $template -> assign_block_vars ( 'vaisseau' , array ( 'IMAGE' => $nomvaisi [ $i ], 'NOM' => $nomvaisn [ $i ], 'NUM' => $i , 'NIVEAU' => $niveau , 'DESCRIPTION' => $nomvaisd [ $i ], 'BESOIN' => ressources ( $metal , $cristal , $hydrogene , $a , $b , $c , $mine_m , $mine_c , $mine_h ), 'TEMPS' => sec ( $j ), 'ACTION' => $action ));
}
2007-11-04 11:00:00 +00:00
2007-11-13 11:00:00 +00:00
// Vaisseau n<> 6 : S<> raphin/Croiseur Forruner/C709 Longsword Interceptor ; planete.vaisseau_6
if ( $chantier_spatial >= 1 && $reacteur >= 4 ) {
$i = 5 ;
$nom_bdd = 'vaisseau_' . ( $i + 1 );
if ( ${$nom_bdd} > 0 ) $niveau = '(' . ${$nom_bdd} . ' vaisseau(x))' ; else $niveau = '' ;
$n = ( ${$nom_bdd} - 1 ); $a = 1700 ; $b = 1220 ;
if ( $bat == 9 ) $action = 'Le chantier spatial est en cours d\'<27> volution' ;
else $action = verification_des_ress ( $i + 1 , $metal , $cristal , $hydrogene , $a , $b , $c );
if ( ! empty ( $nomvaisn [ $i ])) $template -> assign_block_vars ( 'vaisseau' , array ( 'IMAGE' => $nomvaisi [ $i ], 'NOM' => $nomvaisn [ $i ], 'NUM' => $i , 'NIVEAU' => $niveau , 'DESCRIPTION' => $nomvaisd [ $i ], 'BESOIN' => ressources ( $metal , $cristal , $hydrogene , $a , $b , $c , $mine_m , $mine_c , $mine_h ), 'TEMPS' => sec ( $k ), 'ACTION' => $action ));
}
// Vaisseau n<> 7 : Fr<46> gate/Super-Destroyer/Fr<46> gate ; planete.vaisseau_7
if ( $chantier_spatial >= 3 && $reacteur_f >= 3 && $armement >= 1 ) {
$i = 6 ;
$nom_bdd = 'vaisseau_' . ( $i + 1 );
if ( ${$nom_bdd} > 0 ) $niveau = '(' . ${$nom_bdd} . ' vaisseau(x))' ; else $niveau = '' ;
$n = ( ${$nom_bdd} - 1 ); $a = 5800 ; $b = 1400 ;
if ( $bat == 9 ) $action = 'Le chantier spatial est en cours d\'<27> volution' ;
else $action = verification_des_ress ( $i + 1 , $metal , $cristal , $hydrogene , $a , $b , $c );
if ( ! empty ( $nomvaisn [ $i ])) $template -> assign_block_vars ( 'vaisseau' , array ( 'IMAGE' => $nomvaisi [ $i ], 'NOM' => $nomvaisn [ $i ], 'NUM' => $i , 'NIVEAU' => $niveau , 'DESCRIPTION' => $nomvaisd [ $i ], 'BESOIN' => ressources ( $metal , $cristal , $hydrogene , $a , $b , $c , $mine_m , $mine_c , $mine_h ), 'TEMPS' => sec ( $l ), 'ACTION' => $action ));
}
// Vaisseau n<> 8 : Croiseur de classe CCS/Chasseur Leger/Croiseurs de classe Halcyon ; planete.vaisseau_8
if ( $chantier_spatial >= 6 && $reacteur_ff >= 2 && $armement >= 3 && $blindage >= 4 ) {
$i = 7 ;
$nom_bdd = 'vaisseau_' . ( $i + 1 );
if ( ${$nom_bdd} > 0 ) $niveau = '(' . ${$nom_bdd} . ' vaisseau(x))' ; else $niveau = '' ;
$n = ( ${$nom_bdd} - 1 ); $a = 20000 ; $b = 16000 ; $c = 1600 ;
if ( $bat == 9 ) $action = 'Le chantier spatial est en cours d\'<27> volution' ;
else $action = verification_des_ress ( $i + 1 , $metal , $cristal , $hydrogene , $a , $b , $c );
if ( ! empty ( $nomvaisn [ $i ])) $template -> assign_block_vars ( 'vaisseau' , array ( 'IMAGE' => $nomvaisi [ $i ], 'NOM' => $nomvaisn [ $i ], 'NUM' => $i , 'NIVEAU' => $niveau , 'DESCRIPTION' => $nomvaisd [ $i ], 'BESOIN' => ressources ( $metal , $cristal , $hydrogene , $a , $b , $c , $mine_m , $mine_c , $mine_h ), 'TEMPS' => sec ( $m ), 'ACTION' => $action ));
}
// Vaisseau n<> 9 : Croiseur de classe Reverence/Chasseur Lourd/Croiseurs de classe Marathon ; planete.vaisseau_9
if ( $chantier_spatial >= 6 && $reacteur_ff >= 3 && $armement >= 4 && $blindage >= 4 ) {
$i = 8 ;
$nom_bdd = 'vaisseau_' . ( $i + 1 );
if ( ${$nom_bdd} > 0 ) $niveau = '(' . ${$nom_bdd} . ' vaisseau(x))' ; else $niveau = '' ;
$n = ( ${$nom_bdd} - 1 ); $a = 26000 ; $b = 16400 ; $c = 1600 ;
if ( $bat == 9 ) $action = 'Le chantier spatial est en cours d\'<27> volution' ;
else $action = verification_des_ress ( $i + 1 , $metal , $cristal , $hydrogene , $a , $b , $c );
if ( ! empty ( $nomvaisn [ $i ])) $template -> assign_block_vars ( 'vaisseau' , array ( 'IMAGE' => $nomvaisi [ $i ], 'NOM' => $nomvaisn [ $i ], 'NUM' => $i , 'NIVEAU' => $niveau , 'DESCRIPTION' => $nomvaisd [ $i ], 'BESOIN' => ressources ( $metal , $cristal , $hydrogene , $a , $b , $c , $mine_m , $mine_c , $mine_h ), 'TEMPS' => sec ( $nV ), 'ACTION' => $action ));
}
// Vaisseau n<> 10 : Porte vaisseaux/Porte-vaisseaux/Porte vaisseaux ; planete.vaisseau_10
if ( $chantier_spatial >= 8 && $reacteur_ff >= 5 && $armement >= 6 && $blindage >= 6 ) {
$i = 9 ;
$nom_bdd = 'vaisseau_' . ( $i + 1 );
if ( ${$nom_bdd} > 0 ) $niveau = '(' . ${$nom_bdd} . ' vaisseau(x))' ; else $niveau = '' ;
$n = ( ${$nom_bdd} - 1 ); $a = 60000 ; $b = 40000 ; $c = 3000 ;
if ( $bat == 9 ) $action = 'Le chantier spatial est en cours d\'<27> volution' ;
else $action = verification_des_ress ( $i + 1 , $metal , $cristal , $hydrogene , $a , $b , $c );
if ( ! empty ( $nomvaisn [ $i ])) $template -> assign_block_vars ( 'vaisseau' , array ( 'IMAGE' => $nomvaisi [ $i ], 'NOM' => $nomvaisn [ $i ], 'NUM' => $i , 'NIVEAU' => $niveau , 'DESCRIPTION' => $nomvaisd [ $i ], 'BESOIN' => ressources ( $metal , $cristal , $hydrogene , $a , $b , $c , $mine_m , $mine_c , $mine_h ), 'TEMPS' => sec ( $p ), 'ACTION' => $action ));
}
// Vaisseau n<> 11 : Station orbitale covenant/Station orbitale/Station orbitale ; planete.vaisseau_11
if ( $chantier_spatial >= 12 && $reacteur_ff >= 10 && $armement >= 12 && $blindage >= 12 ) {
$i = 10 ;
$nom_bdd = 'vaisseau_' . ( $i + 1 );
if ( ${$nom_bdd} > 0 ) $niveau = '(' . ${$nom_bdd} . ' vaisseau(x))' ; else $niveau = '' ;
$n = ( ${$nom_bdd} - 1 ); $a = 500000 ; $b = 400000 ; $c = 250000 ;
if ( $bat == 9 ) $action = 'Le chantier spatial est en cours d\'<27> volution' ;
else $action = verification_des_ress ( $i + 1 , $metal , $cristal , $hydrogene , $a , $b , $c );
if ( ! empty ( $nomvaisn [ $i ])) $template -> assign_block_vars ( 'vaisseau' , array ( 'IMAGE' => $nomvaisi [ $i ], 'NOM' => $nomvaisn [ $i ], 'NUM' => $i , 'NIVEAU' => $niveau , 'DESCRIPTION' => $nomvaisd [ $i ], 'BESOIN' => ressources ( $metal , $cristal , $hydrogene , $a , $b , $c , $mine_m , $mine_c , $mine_h ), 'TEMPS' => sec ( $q ), 'ACTION' => $action ));
}
// Vaisseau n<> 12 : Super porte vaisseaux/Super porte-vaisseaux/Super porte-vaisseaux ; planete.vaisseau_12
if ( $chantier_spatial >= 12 && $reacteur_ff >= 10 && $armement >= 12 && $blindage >= 12 ) {
$i = 11 ;
$nom_bdd = 'vaisseau_' . ( $i + 1 );
if ( ${$nom_bdd} > 0 ) $niveau = '(' . ${$nom_bdd} . ' vaisseau(x))' ; else $niveau = '' ;
$n = ( ${$nom_bdd} - 1 ); $a = 500000 ; $b = 400000 ; $c = 250000 ;
if ( $bat == 9 ) $action = 'Le chantier spatial est en cours d\'<27> volution' ;
else $action = verification_des_ress ( $i + 1 , $metal , $cristal , $hydrogene , $a , $b , $c );
if ( ! empty ( $nomvaisn [ $i ])) $template -> assign_block_vars ( 'vaisseau' , array ( 'IMAGE' => $nomvaisi [ $i ], 'NOM' => $nomvaisn [ $i ], 'NUM' => $i , 'NIVEAU' => $niveau , 'DESCRIPTION' => $nomvaisd [ $i ], 'BESOIN' => ressources ( $metal , $cristal , $hydrogene , $a , $b , $c , $mine_m , $mine_c , $mine_h ), 'TEMPS' => sec ( $q ), 'ACTION' => $action ));
}
$template -> pparse ( 'chantier_spatial' );
2007-11-04 11:00:00 +00:00
}
2007-11-13 11:00:00 +00:00
else {
$template -> set_filenames ( array ( 'ressourcestpl' => 'ressources.tpl' ));
$template -> assign_vars ( array ( 'RES_IMAGE' => $RES_IMAGE , 'NOM_METAL' => $NOM_METAL , 'NOM_CRISTAL' => $NOM_CRISTAL , 'NOM_HYDROGENE' => $NOM_HYDROGENE , 'NOM_ENERGIE' => $NOM_ENERGIE , 'RES_METAL' => $RES_METAL , 'RES_CRISTAL' => $RES_CRISTAL , 'RES_HYDROGENE' => $RES_HYDROGENE , 'RES_ENERGIE' => $RES_ENERGIE , 'ERREUR' => $ERREUR , 'HEADER' => $HEADER , 'PUB' => $PUB ));
for ( $i = 0 ; $i < count ( $Aplan_value ) ; $i ++ ) {
$template -> assign_block_vars ( 'planetes' , array ( 'RES_VALUE' => $Aplan_value [ $i ], 'RES_MORE' => $Aplan_more [ $i ], 'RES_REF' => $Aplan_ref [ $i ]));
}
2007-10-27 10:00:00 +00:00
2007-11-13 11:00:00 +00:00
$template -> set_filenames ( array ( 'manque' => 'manque.tpl' ));
$template -> assign_var_from_handle ( 'RESSOURCES' , 'ressourcestpl' );
$template -> assign_vars ( array ( 'TEXTE' => 'Vous devez d\'abord construire un chantier spatial !' , 'PUB' => $PUB ));
$template -> pparse ( 'manque' );
}
?>