Version 0.9b
This commit is contained in:
parent
59fbc7104e
commit
73645ccc1f
25 changed files with 841 additions and 466 deletions
|
|
@ -8,8 +8,15 @@ $pos=$_SESSION['pos'];
|
|||
require_once('noms.php');
|
||||
require_once('bdd.php');
|
||||
require('../connectBDD.php');
|
||||
require('../header.php');
|
||||
require_once('ressource.php');
|
||||
require('../template.php');
|
||||
require_once('ressourcetem.php');
|
||||
|
||||
$template = new Template('../templates/'.$templates);
|
||||
$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]));
|
||||
}
|
||||
|
||||
function tableauProd($ibat,$nivo){
|
||||
$dejadefi = 1;
|
||||
|
|
@ -18,8 +25,8 @@ $return = '';
|
|||
$c = $nivo-2 < 1 ? 1 : $nivo-2; $a = $c + 7;
|
||||
if ($ibat == 0) {
|
||||
for ($c;$c<$a;$c++) {
|
||||
$b=ceil(($c*32)+(pow(1.41,$c)*exp(0.066*$c))*3.7);
|
||||
$h=ceil(($c*32)+(pow(1.41,$c)*exp(0.066*$c))*3.7) - ceil((($c-1)*32)+(pow(1.41,($c-1))*exp(0.066*($c-1)))*3.7);
|
||||
$b=floor((ceil(((($c*32)+(pow(1.41,$c)*exp(0.066*$c)))/0.36)*3600)/10000)*3.7 + 0.011*3600);
|
||||
$h=ceil((ceil(((($c*32)+(pow(1.41,$c)*exp(0.066*$c)))/0.36)*3600)/10000)*3.7 + 0.011*3600) - ceil((ceil((((($c-1)*32)+(pow(1.41,$c-1)*exp(0.066*($c-1))))/0.36)*3600)/10000)*3.7 + 0.011*3600);
|
||||
|
||||
$p=ceil((exp($c*0.28)*10));
|
||||
$g=ceil((exp($c*0.28)*10)) - ceil((exp(($c-1)*0.28)*10));
|
||||
|
|
@ -30,8 +37,8 @@ $c = $nivo-2 < 1 ? 1 : $nivo-2; $a = $c + 7;
|
|||
}
|
||||
elseif ($ibat == 1) {
|
||||
for ($c;$c<$a;$c++) {
|
||||
$b=floor(($c*13)+(pow(1.36,$c)*exp(0.0675*$c))*7);
|
||||
$h=floor(($c*13)+(pow(1.36,$c)*exp(0.0675*$c))*7) - floor((($c-1)*13)+(pow(1.36,($c-1))*exp(0.0675*($c-1)))*7);
|
||||
$b=floor(((ceil(((($c*13)+(pow(1.36,$c)*exp(0.0675*$c)))/0.36)*3600)/10000)*7) + 0.0055*3600);
|
||||
$h=floor(((ceil(((($c*13)+(pow(1.36,$c)*exp(0.0675*$c)))/0.36)*3600)/10000)*7) + 0.0055*3600) - floor(((ceil((((($c-1)*13)+(pow(1.36,($c-1))*exp(0.0675*($c-1))))/0.36)*3600)/10000)*7) + 0.0055*3600);
|
||||
|
||||
$p=ceil((exp($c*0.28)*10));
|
||||
$g=ceil((exp($c*0.28)*10)) - ceil((exp(($c-1)*0.28)*10));
|
||||
|
|
@ -42,8 +49,8 @@ $c = $nivo-2 < 1 ? 1 : $nivo-2; $a = $c + 7;
|
|||
}
|
||||
elseif ($ibat == 2) {
|
||||
for ($c;$c<$a;$c++) {
|
||||
$b=ceil(($c*12)+(pow(1.394,$c)*exp(0.072*$c))*5);
|
||||
$h=ceil(($c*12)+(pow(1.394,$c)*exp(0.072*$c))*5) - ceil((($c-1)*12)+(pow(1.394,($c-1))*exp(0.072*($c-1)))*5);
|
||||
$b=floor((floor(((($c*12)+(pow(1.394,$c)*exp(0.072*$c)))/0.36)*3600)/10000)*5);
|
||||
$h=ceil((floor(((($c*12)+(pow(1.394,$c)*exp(0.072*$c)))/0.36)*3600)/10000)*5) - ceil((floor((((($c-1)*12)+(pow(1.394,$c-1)*exp(0.072*($c-1))))/0.36)*3600)/10000)*5);
|
||||
|
||||
$p=ceil((exp($c*0.31)*10));
|
||||
$g=ceil((exp($c*0.31)*10)) - ceil((exp(($c-1)*0.31)*10));
|
||||
|
|
@ -54,14 +61,20 @@ $c = $nivo-2 < 1 ? 1 : $nivo-2; $a = $c + 7;
|
|||
}
|
||||
elseif ($ibat == 3) {
|
||||
for ($c;$c<$a;$c++) {
|
||||
$b=ceil(($c*12+(exp($c*0.32)*10)));
|
||||
$h=ceil(($c*12+(exp($c*0.32)*10))) - ceil((($c-1)*12+(exp(($c-1)*0.32)*10)));
|
||||
$b=ceil($c*20+(exp($c*0.3)*10));
|
||||
$h=ceil($c*20+(exp($c*0.3)*10)) - ceil(($c-1)*20+(exp(($c-1)*0.3)*10));
|
||||
|
||||
$p=ceil((exp($c*0.31)*10));
|
||||
$g=ceil((exp($c*0.31)*10)) - ceil((exp(($c-1)*0.31)*10));
|
||||
if ($c == $nivo) $return .= '<tr><td><b>'.$c.'</b></td><td><b>'.$b.' (+ '.$h.')</b></td></tr>';
|
||||
else $return .= '<tr><td>'.$c.'</td><td>'.$b.' (+ '.$h.')</td></tr>';
|
||||
}
|
||||
}
|
||||
elseif ($ibat == 4) {
|
||||
for ($c;$c<$a;$c++) {
|
||||
$b=ceil($c*80+(exp($c*0.38)*11));
|
||||
$h=ceil($c*80+(exp($c*0.38)*11)) - ceil(($c-1)*80+(exp(($c-1)*0.38)*11));
|
||||
|
||||
if ($c == $nivo) $return .= '<tr><td><b>'.$c.'</b></td><td><b>'.$b.' (+ '.$h.')</b></td><td><b>'.$p.' (+ '.$g.')</b></td></tr>';
|
||||
else $return .= '<tr><td>'.$c.'</td><td>'.$b.' (+ '.$h.')</td><td>'.$p.' (+ '.$g.')</td></tr>';
|
||||
if ($c == $nivo) $return .= '<tr><td><b>'.$c.'</b></td><td><b>'.$b.' (+ '.$h.')</b></td></tr>';
|
||||
else $return .= '<tr><td>'.$c.'</td><td>'.$b.' (+ '.$h.')</td></tr>';
|
||||
}
|
||||
}
|
||||
else $return = '';
|
||||
|
|
@ -86,15 +99,73 @@ function niveauBat($bat){
|
|||
else return '#Erreur, batiment invalide';
|
||||
}
|
||||
|
||||
if (isset($_GET['bat'])) {
|
||||
$i = intval($_GET['bat']);
|
||||
if (empty($batiment[$i])) print '<div class="centre"><table style="margin-left: auto; margin-right: auto; width: 275px; height: 50px"><tr><td><b>Batiment inexistant</b></td></tr></table></div>';
|
||||
else {
|
||||
if ($i <= 3) print '<table align="center" width="550"><tr><td colspan="2"><b>'.$batiment[$i].' niveau '.${niveauBat($i)}.'</b><br />'.$batimede[$i].'</td></tr><tr><td><img src="images/batiments/'.$batimeni[$i].'" alt="" /></td><td><div class="centre"><table style="margin-left: auto; margin-right: auto;"><tr><td><b>Niveau</b></td><td><b>Production par heure</b></td><td><b>Consommation énergie</b></td></tr>'.tableauProd($i,${niveauBat($i)}).'</table></div></<td></tr></table>';
|
||||
else print '<table align="center" width="550"><tr><td><img src="images/batiments/'.$batimeni[$i].'" alt="" /></td><td><b>'.$batiment[$i].' niveau '.${niveauBat($i)}.'</b><br /><br />'.$batimede[$i].'</td></tr></table>';
|
||||
}
|
||||
function niveauTec($tec){
|
||||
if ($tec == 0) return 'informatique';
|
||||
elseif ($tec == 1) return 'detection';
|
||||
elseif ($tec == 2) return 'armement';
|
||||
elseif ($tec == 3) return 'energie_t';
|
||||
elseif ($tec == 4) return 'reacteur';
|
||||
elseif ($tec == 5) return 'reacteur_f';
|
||||
elseif ($tec == 6) return 'reacteur_ff';
|
||||
elseif ($tec == 7) return 'medecine';
|
||||
elseif ($tec == 8) return 'tactique';
|
||||
elseif ($tec == 9) return 'spartan';
|
||||
elseif ($tec == 10) return 'blindage';
|
||||
else return '#Erreur, technologie invalide';
|
||||
}
|
||||
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
function niveauVai($vai){
|
||||
return 'vaisseau_'.$vai;
|
||||
}
|
||||
|
||||
if (isset($_GET['bat'])) {
|
||||
$i = intval($_GET['bat']);
|
||||
$CONTENU = '';
|
||||
if (empty($batiment[$i])) $CONTENU = '<div class="centre"><table style="margin-left: auto; margin-right: auto; width: 275px; height: 50px"><tr><td><b>Batiment inexistant</b></td></tr></table></div>';
|
||||
else {
|
||||
if ($i <= 2) $CONTENU = '<table width="550" style="margin-left: auto; margin-right: auto;"><tr><td colspan="2"><b>'.$batiment[$i].' niveau '.${niveauBat($i)}.'</b><br />'.$batimede[$i].'</td></tr><tr><td><img src="images/batiments/'.$batimeni[$i].'" alt="" /></td><td><div class="centre"><table style="margin-left: auto; margin-right: auto;"><tr><td><b>Niveau</b></td><td><b>Production par heure</b></td><td><b>Consommation énergie</b></td></tr>'.tableauProd($i,${niveauBat($i)}).'</table></div></td></tr></table>';
|
||||
elseif ($i <= 4) $CONTENU = '<table style="margin-left: auto; margin-right: auto;" width="550"><tr><td colspan="2"><b>'.$batiment[$i].' niveau '.${niveauBat($i)}.'</b><br />'.$batimede[$i].'</td></tr><tr><td><img src="images/batiments/'.$batimeni[$i].'" alt="" /></td><td><div class="centre"><table style="margin-left: auto; margin-right: auto;"><tr><td><b>Niveau</b></td><td><b>Production par heure</b></td></tr>'.tableauProd($i,${niveauBat($i)}).'</table></div></td></tr></table>';
|
||||
else $CONTENU = '<table style="margin-left: auto; margin-right: auto;" width="550"><tr><td><img src="images/batiments/'.$batimeni[$i].'" alt="" /></td><td><b>'.$batiment[$i].' niveau '.${niveauBat($i)}.'</b><br /><br />'.$batimede[$i].'</td></tr></table>';
|
||||
}
|
||||
|
||||
$template->set_filenames(array('defaut' => 'defaut.tpl'));
|
||||
$template->assign_var_from_handle('RESSOURCES', 'ressourcestpl');
|
||||
|
||||
$template->assign_vars( array('PAGE' => $CONTENU, 'PUB' => $PUB));
|
||||
$template->pparse('defaut');
|
||||
}
|
||||
elseif (isset($_GET['tec'])) {
|
||||
$i = intval($_GET['tec']);
|
||||
if (empty($technolo[$i])) $CONTENU = '<div class="centre"><table style="margin-left: auto; margin-right: auto; width: 275px; height: 50px"><tr><td><b>Technologie inexistante</b></td></tr></table></div>';
|
||||
else $CONTENU = '<table style="margin-left: auto; margin-right: auto;" width="550"><tr><td><img src="images/technologies/'.$technoli[$i].'" alt="" /></td><td><b>'.$technolo[$i].' niveau '.${niveauTec($i)}.'</b><br /><br />'.$technode[$i].'</td></tr></table>';
|
||||
|
||||
$template->set_filenames(array('defaut' => 'defaut.tpl'));
|
||||
$template->assign_var_from_handle('RESSOURCES', 'ressourcestpl');
|
||||
|
||||
$template->assign_vars( array('PAGE' => $CONTENU, 'PUB' => $PUB));
|
||||
$template->pparse('defaut');
|
||||
}
|
||||
elseif (isset($_GET['vai'])) {
|
||||
$i = intval($_GET['vai']);
|
||||
if (empty($nomvaisn[$i])) $CONTENU = '<div class="centre"><table style="margin-left: auto; margin-right: auto; width: 275px; height: 50px"><tr><td><b>Vaisseau inexistant</b></td></tr></table></div>';
|
||||
else $CONTENU = '<table style="margin-left: auto; margin-right: auto;" width="550"><tr><td><img src="images/vaisseaux/'.$nomvaisi[$i].'" alt="" /></td><td><b>'.$nomvaisn[$i].' ('.${niveauVai($i)}.' en attente)</b><br /><br />'.$nomvaisd[$i].'</td></tr></table>';
|
||||
|
||||
$template->set_filenames(array('defaut' => 'defaut.tpl'));
|
||||
$template->assign_var_from_handle('RESSOURCES', 'ressourcestpl');
|
||||
|
||||
$template->assign_vars( array('PAGE' => $CONTENU, 'PUB' => $PUB));
|
||||
$template->pparse('defaut');
|
||||
}
|
||||
elseif (isset($_GET['def'])) {
|
||||
$i = intval($_GET['def']);
|
||||
if (empty($nomterrn[$i])) $CONTENU = '<div class="centre"><table style="margin-left: auto; margin-right: auto; width: 275px; height: 50px"><tr><td><b>Défense inexistante</b></td></tr></table></div>';
|
||||
else $CONTENU = '<table style="margin-left: auto; margin-right: auto;" width="550"><tr><td><img src="images/terrestre/'.$nomterri[$i].'" alt="" /></td><td><b>'.$nomterrn[$i].' ('.${niveauVai($i)}.' prêt(e)s)</b><br /><br />'.$nomterde[$i].'</td></tr></table>';
|
||||
|
||||
$template->set_filenames(array('defaut' => 'defaut.tpl'));
|
||||
$template->assign_var_from_handle('RESSOURCES', 'ressourcestpl');
|
||||
|
||||
$template->assign_vars( array('PAGE' => $CONTENU, 'PUB' => $PUB));
|
||||
$template->pparse('defaut');
|
||||
}
|
||||
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue