forked from halo-battle/game
First code received by Master Leon
This commit is contained in:
commit
4230eb6922
330 changed files with 15543 additions and 0 deletions
144
pages/defense.php
Normal file
144
pages/defense.php
Normal file
|
|
@ -0,0 +1,144 @@
|
|||
<? session_start(); ?>
|
||||
<html>
|
||||
<head>
|
||||
<title>Space battleship</title>
|
||||
|
||||
<link rel="stylesheet" media="screen" name="design" href="design/design.css">
|
||||
<?php
|
||||
$id=$_SESSION['id'];
|
||||
$galaxy=$_SESSION['galaxy'];
|
||||
$ss=$_SESSION['ss'];
|
||||
$pos=$_SESSION['pos'];
|
||||
include 'ressource.php';
|
||||
include 'bdd.php';
|
||||
include 'ajout_terrestre.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 - (0.1*$chantier_terrestre*480)));
|
||||
$g = ceil((1560 - (0.1*$chantier_terrestre*1560)));
|
||||
$h = ceil((1800 - (0.1*$chantier_terrestre*1800)));
|
||||
$i = ceil((6720 - (0.1*$chantier_terrestre*6720)));
|
||||
$j = ceil((12960 - (0.1*$chantier_terrestre*12960)));
|
||||
|
||||
|
||||
|
||||
if ($temps_terrestre>0) {
|
||||
switch ($unit_t) {
|
||||
case 1:
|
||||
$unit= "banshees"; break;
|
||||
case 2:
|
||||
$unit= "spirits"; break;
|
||||
case 3:
|
||||
$unit= "phantom"; break;
|
||||
case 4:
|
||||
$unit= "boarding craft"; break;
|
||||
case 5:
|
||||
$unit= "ghosts"; break;
|
||||
case 6:
|
||||
$unit= "shadow"; break;
|
||||
case 7:
|
||||
$unit= "spectres"; break;
|
||||
case 8:
|
||||
$unit= "appartitions"; break;
|
||||
case 9:
|
||||
$unit= "shade"; break;
|
||||
case 10:
|
||||
$unit= "strong shade"; break;
|
||||
case 11:
|
||||
$unit= "tourelles à barreau de combustible"; break;
|
||||
case 12:
|
||||
$unit= "tourelles à plasma"; break;
|
||||
case 13:
|
||||
$unit= "lanceurs de Torpilles plasma"; break;
|
||||
}}
|
||||
?>
|
||||
<script language="javascript" src="time.js"></script>
|
||||
</head>
|
||||
|
||||
|
||||
<body>
|
||||
<? if ($chantier_terrestre > 0) {
|
||||
if ($temps_terrestre >0) {
|
||||
echo "<table align=center><tr><td>
|
||||
Construction terminé dans : ";
|
||||
$tr=$temps_terrestre-time();
|
||||
echo '<div id="axion"></div>';
|
||||
echo '<script language="JavaScript">reste('.$tr.');</script>';
|
||||
echo "</td></tr><tr><td>Construction de : ".$cons_terrestre." ".$unit."</td></tr>
|
||||
</table>";} else {}
|
||||
|
||||
echo"<table align=center>
|
||||
<tr><td width=150>lmages</td><td width=350>Description</td><td width=120>Nombre</td></tr>";
|
||||
|
||||
|
||||
if ($chantier_terrestre >= 1) {
|
||||
echo "<form method=post action=validation_def_1.php>
|
||||
<tr>
|
||||
<td><img src=images/ ></td>
|
||||
<td align=left>Shade ( ".$def_1." unités )<br>Métal : 500<br>Cristal : 200<br>Temps : "; sec($f); echo"<br></td>
|
||||
<td>"; if ( $bat == 8 ) { echo "Chantier terrestre en construction"; } else { if ($temps_terrestre < time() ) { echo "<input type=text class=zone_texte size=4 maxlength=4 name=cons_def_1 /><br><input type=submit value=Envoyer class=bouttom>"; } else { if ($unit_t<9 && $unit_t>0)
|
||||
{echo "<font color=red>Construction en cours dans le </font><a href=chantier_terrestre.php>chantier terrestre</a>";} } }
|
||||
echo "</td></tr></form>"; } else {}
|
||||
|
||||
if ($chantier_terrestre >= 3 && $energie_t >=2) {
|
||||
echo "<form method=post action=validation_def_2.php>
|
||||
<tr>
|
||||
<td><img src=images/ ></td>
|
||||
<td align=left>Strong shade ( ".$def_2." unités )<br>Métal : 4000<br>Cristal : 2000<br>Temps : "; sec($g); echo"<br></td>
|
||||
<td>"; if ( $bat == 8 ) { echo "Chantier terrestre en construction"; } else { if ($temps_terrestre < time() ) { echo "<input type=text class=zone_texte size=4 maxlength=4 name=cons_def_2 /><br><input type=submit value=Envoyer class=bouttom>"; } else { if ($unit_t<9 && $unit_t>0)
|
||||
{echo "<font color=red>Construction en cours dans le </font><a href=chantier_terrestre.php>chantier terrestre</a>";} } }
|
||||
echo "</td></tr></form>"; } else {}
|
||||
|
||||
if ($chantier_terrestre >= 4 && $armement >= 1) {
|
||||
echo "<form method=post action=validation_def_3.php>
|
||||
<tr>
|
||||
<td><img src=images/ ></td>
|
||||
<td align=left>Tourelle à barreau de combustible ( ".$def_3." unités )<br>Métal : 4500<br>Cristal : 800<br>Hydrogène : 600<br>Temps : "; sec($h); echo"<br></td>
|
||||
<td>"; if ( $bat == 8 ) { echo "Chantier terrestre en construction"; } else { if ($temps_terrestre < time() ) { echo "<input type=text class=zone_texte size=4 maxlength=4 name=cons_def_3 /><br><input type=submit value=Envoyer class=bouttom>"; } else { if ($unit_t<9 && $unit_t>0)
|
||||
{echo "<font color=red>Construction en cours dans le </font><a href=chantier_terrestre.php>chantier terrestre</a>";} } }
|
||||
echo "</td></tr></form>"; } else {}
|
||||
|
||||
if ($chantier_terrestre >= 6 && $armement >=3 && $enerigie_t >= 4) {
|
||||
echo "<form method=post action=validation_def_4.php>
|
||||
<tr>
|
||||
<td><img src=images/lance_torpille.jpg ></td>
|
||||
<td align=left>Tourelle à plasma ( ".$def_4." unités )<br>Métal : 12000<br>Cristal : 10000<br>Hydrogène : 1000<br>Temps : "; sec($i); echo"<br></td>
|
||||
<td>"; if ( $bat == 8 ) { echo "Chantier terrestre en construction"; } else { if ($temps_terrestre < time() ) { echo "<input type=text class=zone_texte size=4 maxlength=4 name=cons_def_4 /><br><input type=submit value=Envoyer class=bouttom>"; } else { if ($unit_t<9 && $unit_t>0)
|
||||
{echo "<font color=red>Construction en cours dans le </font><a href=chantier_terrestre.php>chantier terrestre</a>";} } }
|
||||
echo "</td></tr></form>"; } else {}
|
||||
|
||||
if ($chantier_terrestre >= 8 && $armement >=5 && $informatique >= 3) {
|
||||
echo "<form method=post action=validation_def_5.php>
|
||||
<tr>
|
||||
<td><img src=images/canon_plasma.jpg ></td>
|
||||
<td align=left>Lanceur de Torpilles plasma ( ".$def_5." unités )<br>Métal : 15000<br>Cristal : 9500<br>Hydrogène : 1500<br>Temps : "; sec($j); echo"<br></td>
|
||||
<td>"; if ( $bat == 8 ) { echo "Chantier terrestre en construction"; } else { if ($temps_terrestre < time() ) { echo "<input type=text class=zone_texte size=4 maxlength=4 name=cons_def_5 /><br><input type=submit value=Envoyer class=bouttom>"; } else { if ($unit_t<9 && $unit_t>0)
|
||||
{echo "<font color=red>Construction en cours dans le </font><a href=chantier_terrestre.php>chantier terrestre</a>";} } }
|
||||
echo "</td></tr></form>"; } else {}
|
||||
|
||||
|
||||
} else { ?><SCRIPT language="javascript">
|
||||
parent.frames["changement"].window.location="sans_terrestre.php"
|
||||
</SCRIPT> <?
|
||||
echo "<center><table><tr><td>Vous devez d'abord construire un chantier spatial !</td></tr></table></center>"; }
|
||||
echo "</table>"; ?>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue