forked from halo-battle/game
Version 2007-11-05
This commit is contained in:
parent
ebc73c5744
commit
d08fb34825
58 changed files with 1819 additions and 1447 deletions
91
pages/descriptions.php
Normal file
91
pages/descriptions.php
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
<?php
|
||||
session_start();
|
||||
define('DESIGN', 'descriptions/diz/base.css');
|
||||
$id=$_SESSION['id'];
|
||||
$galaxy=$_SESSION['galaxy'];
|
||||
$ss=$_SESSION['ss'];
|
||||
$pos=$_SESSION['pos'];
|
||||
require_once('noms.php');
|
||||
require_once('bdd.php');
|
||||
require('../connectBDD.php');
|
||||
require('../header.php');
|
||||
require_once('ressource.php');
|
||||
|
||||
function tableauProd($ibat,$nivo){
|
||||
$dejadefi = 1;
|
||||
require('bdd.php');
|
||||
$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);
|
||||
|
||||
$p=ceil((exp($c*0.28)*10));
|
||||
$g=ceil((exp($c*0.28)*10)) - ceil((exp(($c-1)*0.28)*10));
|
||||
|
||||
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>';
|
||||
}
|
||||
}
|
||||
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);
|
||||
|
||||
$p=ceil((exp($c*0.28)*10));
|
||||
$g=ceil((exp($c*0.28)*10)) - ceil((exp(($c-1)*0.28)*10));
|
||||
|
||||
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>';
|
||||
}
|
||||
}
|
||||
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);
|
||||
|
||||
$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><td><b>'.$p.' (+ '.$g.')</b></td></tr>';
|
||||
else $return .= '<tr><td>'.$c.'</td><td>'.$b.' (+ '.$h.')</td><td>'.$p.' (+ '.$g.')</td></tr>';
|
||||
}
|
||||
}
|
||||
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)));
|
||||
|
||||
$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><td><b>'.$p.' (+ '.$g.')</b></td></tr>';
|
||||
else $return .= '<tr><td>'.$c.'</td><td>'.$b.' (+ '.$h.')</td><td>'.$p.' (+ '.$g.')</td></tr>';
|
||||
}
|
||||
}
|
||||
else $return = '';
|
||||
|
||||
if ($return == '') return '<tr><td colspan="4"><br /><b>Référence du batiment invalide</b><br /><br /></td></tr>';
|
||||
else return $return;
|
||||
}
|
||||
|
||||
function niveauBat($bat){
|
||||
if ($bat == 0) return 'mine_m';
|
||||
elseif ($bat == 1) return 'mine_c';
|
||||
elseif ($bat == 2) return 'mine_h';
|
||||
elseif ($bat == 3) return 'centrale_s';
|
||||
elseif ($bat == 4) return 'centrale_f';
|
||||
elseif ($bat == 5) return 'radar';
|
||||
elseif ($bat == 6) return 'labo';
|
||||
else return '#Erreur, batiment invalide';
|
||||
}
|
||||
|
||||
if (isset($_GET['bat'])) {
|
||||
$i = intval($_GET['bat']);
|
||||
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>';
|
||||
}
|
||||
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue