forked from halo-battle/game
Version 2007-11-09
This commit is contained in:
parent
d08fb34825
commit
e0f55450e1
87 changed files with 513 additions and 741 deletions
|
|
@ -6,51 +6,47 @@ $galaxy=$_SESSION['galaxy'];
|
|||
$ss=$_SESSION['ss'];
|
||||
$pos=$_SESSION['pos'];
|
||||
|
||||
echo"<html>
|
||||
<head>
|
||||
<title>Halo battle</title>
|
||||
|
||||
<link rel=stylesheet media=screen type=text/css title=design href=descriptions/diz/base.css >
|
||||
<meta http-equiv=pragma content=no-cache >
|
||||
<meta http-equiv=content-type content=text/html;charset=iso-8869-1 >
|
||||
<link rel=shortcut icon type=image/x-icon href=favicon.ico >";
|
||||
|
||||
require_once 'bdd.php';
|
||||
require_once 'ressource.php';
|
||||
require_once 'laboratoire_ajout.php';
|
||||
require_once 'noms.php';
|
||||
//require_once('../securite.php');
|
||||
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) echo "<br><br><br><font color=teal><a href=\"construction.php?tec=".$numtec."\">Construire</a></font>";
|
||||
else echo "<br><br><br><font color=red>Construire</font>";
|
||||
if ($metal >= $ress_ness_metal && $calcium >= $ress_ness_calcium && $nourriture >= $ress_ness_nourriture) return '<br /><br /><br /><br /><font color="teal"><a href="construction.php?tec='.$numtec.'">Construire</a></font>';
|
||||
else return '<br /><br /><br /><font color="red">Construire</font>';
|
||||
}
|
||||
|
||||
function ressources($fer, $cristal, $ro, $need_fer, $need_cristal, $need_ro) {
|
||||
require 'noms.php';
|
||||
require 'noms.php';
|
||||
$return = '';
|
||||
if ($need_fer > 0) {
|
||||
if ($fer <= $need_fer) {
|
||||
$z=floor($fer)-$need_fer;
|
||||
echo '<font color=red >'.$ressourc[0].' : <ACRONYM title="'.$z.'">'.$need_fer.'</ACRONYM></font> ';
|
||||
$return .= '<font color="red">'.$ressourc[0].' : <acronym title="Manque : '.abs($z).' unités de '.$ressourc[0].'">'.$need_fer.'</acronym></font> ';
|
||||
}
|
||||
else echo $ressourc[0].' : <span class=rc>'.$need_fer.' </span>';
|
||||
else $return .= $ressourc[0].' : <span class="rc">'.$need_fer.' </span>';
|
||||
}
|
||||
if ($need_cristal > 0) {
|
||||
if ($cristal <= $need_cristal) {
|
||||
$z=floor($cristal)-$need_cristal;
|
||||
echo '<font color=red >'.$ressourc[1].' : <ACRONYM title="'.$z.'">'.$need_cristal.'</ACRONYM></font> ';
|
||||
$return .= '<font color="red">'.$ressourc[1].' : <acronym title="Manque : '.abs($z).' unités de '.$ressourc[0].'">'.$need_cristal.'</acronym></font> ';
|
||||
}
|
||||
else echo $ressourc[1].' : <span class=rc>'.$need_cristal.' </span>';
|
||||
else $return .= $ressourc[1].' : <span class="rc">'.$need_cristal.' </span>';
|
||||
}
|
||||
if ($need_ro > 0) {
|
||||
if ($ro <= $need_ro) {
|
||||
$z=floor($ro)-$need_ro;
|
||||
echo '<font color=red >'.$ressourc[2].' : <ACRONYM title="'.$z.'">'.$need_ro.'</ACRONYM></font>';
|
||||
$return .= '<font color="red">'.$ressourc[2].' : <acronym title="Manque : '.abs($z).' unités de '.$ressourc[0].'">'.$need_ro.'</acronym></font>';
|
||||
}
|
||||
else echo $ressourc[2].' : <span class=rc>'.$need_ro.'</span>';
|
||||
else $return .= $ressourc[2].' : <span class="rc">'.$need_ro.'</span>';
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
function sec ($time) {
|
||||
function sec($time) {
|
||||
$output = '';
|
||||
$tab = array ('jour' => '86400', 'heure' => '3600', 'minute' => '60', 'seconde' => '1');
|
||||
foreach ($tab as $key => $value) {
|
||||
|
|
@ -65,336 +61,173 @@ function sec ($time) {
|
|||
if ($value != 1) $output .= ' ';
|
||||
}
|
||||
}
|
||||
echo $output;
|
||||
return $output;
|
||||
}
|
||||
?>
|
||||
<script language="javascript" src="time.js"></script>
|
||||
</head>
|
||||
<?php
|
||||
|
||||
if ($labo > 0) {
|
||||
$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));
|
||||
$template->assign_block_vars('planetes',array('RES_VALUE' => $Aplan_value, 'RES_MORE' => $Aplan_more, 'RES_REF' => $Aplan_ref));
|
||||
|
||||
$template->set_filenames(array('labo' => 'laboratoire.tpl'));
|
||||
$template->assign_var_from_handle('RESSOURCES', 'ressourcestpl');
|
||||
$template->assign_vars( array('RACE' => $race));
|
||||
|
||||
// Technologie n°1 : Informatique/Informatique/IA ; user.informatique
|
||||
if ($labo >= 1) {
|
||||
echo'<div class=d><a href="arbre_techno_'.$race.'.php">Arbre des technologies</a></div>
|
||||
<br class="a">
|
||||
<div class="centre"><table style="margin-left: auto; margin-right: auto;"><tr><td style="border:none; background: transparent;">
|
||||
<div class="a">
|
||||
<img src="images/technologies/'.$technoli[0].'" alt="" />
|
||||
</div>
|
||||
<div class="b">
|
||||
<a href=\"descriptions/.php\">'.$technolo[0].'</a> '; if ($informatique > 0) echo '(Niveau '.$informatique.')';
|
||||
echo '<br><span class="description">'.$technode[0].'</span><br>
|
||||
Besoin de : ';
|
||||
$n=($informatique-1);
|
||||
$b=ceil(pow(2,$n)*500);
|
||||
$c=ceil(pow(2,$n)*150);
|
||||
ressources($metal, $cristal, $hydrogene, 0, $b, $c, $mine_m, $mine_c, $mine_h); echo '<br>
|
||||
Temps de construction : '; sec(ceil((420*2*($informatique+1))/pow(1.25,($labo-1))));
|
||||
echo '</div>
|
||||
<div class="c">';
|
||||
if ($temps_tec > 0) {
|
||||
if ($tec==1) {
|
||||
$tr=$temps_tec-time();
|
||||
echo '<br><br><br><span id="axion"></span><br>';
|
||||
echo '<script language="JavaScript">reste('.$tr.');</script>';
|
||||
echo "<a href=\"anul_tec.php?tec=1\">Annuler</a>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
if($bat == 7) echo "<br><br><br>Le laboratoire est en cours d'évolution";
|
||||
else verification_des_ress(1, $metal, $cristal, $hydrogene, 0, $b, $c);
|
||||
}
|
||||
echo '</div>
|
||||
<br class="a">'; }
|
||||
$i = 0;
|
||||
$nom_bdd = 'informatique';
|
||||
if (${$nom_bdd} > 0) $niveau = '(Niveau '.${$nom_bdd}.')'; else $niveau = '';
|
||||
$n=(${$nom_bdd}-1); $b=ceil(pow(2,$n)*500); $c=ceil(pow(2,$n)*150);
|
||||
if ($temps_tec > 0 && $tec == $i+1) { $tr=$temps_tec-time(); $action = '<br /><br /><br /><span id="axion"></span><br><script type="text/javascript">reste('.$tr.');</script><a href="anul_tec.php?tec='.($i+1).'">Annuler</a>'; }
|
||||
elseif($bat == 7) $action = '<br /><br /><br />Le laboratoire est en cours d\'évolution';
|
||||
else $action = verification_des_ress($i+1, $metal, $cristal, $hydrogene, 0, $b, $c);
|
||||
if (!empty($technolo[$i])) $template->assign_block_vars('technologie', array('IMAGE' => $technoli[$i], 'NOM' => $technolo[$i], 'NUM' => $i, 'NIVEAU' => $niveau, 'DESCRIPTION' => $technode[$i], 'BESOIN' => ressources($metal, $cristal, $hydrogene, 0, $b, $c, $mine_m, $mine_c, $mine_h), 'TEMPS' => sec(ceil((420*2*($informatique+1))/pow(1.25,($labo-1)))), 'ACTION' => $action));
|
||||
}
|
||||
|
||||
// Technologie n°2 : Detection/Detection/Radar ; user.detection
|
||||
if ($labo >= 2 && $informatique >=2) {
|
||||
echo'<div class="a">
|
||||
<img src="images/technologies/'.$technoli[1].'" alt="" />
|
||||
</div>
|
||||
<div class="b">
|
||||
<a href=\"descriptions/.php\">'.$technolo[1].'</a> '; if ($detection > 0) echo '(Niveau '.$detection.')';
|
||||
echo '<br><span class="description">'.$technode[1].'</span><br>
|
||||
Besoin de : ';
|
||||
$n=($detection-1);
|
||||
$a=ceil(pow(2,$n)*500);
|
||||
$b=ceil(pow(2,$n)*750);
|
||||
$c=ceil(pow(2,$n)*100);
|
||||
ressources($metal, $cristal, $hydrogene, $a, $b, $c, $mine_m, $mine_c, $mine_h); echo '<br>
|
||||
Temps de construction : '; sec(ceil((600*2*($detection+1))/pow(1.25,($labo-2))));
|
||||
echo '</div>
|
||||
<div class="c">';
|
||||
if ($temps_tec > 0) {
|
||||
if ($tec==2) {
|
||||
$tr=$temps_tec-time();
|
||||
echo '<br><br><br><span id="axion"></span><br>';
|
||||
echo '<script language="JavaScript">reste('.$tr.');</script>';
|
||||
echo "<a href=\"anul_tec.php?tec=2\">Annuler</a>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
if($bat == 7) echo "<br><br><br>Le laboratoire est en cours d'évolution";
|
||||
else verification_des_ress(2, $metal, $cristal, $hydrogene, $a, $b, $c);
|
||||
}
|
||||
echo '</div>
|
||||
<br class="a">'; }
|
||||
$i = 1;
|
||||
$nom_bdd = 'detection';
|
||||
if (${$nom_bdd} > 0) $niveau = '(Niveau '.${$nom_bdd}.')'; else $niveau = '';
|
||||
$n=(${$nom_bdd}-1); $a=ceil(pow(2,$n)*500); $b=ceil(pow(2,$n)*750); $c=ceil(pow(2,$n)*100);
|
||||
if ($temps_tec > 0 && $tec == $i+1) { $tr=$temps_tec-time(); $action = '<br /><br /><br /><span id="axion"></span><br><script type="text/javascript">reste('.$tr.');</script><a href="anul_tec.php?tec='.($i+1).'">Annuler</a>'; }
|
||||
elseif($bat == 7) $action = '<br /><br /><br />Le laboratoire est en cours d\'évolution';
|
||||
else $action = verification_des_ress($i+1, $metal, $cristal, $hydrogene, $a, $b, $c);
|
||||
if (!empty($technolo[$i])) $template->assign_block_vars('technologie', array('TEMPS' => sec(ceil((600*2*($detection+1))/pow(1.25,($labo-2)))), 'BESOIN' => ressources($metal, $cristal, $hydrogene, $a, $b, $c, $mine_m, $mine_c, $mine_h), 'IMAGE' => $technoli[$i], 'NOM' => $technolo[$i], 'NUM' => $i, 'NIVEAU' => $niveau, 'DESCRIPTION' => $technode[$i], 'ACTION' => $action));
|
||||
}
|
||||
|
||||
// Technologie n°3 : Armement/Armement/Armement ; user.armement
|
||||
if ($labo >= 5) {
|
||||
echo'<div class="a">
|
||||
<img src="images/technologies/'.$technoli[2].'" alt="" />
|
||||
</div>
|
||||
<div class="b">
|
||||
<a href=\"descriptions/.php\">'.$technolo[2].'</a> '; if ($armement > 0) echo '(Niveau '.$armement.')';
|
||||
echo '<br><span class="description">'.$technode[2].'</span><br>
|
||||
Besoin de : ';
|
||||
$n=($armement-1);
|
||||
$a=ceil(pow(2,$n)*2500);
|
||||
$b=ceil(pow(2,$n)*500);
|
||||
ressources($metal, $cristal, $hydrogene, $a, $b, 0, $mine_m, $mine_c, $mine_h); echo '<br>
|
||||
Temps de construction : '; sec(ceil((1500*2*($armement+1))/pow(1.25,($labo-5))));
|
||||
echo '</div>
|
||||
<div class="c">';
|
||||
if ($temps_tec > 0) {
|
||||
if ($tec==3) {
|
||||
$tr=$temps_tec-time();
|
||||
echo '<br><br><br><span id="axion"></span><br>';
|
||||
echo '<script language="JavaScript">reste('.$tr.');</script>';
|
||||
echo "<a href=\"anul_tec.php?tec=3\">Annuler</a>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
if($bat == 7) echo "<br><br><br>Le laboratoire est en cours d'évolution";
|
||||
else verification_des_ress(3, $metal, $cristal, $hydrogene, $a, $b, 0);
|
||||
}
|
||||
echo '</div>
|
||||
<br class="a">'; }
|
||||
$i = 2;
|
||||
$nom_bdd = 'armement';
|
||||
if (${$nom_bdd} > 0) $niveau = '(Niveau '.${$nom_bdd}.')'; else $niveau = '';
|
||||
$n=(${$nom_bdd}-1); $a=ceil(pow(2,$n)*2500); $b=ceil(pow(2,$n)*500);
|
||||
if ($temps_tec > 0 && $tec == $i+1) { $tr=$temps_tec-time(); $action = '<br /><br /><br /><span id="axion"></span><br><script type="text/javascript">reste('.$tr.');</script><a href="anul_tec.php?tec='.($i+1).'">Annuler</a>'; }
|
||||
elseif($bat == 7) $action = '<br /><br /><br />Le laboratoire est en cours d\'évolution';
|
||||
else $action = verification_des_ress($i+1, $metal, $cristal, $hydrogene, $a, $b, $c);
|
||||
if (!empty($technolo[$i])) $template->assign_block_vars('technologie', array('TEMPS' => sec(ceil((1500*2*($armement+1))/pow(1.25,($labo-5)))), 'BESOIN' => ressources($metal, $cristal, $hydrogene, $a, $b, 0, $mine_m, $mine_c, $mine_h), 'IMAGE' => $technoli[$i], 'NOM' => $technolo[$i], 'NUM' => $i, 'NIVEAU' => $niveau, 'DESCRIPTION' => $technode[$i], 'ACTION' => $action));
|
||||
}
|
||||
|
||||
// Technologie n°4 : Bouclier/Bouclier/Blindage ; user.blindage
|
||||
if ($labo >= 4) {
|
||||
echo'<div class="a">
|
||||
<img src="images/technologies/'.$technoli[3].'" alt="" />
|
||||
</div>
|
||||
<div class="b">
|
||||
<a href=\"descriptions/.php\">'.$technolo[3].'</a> '; if ($blindage > 0) echo '(Niveau '.$blindage.')';
|
||||
echo '<br><span class="description">'.$technode[3].'</span><br>
|
||||
Besoin de : ';
|
||||
$n=($blindage-1);
|
||||
$a=ceil(pow(2,$n)*4000);
|
||||
$b=ceil(pow(2,$n)*1500);
|
||||
ressources($metal, $cristal, $hydrogene, $a, $b, 0, $mine_m, $mine_c, $mine_h); echo '<br>
|
||||
Temps de construction : '; sec(ceil((1710*2*($blindage+1))/pow(1.25,($labo-4))));
|
||||
echo '</div>
|
||||
<div class="c">';
|
||||
if ($temps_tec > 0) {
|
||||
if ($tec==4) {
|
||||
$tr=$temps_tec-time();
|
||||
echo '<br><br><br><span id="axion"></span><br>';
|
||||
echo '<script language="JavaScript">reste('.$tr.');</script>';
|
||||
echo "<a href=\"anul_tec.php?tec=4\">Annuler</a>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
if($bat == 7) echo "<br><br><br>Le laboratoire est en cours d'évolution";
|
||||
else verification_des_ress(4, $metal, $cristal, $hydrogene, $a, $b, 0);
|
||||
}
|
||||
echo '</div>
|
||||
<br class="a">'; }
|
||||
|
||||
$i = 3;
|
||||
$nom_bdd = 'blindage';
|
||||
$n=(${$nom_bdd}-1);
|
||||
if (${$nom_bdd} > 0) $niveau = '(Niveau '.${$nom_bdd}.')'; else $niveau = '';
|
||||
$a=ceil(pow(2,$n)*4000); $b=ceil(pow(2,$n)*1500);
|
||||
if ($temps_tec > 0 && $tec == $i+1) { $tr=$temps_tec-time(); $action = '<br /><br /><br /><span id="axion"></span><br><script type="text/javascript">reste('.$tr.');</script><a href="anul_tec.php?tec='.($i+1).'">Annuler</a>'; }
|
||||
elseif($bat == 7) $action = '<br /><br /><br />Le laboratoire est en cours d\'évolution';
|
||||
else $action = verification_des_ress($i+1, $metal, $cristal, $hydrogene, $a, $b, $c);
|
||||
if (!empty($technolo[$i])) $template->assign_block_vars('technologie', array('TEMPS' => sec(ceil((1710*2*($blindage+1))/pow(1.25,($labo-4)))), 'BESOIN' => ressources($metal, $cristal, $hydrogene, $a, $b, 0, $mine_m, $mine_c, $mine_h), 'IMAGE' => $technoli[$i], 'NOM' => $technolo[$i], 'NUM' => $i, 'NIVEAU' => $niveau, 'DESCRIPTION' => $technode[$i], 'ACTION' => $action));
|
||||
}
|
||||
|
||||
// Technologie n°5 : Maitrise de l'énergie/Maitrise de l'énergie/Maitrise de l'énergie ; user.energie_t
|
||||
if ($labo >= 2) {
|
||||
echo'<div class="a">
|
||||
<img src="images/technologies/'.$technoli[4].'" alt="" />
|
||||
</div>
|
||||
<div class="b">
|
||||
<a href=\"descriptions/.php\">'.$technolo[4].'</a> '; if ($energie_t > 0) echo '(Niveau '.$energie_t.')';
|
||||
echo '<br><span class="description">'.$technode[4].'</span><br>
|
||||
Besoin de : ';
|
||||
$n=($energie_t-1);
|
||||
$a=ceil(pow(2,$n)*2000);
|
||||
$b=ceil(pow(2,$n)*1500);
|
||||
$c=ceil(pow(2,$n)*300);
|
||||
ressources($metal, $cristal, $hydrogene, $a, $b, $c, $mine_m, $mine_c, $mine_h); echo '<br>
|
||||
Temps de construction : '; sec(ceil((900*2*($energie_t+1))/pow(1.25,($labo-2))));
|
||||
echo '</div>
|
||||
<div class="c">';
|
||||
if ($temps_tec > 0) {
|
||||
if ($tec==5) {
|
||||
$tr=$temps_tec-time();
|
||||
echo '<br><br><br><span id="axion"></span><br>';
|
||||
echo '<script language="JavaScript">reste('.$tr.');</script>';
|
||||
echo "<a href=\"anul_tec.php?tec=5\">Annuler</a>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
if($bat == 7) echo "<br><br><br>Le laboratoire est en cours d'évolution";
|
||||
else verification_des_ress(5, $metal, $cristal, $hydrogene, $a, $b, $c);
|
||||
}
|
||||
echo '</div>
|
||||
<br class="a">'; }
|
||||
$i = 4;
|
||||
$nom_bdd = 'energie_t';
|
||||
$n=(${$nom_bdd}-1);
|
||||
if (${$nom_bdd} > 0) $niveau = '(Niveau '.${$nom_bdd}.')'; else $niveau = '';
|
||||
$a=ceil(pow(2,$n)*2000); $b=ceil(pow(2,$n)*1500); $c=ceil(pow(2,$n)*300);
|
||||
if ($temps_tec > 0 && $tec == $i+1) { $tr=$temps_tec-time(); $action = '<br /><br /><br /><span id="axion"></span><br><script type="text/javascript">reste('.$tr.');</script><a href="anul_tec.php?tec='.($i+1).'">Annuler</a>'; }
|
||||
elseif($bat == 7) $action = '<br /><br /><br />Le laboratoire est en cours d\'évolution';
|
||||
else $action = verification_des_ress($i+1, $metal, $cristal, $hydrogene, $a, $b, $c);
|
||||
if (!empty($technolo[$i])) $template->assign_block_vars('technologie', array('TEMPS' => sec(ceil((900*2*($energie_t+1))/pow(1.25,($labo-2)))), 'BESOIN' => ressources($metal, $cristal, $hydrogene, $a, $b, $c, $mine_m, $mine_c, $mine_h), 'IMAGE' => $technoli[$i], 'NOM' => $technolo[$i], 'NUM' => $i, 'NIVEAU' => $niveau, 'DESCRIPTION' => $technode[$i], 'ACTION' => $action));
|
||||
}
|
||||
|
||||
// Technologie n°6 : Réacteur à antigravité/Réacteur à antigravité/Réacteur à combustion ; user.energie_t
|
||||
if ($labo >= 2) {
|
||||
echo'<div class="a">
|
||||
<img src="images/technologies/'.$technoli[5].'" alt="" />
|
||||
</div>
|
||||
<div class="b">
|
||||
<a href=\"descriptions/.php\">'.$technolo[5].'</a> '; if ($reacteur > 0) echo '(Niveau '.$reacteur.')';
|
||||
echo '<br><span class="description">'.$technode[5].'</span><br>
|
||||
Besoin de : ';
|
||||
$n=($reacteur-1);
|
||||
$a=ceil(pow(2,$n)*1400);
|
||||
$b=ceil(pow(2,$n)*400);
|
||||
ressources($metal, $cristal, $hydrogene, $a, $b, 0, $mine_m, $mine_c, $mine_h); echo '<br>
|
||||
Temps de construction : '; sec(ceil((510*2*($reacteur+1))/pow(1.25,($labo-2))));
|
||||
echo '</div>
|
||||
<div class="c">';
|
||||
if ($temps_tec > 0) {
|
||||
if ($tec==6) {
|
||||
$tr=$temps_tec-time();
|
||||
echo '<br><br><br><span id="axion"></span><br>';
|
||||
echo '<script language="JavaScript">reste('.$tr.');</script>';
|
||||
echo "<a href=\"anul_tec.php?tec=6\">Annuler</a>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
if($bat == 7) echo "<br><br><br>Le laboratoire est en cours d'évolution";
|
||||
else verification_des_ress(6, $metal, $cristal, $hydrogene, $a, $b, 0);
|
||||
}
|
||||
echo '</div>
|
||||
<br class="a">'; }
|
||||
$i = 5;
|
||||
$nom_bdd = 'reacteur';
|
||||
$n=(${$nom_bdd}-1);
|
||||
if (${$nom_bdd} > 0) $niveau = '(Niveau '.${$nom_bdd}.')'; else $niveau = '';
|
||||
$a=ceil(pow(2,$n)*1400); $b=ceil(pow(2,$n)*400);
|
||||
if ($temps_tec > 0 && $tec == $i+1) { $tr=$temps_tec-time(); $action = '<br /><br /><br /><span id="axion"></span><br><script type="text/javascript">reste('.$tr.');</script><a href="anul_tec.php?tec='.($i+1).'">Annuler</a>'; }
|
||||
elseif($bat == 7) $action = '<br /><br /><br />Le laboratoire est en cours d\'évolution';
|
||||
else $action = verification_des_ress($i+1, $metal, $cristal, $hydrogene, $a, $b, $c);
|
||||
if (!empty($technolo[$i])) $template->assign_block_vars('technologie', array('TEMPS' => sec(ceil((510*2*($reacteur+1))/pow(1.25,($labo-2)))), 'BESOIN' => ressources($metal, $cristal, $hydrogene, $a, $b, 0, $mine_m, $mine_c, $mine_h), 'IMAGE' => $technoli[$i], 'NOM' => $technolo[$i], 'NUM' => $i, 'NIVEAU' => $niveau, 'DESCRIPTION' => $technode[$i], 'ACTION' => $action));
|
||||
}
|
||||
|
||||
if ($labo >= 4 && $energie_t >=2 && $reacteur >= 4) {
|
||||
echo'<div class="a">
|
||||
<img src="images/technologies/'.$technoli[6].'" alt="" />
|
||||
</div>
|
||||
<div class="b">
|
||||
<a href=\"descriptions/.php\">'.$technolo[6].'</a> '; if ($reacteur_f > 0) echo '(Niveau '.$reacteur_f.')';
|
||||
echo '<br><span class="description">'.$technode[6].'</span><br>
|
||||
Besoin de : ';
|
||||
$n=($reacteur_f-1);
|
||||
$a=ceil(pow(2,$n)*3000);
|
||||
$b=ceil(pow(2,$n)*2100);
|
||||
$c=ceil(pow(2,$n)*750);
|
||||
ressources($metal, $cristal, $hydrogene, $a, $b, $c, $mine_m, $mine_c, $mine_h); echo '<br>
|
||||
Temps de construction : '; sec(ceil((1650*2*($reacteur_f+1))/pow(1.25,($labo-4))));
|
||||
echo '</div>
|
||||
<div class="c">';
|
||||
if ($temps_tec > 0) {
|
||||
if ($tec==7) {
|
||||
$tr=$temps_tec-time();
|
||||
echo '<br><br><br><span id="axion"></span><br>';
|
||||
echo '<script language="JavaScript">reste('.$tr.');</script>';
|
||||
echo "<a href=\"anul_tec.php?tec=7\">Annuler</a>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
if($bat == 7) echo "<br><br><br>Le laboratoire est en cours d'évolution";
|
||||
else verification_des_ress(7, $metal, $cristal, $hydrogene, $a, $b, $c);
|
||||
}
|
||||
echo '</div>
|
||||
<br class="a">'; }
|
||||
// Technologie n°7 : Réacteur à fusion/Réacteur à fusion/Réacteur à fusion ; user.reacteur_f
|
||||
if ($labo >= 2) {
|
||||
$i = 6;
|
||||
$nom_bdd = 'reacteur_f';
|
||||
$n=(${$nom_bdd}-1);
|
||||
if (${$nom_bdd} > 0) $niveau = '(Niveau '.${$nom_bdd}.')'; else $niveau = '';
|
||||
$a=ceil(pow(2,$n)*3000); $b=ceil(pow(2,$n)*2100); $c=ceil(pow(2,$n)*750);
|
||||
if ($temps_tec > 0 && $tec == $i+1) { $tr=$temps_tec-time(); $action = '<br /><br /><br /><span id="axion"></span><br><script type="text/javascript">reste('.$tr.');</script><a href="anul_tec.php?tec='.($i+1).'">Annuler</a>'; }
|
||||
elseif($bat == 7) $action = '<br /><br /><br />Le laboratoire est en cours d\'évolution';
|
||||
else $action = verification_des_ress($i+1, $metal, $cristal, $hydrogene, $a, $b, $c);
|
||||
if (!empty($technolo[$i])) $template->assign_block_vars('technologie', array('TEMPS' => sec(ceil((1650*2*($reacteur_f+1))/pow(1.25,($labo-4)))), 'BESOIN' => ressources($metal, $cristal, $hydrogene, $a, $b, $c, $mine_m, $mine_c, $mine_h), 'IMAGE' => $technoli[$i], 'NOM' => $technolo[$i], 'NUM' => $i, 'NIVEAU' => $niveau, 'DESCRIPTION' => $technode[$i], 'ACTION' => $action));
|
||||
}
|
||||
|
||||
if ($labo >= 6 && $energie_t >=5 && $reacteur_f >= 4) {
|
||||
echo'<div class="a">
|
||||
<img src="images/technologies/'.$technoli[7].'" alt="" />
|
||||
</div>
|
||||
<div class="b">
|
||||
<a href=\"descriptions/.php\">'.$technolo[7].'</a> '; if ($reacteur_ff > 0) echo '(Niveau '.$reacteur_ff.')';
|
||||
echo '<br><span class="description">'.$technode[7].'</span><br>
|
||||
Besoin de : ';
|
||||
$n=($reacteur_ff-1);
|
||||
$a=ceil(pow(2,$n)*5000);
|
||||
$b=ceil(pow(2,$n)*4000);
|
||||
$c=ceil(pow(2,$n)*1500);
|
||||
ressources($metal, $cristal, $hydrogene, $a, $b, $c, $mine_m, $mine_c, $mine_h); echo '<br>
|
||||
Temps de construction : '; sec(ceil((2400*2*($reacteur_ff+1))/pow(1.25,($labo-6))));
|
||||
echo '</div>
|
||||
<div class="c">';
|
||||
if ($temps_tec > 0) {
|
||||
if ($tec==8) {
|
||||
$tr=$temps_tec-time();
|
||||
echo '<br><br><br><span id="axion"></span><br>';
|
||||
echo '<script language="JavaScript">reste('.$tr.');</script>';
|
||||
echo "<a href=\"anul_tec.php?tec=8\">Annuler</a>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
if($bat == 7) echo "<br><br><br>Le laboratoire est en cours d'évolution";
|
||||
else verification_des_ress(8, $metal, $cristal, $hydrogene, $a, $b, $c);
|
||||
}
|
||||
echo '</div>
|
||||
<br class="a">'; }
|
||||
// Technologie n°8 : Réacteur à fusion Forerunneur/Réacteur à fusion Forerunneur/Réacteur à fusion de type II ; user.reacteur_ff
|
||||
if ($labo >= 6 && $energie_t >= 5 && $reacteur_f >= 4) {
|
||||
$i = 7;
|
||||
$nom_bdd = 'reacteur_ff';
|
||||
$n=(${$nom_bdd}-1);
|
||||
if (${$nom_bdd} > 0) $niveau = '(Niveau '.${$nom_bdd}.')'; else $niveau = '';
|
||||
$a=ceil(pow(2,$n)*5000); $b=ceil(pow(2,$n)*4000); $c=ceil(pow(2,$n)*1500);
|
||||
if ($temps_tec > 0 && $tec == $i+1) { $tr=$temps_tec-time(); $action = '<br /><br /><br /><span id="axion"></span><br><script type="text/javascript">reste('.$tr.');</script><a href="anul_tec.php?tec='.($i+1).'">Annuler</a>'; }
|
||||
elseif($bat == 7) $action = '<br /><br /><br />Le laboratoire est en cours d\'évolution';
|
||||
else $action = verification_des_ress($i+1, $metal, $cristal, $hydrogene, $a, $b, $c);
|
||||
if (!empty($technolo[$i])) $template->assign_block_vars('technologie', array('TEMPS' => sec(ceil((2400*2*($reacteur_ff+1))/pow(1.25,($labo-6)))), 'BESOIN' => ressources($metal, $cristal, $hydrogene, $a, $b, $c, $mine_m, $mine_c, $mine_h), 'IMAGE' => $technoli[$i], 'NOM' => $technolo[$i], 'NUM' => $i, 'NIVEAU' => $niveau, 'DESCRIPTION' => $technode[$i], 'ACTION' => $action));
|
||||
}
|
||||
|
||||
// Technologie n°9 : Médecine/Médecine/Médecine ; user.reacteur_ff
|
||||
if ($labo >= 1) {
|
||||
echo'<div class="a">
|
||||
<img src="images/technologies/'.$technoli[8].'" alt="" />
|
||||
</div>
|
||||
<div class="b">
|
||||
<a href=\"descriptions/.php\">'.$technolo[8].'</a> '; if ($medecine > 0) echo '(Niveau '.$medecine.')';
|
||||
echo '<br><span class="description">'.$technode[8].'</span><br>
|
||||
Besoin de : ';
|
||||
$n=($medecine-1);
|
||||
$a=ceil(pow(2,$n)*800);
|
||||
$b=ceil(pow(2,$n)*1000);
|
||||
ressources($metal, $cristal, $hydrogene, $a, $b, 0, $mine_m, $mine_c, $mine_h); echo '<br>
|
||||
Temps de construction : '; sec(ceil((360*2*($medecine+1))/pow(1.25,($labo-1))));
|
||||
echo '</div>
|
||||
<div class="c">';
|
||||
if ($temps_tec > 0) {
|
||||
if ($tec==9) {
|
||||
$tr=$temps_tec-time();
|
||||
echo '<br><br><br><span id="axion"></span><br>';
|
||||
echo '<script language="JavaScript">reste('.$tr.');</script>';
|
||||
echo "<a href=\"anul_tec.php?tec=9\">Annuler</a>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
if($bat == 7) echo "<br><br><br>Le laboratoire est en cours d'évolution";
|
||||
else verification_des_ress(9, $metal, $cristal, $hydrogene, $a, $b, 0);
|
||||
}
|
||||
echo '</div>
|
||||
<br class="a">'; }
|
||||
$i = 8;
|
||||
$nom_bdd = 'medecine';
|
||||
$n=(${$nom_bdd}-1);
|
||||
if (${$nom_bdd} > 0) $niveau = '(Niveau '.${$nom_bdd}.')'; else $niveau = '';
|
||||
$a=ceil(pow(2,$n)*800); $b=ceil(pow(2,$n)*1000);
|
||||
if ($temps_tec > 0 && $tec == $i+1) { $tr=$temps_tec-time(); $action = '<br /><br /><br /><span id="axion"></span><br><script type="text/javascript">reste('.$tr.');</script><a href="anul_tec.php?tec='.($i+1).'">Annuler</a>'; }
|
||||
elseif($bat == 7) $action = '<br /><br /><br />Le laboratoire est en cours d\'évolution';
|
||||
else $action = verification_des_ress($i+1, $metal, $cristal, $hydrogene, $a, $b, $c);
|
||||
if (!empty($technolo[$i])) $template->assign_block_vars('technologie', array('TEMPS' => sec(ceil((360*2*($medecine+1))/pow(1.25,($labo-1)))), 'BESOIN' => ressources($metal, $cristal, $hydrogene, $a, $b, 0, $mine_m, $mine_c, $mine_h), 'IMAGE' => $technoli[$i], 'NOM' => $technolo[$i], 'NUM' => $i, 'NIVEAU' => $niveau, 'DESCRIPTION' => $technode[$i], 'ACTION' => $action));
|
||||
}
|
||||
|
||||
// Technologie n°10 : Commandement militaire/Commandement militaire/Tactiques de combats ; user.tactique
|
||||
if ($labo >= 3) {
|
||||
echo'<div class="a">
|
||||
<img src="images/technologies/'.$technoli[9].'" alt="" />
|
||||
</div>
|
||||
<div class="b">
|
||||
<a href=\"descriptions/.php\">'.$technolo[9].'</a> '; if ($tactique > 0) echo '(Niveau '.$tactique.')';
|
||||
echo '<br><span class="description">'.$technode[9].'</span><br>
|
||||
Besoin de : ';
|
||||
$n=($tactique-1);
|
||||
$a=ceil(pow(2,$n)*2600);
|
||||
$b=ceil(pow(2,$n)*2600);
|
||||
ressources($metal, $cristal, $hydrogene, $a, $b, 0, $mine_m, $mine_c, $mine_h); echo '<br>
|
||||
Temps de construction : '; sec(ceil((4410*2*($tactique+1))/pow(1.25,($labo-3))));
|
||||
echo '</div>
|
||||
<div class="c">';
|
||||
if ($temps_tec > 0) {
|
||||
if ($tec==10) {
|
||||
$tr=$temps_tec-time();
|
||||
echo '<br><br><br><span id="axion"></span><br>';
|
||||
echo '<script language="JavaScript">reste('.$tr.');</script>';
|
||||
echo "<a href=\"anul_tec.php?tec=10\">Annuler</a>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
if($bat == 7) echo "<br><br><br>Le laboratoire est en cours d'évolution";
|
||||
else verification_des_ress(10, $metal, $cristal, $hydrogene, $a, $b, 0);
|
||||
}
|
||||
echo '</div>
|
||||
<br class="a">'; }
|
||||
$i = 9;
|
||||
$nom_bdd = 'tactique';
|
||||
$n=(${$nom_bdd}-1);
|
||||
if (${$nom_bdd} > 0) $niveau = '(Niveau '.${$nom_bdd}.')'; else $niveau = '';
|
||||
$a=ceil(pow(2,$n)*2600); $b=ceil(pow(2,$n)*2600);
|
||||
if ($temps_tec > 0 && $tec == $i+1) { $tr=$temps_tec-time(); $action = '<br /><br /><br /><span id="axion"></span><br><script type="text/javascript">reste('.$tr.');</script><a href="anul_tec.php?tec='.($i+1).'">Annuler</a>'; }
|
||||
elseif($bat == 7) $action = '<br /><br /><br />Le laboratoire est en cours d\'évolution';
|
||||
else $action = verification_des_ress($i+1, $metal, $cristal, $hydrogene, $a, $b, $c);
|
||||
if (!empty($technolo[$i])) $template->assign_block_vars('technologie', array('TEMPS' => sec(ceil((4410*2*($tactique+1))/pow(1.25,($labo-3)))), 'BESOIN' => ressources($metal, $cristal, $hydrogene, $a, $b, 0, $mine_m, $mine_c, $mine_h), 'IMAGE' => $technoli[$i], 'NOM' => $technolo[$i], 'NUM' => $i, 'NIVEAU' => $niveau, 'DESCRIPTION' => $technode[$i], 'ACTION' => $action));
|
||||
}
|
||||
|
||||
if ($labo >= 8 && $mine_m >= 18 && $mine_c >= 15 && $informatique >= 8) {
|
||||
// Technologie n°11 : 0/0/Spartan ; user.spartan
|
||||
if ($labo >= 8 && $medecine >= 5 && $informatique >= 8) {
|
||||
$i = 10;
|
||||
$nom_bdd = 'spartan';
|
||||
$n=(${$nom_bdd}-1);
|
||||
if (${$nom_bdd} > 0) $niveau = '(Niveau '.${$nom_bdd}.')'; else $niveau = '';
|
||||
$a=ceil(pow(3,$n)*5200); $b=ceil(pow(3,$n)*4250); $c=ceil(pow(3,$n)*850);
|
||||
if ($temps_tec > 0 && $tec == $i+1) { $tr=$temps_tec-time(); $action = '<br /><br /><br /><span id="axion"></span><br><script type="text/javascript">reste('.$tr.');</script><a href="anul_tec.php?tec='.($i+1).'">Annuler</a>'; }
|
||||
elseif($bat == 7) $action = '<br /><br /><br />Le laboratoire est en cours d\'évolution';
|
||||
else $action = verification_des_ress($i+1, $metal, $cristal, $hydrogene, $a, $b, $c);
|
||||
if (!empty($technolo[$i])) $template->assign_block_vars('technologie', array('TEMPS' => sec(ceil((5000*2*($spartan+1))/pow(1.25,($labo-8)))), 'BESOIN' => ressources($metal, $cristal, $hydrogene, $a, $b, $c, $mine_m, $mine_c, $mine_h), 'IMAGE' => $technoli[$i], 'NOM' => $technolo[$i], 'NUM' => $i, 'NIVEAU' => $niveau, 'DESCRIPTION' => $technode[$i], 'ACTION' => $action));
|
||||
}
|
||||
$template->pparse('labo');
|
||||
exit;
|
||||
|
||||
|
||||
if ($labo >= 8 && $medecine >= 5 && $informatique >= 8 && $race == 'humain') {
|
||||
echo'<div class="a">
|
||||
<img src="images/technologies/'.$technoli[10].'" alt="" />
|
||||
</div>
|
||||
<div class="b">
|
||||
<a href=\"descriptions/.php\">'.$technolo[10].'</a> '; if ($developpement > 0) echo '(Niveau '.$developpement.')';
|
||||
<a href=\"descriptions/.php\">'.$technolo[10].'</a> '; if ($spartan > 0) echo '(Niveau '.$spartan.')';
|
||||
echo '<br><span class="description">'.$technode[10].'</span><br>
|
||||
Besoin de : ';
|
||||
$n=($developpement-1);
|
||||
$a=ceil(pow(2,$n)*10000);
|
||||
$b=ceil(pow(2,$n)*10000);
|
||||
$c=ceil(pow(2,$n)*5000);
|
||||
$n=($spartan-1);
|
||||
$a=ceil(pow(3,$n)*5200); $b=ceil(pow(3,$n)*4250); $c=ceil(pow(3,$n)*850);
|
||||
ressources($metal, $cristal, $hydrogene, $a, $b, $c, $mine_m, $mine_c, $mine_h); echo '<br>
|
||||
Temps de construction : '; sec(ceil((11400*2*($developpement+1))/pow(1.25,($labo-8))));
|
||||
Temps de construction : '; sec(ceil((5000*2*($spartan+1))/pow(1.25,($labo-8))));
|
||||
echo '</div>
|
||||
<div class="c">';
|
||||
if ($temps_tec > 0) {
|
||||
|
|
@ -409,43 +242,9 @@ if ($temps_tec > 0) {
|
|||
if($bat == 7) echo "<br><br><br>Le laboratoire est en cours d'évolution";
|
||||
else verification_des_ress(11, $metal, $cristal, $hydrogene, $a, $b, $c);
|
||||
}
|
||||
echo '</div>
|
||||
<br class="a">'; }
|
||||
|
||||
if ($labo >= 8 && $medecine >= 5 && $informatique >= 8) {
|
||||
echo'<div class="a">
|
||||
<img src="images/technologies/'.$technoli[11].'" alt="" />
|
||||
</div>
|
||||
<div class="b">
|
||||
<a href=\"descriptions/.php\">'.$technolo[11].'</a> '; if ($spartan > 0) echo '(Niveau '.$spartan.')';
|
||||
echo '<br><span class="description">'.$technode[11].'</span><br>
|
||||
Besoin de : ';
|
||||
$n=($spartan-1);
|
||||
$a=ceil(pow(3,$n)*5200);
|
||||
$b=ceil(pow(3,$n)*4250);
|
||||
$c=ceil(pow(3,$n)*850);
|
||||
ressources($metal, $cristal, $hydrogene, $a, $b, $c, $mine_m, $mine_c, $mine_h); echo '<br>
|
||||
Temps de construction : '; sec(ceil((5000*2*($spartan+1))/pow(1.25,($labo-8))));
|
||||
echo '</div>
|
||||
<div class="c">';
|
||||
if ($temps_tec > 0) {
|
||||
if ($tec==12) {
|
||||
$tr=$temps_tec-time();
|
||||
echo '<br><br><br><span id="axion"></span><br>';
|
||||
echo '<script language="JavaScript">reste('.$tr.');</script>';
|
||||
echo "<a href=\"anul_tec.php?tec=12\">Annuler</a>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
if($bat == 7) echo "<br><br><br>Le laboratoire est en cours d'évolution";
|
||||
else verification_des_ress(12, $metal, $cristal, $hydrogene, $a, $b, $c);
|
||||
}
|
||||
echo '</div>'; }
|
||||
|
||||
|
||||
}
|
||||
else { echo '<table align=center><tr><td>Vous devez d\'abord construire un centre de recherche !</td></tr></table>'; }
|
||||
?>
|
||||
</td></tr></table></div>
|
||||
</body>
|
||||
</html>
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue