Version 0.10a

This commit is contained in:
nemunaire 2008-11-20 12:00:00 +01:00
commit e391f66774
201 changed files with 5182 additions and 8158 deletions

View file

@ -0,0 +1,108 @@
<?
mysql_connect("localhost", "root", "");
mysql_select_db("wars");
$z = mysql_query("SELECT * FROM user WHERE id='".$id."' ");
$donnees = mysql_fetch_array($z);
$id = $donnees['id'];
$pseudo = $donnees['pseudo'];
$mdp = $donnees['mdp'];
$race = $donnees['race'];
$mail = $donnees['mail'];
$ip = $donnees['ip'];
$mv = $donnees['mv'];
$last_visite = $donnees['last_visite'];
$points = $donnees['points'];
$place_points = $donnees['place_points'];
$recherches = $donnees['recherches'];
$place_recherches = $donnees['place_recherches'];
$flotte = $donnees['flotte'];
$place_flotte = $donnees['place_flotte'];
$terrestre = $donnees['terrestre'];
$place_terrestre = $donnees['place_terrestre'];
$y = mysql_query("SELECT * FROM planete WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
$donnees = mysql_fetch_array($y);
$galaxy = $donnees['galaxy'];
$ss = $donnees['ss'];
$pos = $donnees['pos'];
$nb = $donnees['nb'];
$nom_planete = $donnees['nom_planete'];
$image = $donnees['image'];
$cases = $donnees['cases'];
$debris_met = $donnees['debris_met'];
$debris_cri = $donnees['debris_cri'];
$metal = $donnees['metal'];
$cristal = $donnees['cristal'];
$hydrogene = $donnees['hydrogene'];
$timestamp = $donnees['timestamp'];
$coeff = $donnees['coeff'];
$energie = $donnees['energie'];
$temps_b = $donnees['temps_b'];
$bat = $donnees['bat'];
$mine_m = $donnees['mine_m'];
$mine_c = $donnees['mine_c'];
$mine_h = $donnees['mine_h'];
$centrale_s = $donnees['centrale_s'];
$centrale_f = $donnees['centrale_f'];
$radar = $donnees['radar'];
$labo = $donnees['labo'];
$chantier_terrestre = $donnees['chantier_terrestre'];
$chantier_spatial = $donnees['chantier_spatial'];
$caserne = $donnees['caserne'];
$silo = $donnees['silo'];
$temps_t = $donnees['temps_t'];
$tec = $donnees['tec'];
$informatique = $donnees['informatique'];
$detection = $donnees['detection'];
$armement = $donnees['armement'];
$energie_t = $donnees['energie_t'];
$reacteur = $donnees['reacteur'];
$reacteur_f = $donnees['reacteur_f'];
$reacteur_ff = $donnees['reacteur_ff'];
$medecine = $donnees['medecine'];
$tactique = $donnees['tactique'];
$developement = $donnees['developement'];
$blindage = $donnees['blindage'];
$transporteur = $donnees['transporteur'];
$gtransporteur = $donnees['gtransporteur'];
$vcolo = $donnees['vcolo'];
$sonde = $donnees['sonde'];
$recycleur = $donnees['recycleur'];
$chasseur = $donnees['chasseur'];
$fregate = $donnees['fregate'];
$croiseur = $donnees['croiseur1'];
$croiseur2 = $donnees['croiseur2'];
$pv = $donnees['pv'];
$sto = $donnees['sto'];
$soldat1 = $donnees['soldat1'];
$soldat2 = $donnees['soldat2'];
$soldat3 = $donnees['soldat3'];
$soldat4 = $donnees['soldat4'];
$sniper = $donnees['sniper'];
$spartam = $donnees['spartam'];
$medecin = $donnees['medecin'];
$ingenieur = $donnees['ingenieur'];
$soldat_lourd = $donnees['soldat_lourd'];
$vaisseau_att = $donnees['vaisseau_att'];
$vaisseau_1 = $donnees['vaisseau_1'];
$vaisseau_2 = $donnees['vaisseau_2'];
$vaisseau_3 = $donnees['vaisseau_3'];
$vcl_1 = $donnees['vcl_1'];
$vcl_2 = $donnees['vcl_2'];
$vcl_3 = $donnees['vcl_3'];
$vcl_4 = $donnees['vcl_4'];
$def_1 = $donnees['def_1'];
$def_2 = $donnees['def_2'];
$def_3 = $donnees['def_3'];
$def_4 = $donnees['def_4'];
$def_5 = $donnees['def_5'];
?>

View file

@ -0,0 +1,58 @@
<? echo "<html>
<head>
<title>Halo</title>
<link rel=stylesheet media=screen type=text/css title=design href=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 >";
include 'bdd.php';
function techno($nom, $niveau, $niveau_ress)
{
if ($niveau < $niveau_ress)
{
echo "<font color=red >".$nom." ".$niveau_ress."</font>";
}
else
{
echo "<font color=#40ff00 >".$nom." ".$niveau_ress."</font>";
}
}
echo"</head>
<body>
<div class=long>Petit transporteur</div>
<div class=ensemble>
<div class=e><img src=diz/unit/ptransporteur.JPG><br><br>
<u>Coût :</u><br>
Fer : <span class=rc>100</span><br>
Cristal : <span class=rc>200</span><br><br>
</div>
<i>Le petit transporteur est un vaisseau dont la tâche est d'acheminer des
matières premières ou des unités terrestres sur d'autres planètes rapidement.</i><br>
<u>Besoin de :</u><br>
Bâtiments : "; @techno("Chantier spatial", $chantier_spatial, 1);
echo "<br>Technologie : "; @techno("Propultion conventionelle", $propu, 3);
echo"<br><br><table align=center>
<tr><td align=left colspan=2 class=a>Caractéristiques :</td></tr>
<tr><td class=a>Puissance de feu</td><td class=b>5</td></tr>
<tr><td class=a>Point de structure</td><td class=b>300</td></tr>
<tr><td class=a>Bouclier de protection</td><td class=b>0</td></tr>
<tr><td class=a>Capacité totale</td><td td class=b>1000</></tr>
<tr><td class=a>Consommation de carburant</td><td class=b>10</td></tr>
<tr><td class=a>Rayon d'action</td><td class=b>moyen-faible</td></tr>
</table>
</div>
</body>
</html>";
?>

View file

@ -0,0 +1,58 @@
<? echo "<html>
<head>
<title>Halo</title>
<link rel=stylesheet media=screen type=text/css title=design href=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 >";
include 'bdd.php';
function techno($nom, $niveau, $niveau_ress)
{
if ($niveau < $niveau_ress)
{
echo "<font color=red >".$nom." ".$niveau_ress."</font>";
}
else
{
echo "<font color=#40ff00 >".$nom." ".$niveau_ress."</font>";
}
}
echo"</head>
<body>
<div class=long>Metal</div>
<div class=ensemble>
<div class=e><img src=diz/batiment/><br><br>
</div>
<i>description.</i><br>
<u>Besoin de :</u><br>
Bâtiments : "; @techno("Chantier spatial", $chantier_spatial, 1);
echo "<br>Technologie : "; @techno("Propultion conventionelle", $propu, 3);
echo"<br><br>";
$a=$mine_m+5;
$c=$mine_m-2;
if ($c < 0 ) { $c = 0; $a = 7; }
echo '<table align=center><tr><td>Niveau</td><td>Production par heure</td><td>Consommation énergie</td></tr><br>';
for ($c;$c<$a;$c++) {
$b=ceil((($c*40+(exp($c*0.33)*10))));
$h=ceil((($c*40+(exp($c*0.33)*10)))) - ceil(((($c-1)*40+(exp(($c-1)*0.33)*10))));
$p=ceil((exp($c*0.28)*10));
$g=ceil((exp($c*0.28)*10)) - ceil((exp(($c-1)*0.28)*10));
echo '<tr><td>'.$c.'</td><td>'.$b.' (+ '.$h.')</td><td>'.$p.' (+ '.$g.')</td></tr>';
}
echo"</table></td></tr>";
echo"</div>
</body>
</html>";
?>

View file

@ -0,0 +1,73 @@
<? echo"<html>
<head>
<title>Space battleship</title>
<link rel=stylesheet media=screen type=text/css title=design href=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 >";
$chantier_spatial = 2;
$propu = 2;
$pilotes = 2;
function techno($nom, $niveau, $niveau_ress)
{
if ($niveau < $niveau_ress)
{
echo "<font color=red >".$nom." ".$niveau_ress."</font>";
}
else
{
echo "<font color=#40ff00 >".$nom." ".$niveau_ress."</font>";
}
}
function equipe($nom, $perso, $need_perso)
{
if ($perso < $need_perso)
{
$z = abs($perso - $need_perso);
echo "<font color=red ><ACRONYM title='".$z." ".$nom."'>".$need_perso." ".$nom."</ACRONYM></font>";
}
else
{
echo "<font color=#40ff00 >".$need_perso." ".$nom."</font>";
}
}
echo"</head>
<body>
<div class=long>Petit transporteur</div>
<div class=ensemble>
<div class=e><img src=diz/unit/ptransporteur.JPG><br><br>
<u>Coût :</u><br>
Fer : <span class=rc>100</span><br>
Cristal : <span class=rc>200</span><br><br>
<u>Equipage :</u><br>"; @equipe(pilotes, $pilotes, 3);
echo "</div>
<i>Le petit transporteur est un vaisseau dont la tâche est d'acheminer des
matières premières ou des unités terrestres sur d'autres planètes rapidement.</i><br>
<u>Besoin de :</u><br>
Bâtiments : "; @techno("Chantier spatial", $chantier_spatial, 1);
echo "<br>Technologie : "; @techno("Propultion conventionelle", $propu, 3);
echo"<br><br><table align=center>
<tr><td align=left colspan=2 class=a>Caractéristiques :</td></tr>
<tr><td class=a>Puissance de feu</td><td class=b>5</td></tr>
<tr><td class=a>Point de structure</td><td class=b>300</td></tr>
<tr><td class=a>Bouclier de protection</td><td class=b>0</td></tr>
<tr><td class=a>Capacité totale</td><td td class=b>1000</></tr>
<tr><td class=a>Consommation de carburant</td><td class=b>10</td></tr>
<tr><td class=a>Rayon d'action</td><td class=b>moyen-faible</td></tr>
</table>
</div>
</body>
</html>";
?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 247 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 248 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

View file

@ -0,0 +1,49 @@
body {
color: #FF0000;
background-color: #000000;
background-image: url('panel/background.jpg');
scrollbar-arrow-color: #E6EBFB;
scrollbar-base-color: #344566;
scrollbar-track-color: #344566;
scrollbar-face-color: #344566;
scrollbar-highlight-color: #344566;
scrollbar-3dlight-color: #465673;
scrollbar-darkshadow-color: #344566;
scrollbar-shadow-color: #465673;
font-size: 13px;
font-family: Tahoma,sans-serif;
margin-left: 68px;
margin-bottom: 20px;
}
u {
font-style: underline;
}
i {
font-style: italic;
}
a {
color: #4080ff;
font-size: 12px;
font-family: verdana, serif;
text-decoration: underline;
border: none;
}
img {
border: none;
}
a:hover {
cursor: pointer;
}
a:active, a:focus {
cursor: wait;
}
a:visited {
cursor: pointer;
}

View file

@ -0,0 +1,215 @@
body
{
color: #7093DB;
background-color: #040e1e;
background-image: url('fondf.jpg');
background-attachment: fixed;
background-repeat: no-repeat;
background-position: top left;
scrollbar-arrow-color: #E6EBFB;
scrollbar-base-color: #344566;
scrollbar-track-color: #344566;
scrollbar-face-color: #344566;
scrollbar-highlight-color: #344566;
scrollbar-3dlight-color: #465673;
scrollbar-darkshadow-color: #344566;
scrollbar-shadow-color: #465673;
font-size: 13px;
font-family: Tahoma,sans-serif;
margin-left: 68px;
margin-bottom: 20px;
}
u {
font-style: underline;
}
i {
font-style: italic;
}
a {
color: #4080ff;
font-size: 12px;
font-family: verdana, serif;
text-decoration: underline;
border: none;
}
img {
border: 0;
}
a:hover {
cursor: pointer;
}
a:active, a:focus {
cursor: wait;
}
a:visited {
cursor: pointer;
}
.zone_texte {
background-color: #000031;
color: #4080ff;
border: 1px solid #1256C6;
font-family: verdana, serif;
}
.bouton {
background-color: navy;
color: #afbdff;
font-family: verdana, serif;
BORDER-LEFT-COLOR: white;
BORDER-BOTTOM-COLOR: navy;
BORDER-TOP-COLOR: white;
BACKGROUND-COLOR: navy;
BORDER-RIGHT-COLOR: navy;
BORDER-STYLE: outset;
}
.bouton:hover {
color: red;
}
.bouton:active {
BORDER-STYLE: inset;
color: red;
}
div {
border: 1px solid #004080;
float: left;
margin: 1 1 1 1;
}
div.a {
height: 132;
width: 130;
}
div.b {
height: 132;
width: 400;
text-align: justify;
background-image: url(fond/apb.jpg);
}
div.c {
height: 132;
width: 149;
text-align: center;
background-image: url(fond/apc.jpg);
}
div.d {
background-color: #00024A;
border: 1px solid #02058A;
margin-bottom: 20;
margin-left: 450;
}
div.fin {
height: 20;
width: 339;
text-align: center;
background-image: url(fond/apfin.jpg);
}
div.long {
font-weight: bold;
color: #ff8040;
width: 550;
text-align: center;
margin-left: 90px;
}
div.ensemble {
width: 550;
height: 300;
margin-left: 90px;
}
div.e {
height: 280;
width: 125;
text-align: justify;
background-color: #000151;
border: 0;
border-right: 1px solid #004080;
float: left;
margin: 0;
margin-right: 8px;
padding: 15 10 5 10;
}
#axion {
color: white;
font-weight: bold;
border: 0;
background-color: transparent;
margin-top: 50px;
}
span.description {
font-size: 12px;
font-style: italic;
}
br.a {
clear: both;
}
span.rc {
font-size: 13px;
font-family: Tahoma,sans-serif;
font-weight: bold;
color: #ffc080;
}
table {
border-collapse: separate;
empty-cells: show;
text-align: center;
border: 0px;
font-size: 12px;
vertical-align: middle;
}
table#ressource {
margin-bottom: 35px;
}
TD {
background-color: #00024A;
border: 1px solid #02058A;
}
TD.a {
background-color: #000151;
border: 1px solid #040e1e;
width: 210px;
}
TD.b {
background-color: #000151;
border: 1px solid #040e1e;
width: 150px;
}
TD.xyz {
background-color: #000151;
border: 1px solid #000170;
}
/*attaque {
color: #CC0000;
}
filter: alpha(opacity=10);
-moz-opacity: 0.9; */

View file

@ -0,0 +1,253 @@
body
{
color: #7093DB;
background-color: #040e1e;
background-image: url('1720.jpg');
background-attachment: fixed;
background-repeat: no-repeat;
background-position: top left;
scrollbar-arrow-color: #E6EBFB;
scrollbar-base-color: #344566;
scrollbar-track-color: #344566;
scrollbar-face-color: #344566;
scrollbar-highlight-color: #344566;
scrollbar-3dlight-color: #465673;
scrollbar-darkshadow-color: #344566;
scrollbar-shadow-color: #465673;
font-size: 13px;
font-family: Tahoma,sans-serif;
margin-left: 68px;
margin-bottom: 20px;
}
u {
font-style: underline;
}
i {
font-style: italic;
}
a {
color: #4080ff;
font-size: 12px;
font-family: verdana, serif;
text-decoration: underline;
border: none;
}
img {
border: none;
}
a:hover {
cursor: pointer;
}
a:active, a:focus {
cursor: wait;
}
a:visited {
cursor: pointer;
}
.zone_texte {
background-color: #000031;
color: #4080ff;
border: 1px solid #1256C6;
font-family: verdana, serif;
}
.bouton {
background-color: navy;
color: #afbdff;
font-family: verdana, serif;
BORDER-LEFT-COLOR: white;
BORDER-BOTTOM-COLOR: navy;
BORDER-TOP-COLOR: white;
BACKGROUND-COLOR: navy;
BORDER-RIGHT-COLOR: navy;
BORDER-STYLE: outset;
}
.bouton:hover {
color: red;
}
.bouton:active {
BORDER-STYLE: inset;
color: red;
}
div {
border: 1px solid #004080;
float: left;
margin: 1 1 1 1;
}
div.centre {
border: none;
float: none;
margin: auto;
text-align: center;
}
div.a {
height: 132px;
width: 130px;
}
div.b {
height: 132px;
width: 400px;
text-align: justify;
background-image: url(fond/apb.jpg);
}
div.c {
height: 132px;
width: 149px;
text-align: center;
background-image: url(fond/apc.jpg);
}
div.d {
background-color: #00024A;
border: 1px solid #02058A;
margin-bottom: 20;
margin-left: 450;
}
div.fin {
height: 20px;
width: 339px;
text-align: center;
background-image: url(fond/apfin.jpg);
}
div.long {
font-weight: bold;
color: #ff8040;
width: 550px;
text-align: center;
margin-left: 90px;
}
div.ensemble {
width: 550;
height: 300;
margin-left: 90px;
}
div.e {
height: 280px;
width: 125px;
text-align: justify;
background-color: #000151;
border: 0;
border-right: 1px solid #004080;
float: left;
margin: 0;
margin-right: 8px;
padding: 15 10 5 10;
}
#axion {
color: white;
font-weight: bold;
border: none;
background-color: transparent;
margin-top: 50px;
}
.description {
width: 99%;
font-style: italic;
border: none;
}
br.a {
clear: both;
}
span.rc {
font-size: 13px;
font-family: Tahoma,sans-serif;
font-weight: bold;
color: #ffc080;
}
table {
border-collapse: separate;
empty-cells: show;
text-align: center;
border: 0px;
font-size: 12px;
vertical-align: middle;
}
table#ressource {
margin-bottom: 35px;
}
TD {
background-color: #00024A;
border: 1px solid #02058A;
}
TD.a {
background-color: #000151;
border: 1px solid #040e1e;
width: 210px;
}
TD.b {
background-color: #000151;
border: 1px solid #040e1e;
width: 150px;
}
TD.xyz {
background-color: #000151;
border: 1px solid #000170;
}
td.bla {
height: 132px;
width: 130px;
border: 1px solid #004080;
background-repeat: no-repeat;
}
td.blb {
height: 132px;
width: 400px;
text-align: justify;
background-image: url(fond/apb.jpg);
border: 1px solid #004080;
}
td.blc {
height: 132px;
width: 149px;
text-align: center;
background-image: url(fond/apc.jpg);
border: 1px solid #004080;
}
td.bld {
background-color: #00024A;
border: 1px solid #02058A;
margin-bottom: 20;
margin-left: 450;
}
/*attaque {
color: #CC0000;
}
filter: alpha(opacity=10);
-moz-opacity: 0.9; */

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 827 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 248 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 591 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

View file

@ -0,0 +1,428 @@
<?php
//session_start();
set_time_limit(10);
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
/* ! ATTENTION ! NE PAS FAIRE DE REFERENCE A UNE DONNEE DU FICHIER BDD.PHP OU
* DE L'UTILISATEUR COURANT CAR LE SCRIPT EST LANCE PAR L'ATTAQUANT ET PAR
* L'ATTAQUé.
*/
include('bdd.php');
include('noms.php');
require_once('../fonctions.php');
require('../connectBDD.php');
function resteVaisseau($tableau){
$ct = count($tableau);
for ($i = 0; $i < $ct; $i++) {
if (!empty($tableau[$i])) return true;
}
return false;
}
$req = mysql_query("SELECT * FROM flottes WHERE `id_user` = '$id' OR (`end_galaxie` = '$galaxy' AND `end_ss` = '$ss' AND `end_position` = '$pos')");
while ($resultat = mysql_fetch_array($req)) {
$id_flotte = $resultat['id'];
$mission = $resultat['mission'];
$end_galaxie = $resultat['end_galaxie'];
$end_ss = $resultat['end_ss'];
$end_position = $resultat['end_position'];
if ($resultat['effectue'] != 1 && time() >= $resultat['start_time'] + $resultat['end_time'] && !empty($resultat['end_time'])) {
//Mission attaquer
if ($mission == 1) {
//Définition des variables
$deb_met = 0;
$deb_cri = 0;
//Récupération d'informations sur le joueur cible : nombre de vaisseaux, défenses
$reqd = mysql_query("SELECT * FROM planete WHERE `galaxie` = '$end_galaxie' AND `ss` = '$end_ss' AND `position` = '$end_position'");
$resultatd = mysql_fetch_array($reqd);
//Génération des tableaux contenant les informations de chaque vaisseaux
$ATvais = ''; $ENvais = ''; $ENdef = ''; $ATvais_pv = ''; $ENvais_pv = ''; $ENdef_pv = ''; $ATvais_bc = ''; $ENvais_bc = ''; $ENdef_bc = '';
for ($i = 1; $i <= 12; $i++) {
//Données joueur attaquant
for ($j = 1; $j <= $resultat['vaisseau_'.$i]; $j++) {
$ATvais .= $i.' '; //Récupération du type du vaisseau
$ATvais_pv .= $nomvais_pv[$i-1].' '; //Récupération des PV du vaisseau suivant son type
$ATvais_bc .= $nomvais_bc[$i-1].' '; //Récupération des boucliers du vaisseau suivant son type
}
//Données joueur cible
for ($j = 1; $j <= $resultatd['vaisseau_'.$i]; $j++) {
$ENvais .= $i.' '; //Récupération du type du vaisseau
$ENvais_pv .= $nomvais_pv[$i-1].' '; //Récupération des PV du vaisseau suivant son type
$ENvais_bc .= $nomvais_bc[$i-1].' '; //Récupération des boucliers du vaisseau suivant son type
}
}
//Génération des tableaux contenant les informations des défenses de la planète
for ($i = 1; $i <= 5; $i++) {
for ($j = 1; $j <= $resultatd['def_'.$i]; $j++) {
$ENdef .= $i.' '; //Récupération du type de défense
$ENdef_pv .= $defense_pv[$i-1].' '; //Récupération des PV de la défense suivant son type
$ENdef_bc .= $defense_bc[$i-1].' '; //Récupération des boucliers de la défense suivant son type
}
}
//Création des tableaux
$ATvais = split(' ', trim($ATvais));
$ENvais = split(' ', trim($ENvais));
$ENdef = split(' ', trim($ENdef));
$ATvais_pv = split(' ', trim($ATvais_pv));
$ENvais_pv = split(' ', trim($ENvais_pv));
$ENdef_pv = split(' ', trim($ENdef_pv));
$ATvais_bc = split(' ', trim($ATvais_bc));
$ENvais_bc = split(' ', trim($ENvais_bc));
$ENdef_bc = split(' ', trim($ENdef_bc));
while(resteVaisseau($ATvais) && (resteVaisseau($ENvais) || resteVaisseau($ENdef))) {
//Récupération du nombre de vaisseaux attaquant
$nb_ATvais = count($ATvais);
//Attaque des vaisseaux un par un
for ($i = 0; $i<$nb_ATvais ; $i++) {
//Définition des paramètres du vaisseau qui va attaquer
$vaisAT_id = $i; //ID du vaisseau dans le tableau
$vaisAT_type = $ATvais[$vaisAT_id] - 1; //type du vaisseau pour une utilisation inter-tableaux : départ à 0 et non à 1
$vaisAT_pv = $ATvais_pv[$vaisAT_id]; //récupération du nombre de PV du vaisseau
$vaisAT_bc = $ATvais_bc[$vaisAT_id]; //Récupération du bouclier
$vaisAT_at = $nomvais_at[$vaisAT_type];
//On ne fait quelque chose que si le vaisseau à encore des point de vie
if ($vaisAT_pv > 0) {
/* Formation défense majeur, attaque aléatoire
*
* Régénération des boucliers 100%
* Attaque suivant les proportions vaisseaux/défenses du joueur cible
*/
//Si le bouclier est endommagé, on le régénére
if ($vaisAT_bc < $nomvais_bc[$vaisAT_type]) {
$vaisAT_bc = $ATvais_bc[$vaisAT_id] = $nomvais_bc[$vaisAT_type];
}
//Le bouclier est intact, on attaque aléatoirement une défense ou un vaisseau
else {
//Le vaisseau attaque tant qu'il lui reste des points d'attaques disponibles ou tant qu'il reste des vaisseaux et des défenses à attaquer
while($vaisAT_at > 0 && (resteVaisseau($ENvais) || resteVaisseau($ENdef))) {
//Détermine le nombre de vaisseaux et de défenses
$ENnbvais = count($ENvais);
$ENnbdef = count($ENdef);
//Choix du vaisseau ou de la défense qui va être attaquée
$vaisEN_id = rand(1,$ENnbvais+$ENnbdef);
//Si l'unité attaquée est un vaisseau
if ($vaisEN_id <= $ENnbvais) {
$vaisEN_id--;
//Définition des paramètres du vaisseau attaqué
$vaisEN_type = $ENvais[$vaisEN_id] - 1;
$vaisEN_pv = $ENvais_pv[$vaisEN_id];
$vaisEN_bc = $ENvais_bc[$vaisEN_id];
//Si le vaisseau n'a plus de PV, on en attaque un autre
if ($vaisEN_pv <= 0) continue;
//Recherche du rapide fire pour le vaisseau attaqué
$vaisAT_rf = $nomvais_rf[$vaisAT_type][$vaisEN_type];
//Si le vaisseau est détruit
if ($vaisEN_pv + $vaisEN_bc <= $vaisAT_at * $vaisAT_rf) {
//On efface la trace du vaisseau
$ENvais[$vaisEN_id] = '';
$ENvais_pv[$vaisEN_id] = 0;
//Recalcul de l'attaque restante du vaisseau
$vaisAT_at -= floor(($vaisEN_pv + $vaisEN_bc) / $vaisAT_rf);
//On ajoute les débris du vaisseau dans le champ de débris de la planète
$deb_met += $nomvais_md[$vaisEN_type];
$deb_cri += $nomvais_cd[$vaisEN_type];
}
//Si le vaisseau est endommagé
else {
//Calcul du nombre de points de vies perdu par le vaisseau
$atarr = $vaisEN_bc - ($vaisAT_at * $vaisAT_rf);
if ($atarr < 0) $ENvais_pv[$vaisEN_id] += $atarr;
$vaisAT_at -= floor(($vaisEN_pv + $vaisEN_bc) / $vaisAT_rf);
}
}
//Si l'unité attaquée est une défense
else {
//Recherche de l'ID de la défense
$defEN_id = $vaisEN_id - $ENnbvais - 1;
//Définitions des paramètres de la défense
$defEN_type = $ENdef[$defEN_id] - 1;
$defEN_pv = $ENdef_pv[$defEN_id];
//Si la défense n'a plus de point de vie, on attaque une autre unité
if ($defEN_pv <= 0) continue;
$defEN_bc = $defense_bc[$defEN_type];
//Recherche du rapide fire pour la défense attaquée
$vaisAT_rf = 1;
//$vaisAT_rf = $nomvais_rfD[$vaisAT_type][$defEN_type];
//Si la défense est détruite
if ($defEN_pv + $defEN_bc <= $vaisAT_at * $vaisAT_rf) {
//On efface la trace de la défense
$ENdef[$defEN_id] = '';
$ENdef_pv[$defEN_id] = 0;
//Recalcul de l'attaque restante du vaisseau
$vaisAT_at -= floor(($defEN_pv + $defEN_bc) / $vaisAT_rf);
}
//Si la défense est endommagée
else {
//Calcul du nombre de points de vies perdu par le vaisseau
$atarr = $defEN_bc - ($vaisAT_at * $vaisAT_rf);
if ($atarr < 0) $ENdef_pv[$defEN_id] += $atarr;
$vaisAT_at -= floor(($defEN_pv + $defEN_bc) / $vaisAT_rf);
}
}
}
}
}
}
//Récupération du nombre de vaisseaux défenseurs
$nb_ENvais = count($ENvais);
//Attaque des vaisseaux un par un
for ($i = 0; $i<$nb_ENvais ; $i++) {
//Définition des paramètres du vaisseau qui va attaquer
$vaisEN_id = $i; //ID du vaisseau dans le tableau
$vaisEN_type = $ENvais[$vaisEN_id]; //type du vaisseau pour une utilisation inter-tableaux : départ à 0 et non à 1
//Si le vaisseau est détrui, on passe directement au suivant
if (empty($vaisEN_type)) continue;
$vaisEN_type--;
$vaisEN_pv = $ENvais_pv[$vaisEN_id]; //récupération du nombre de PV du vaisseau
print $vaisEN_id.' - '.$vaisEN_type.'<br/>';
$vaisEN_bc = $ENvais_bc[$vaisEN_id]; //Récupération du bouclier
$vaisEN_at = $nomvais_at[$vaisEN_type];
//On ne fait quelque chose que si le vaisseau à encore des point de vie
if ($vaisEN_pv > 0) {
/* Formation défense majeur, attaque aléatoire
*
* Régénération des boucliers 100%
* Attaque suivant les proportions vaisseaux/défenses du joueur cible
*/
//Si le bouclier est endommagé, on le régénére
if ($vaisEN_bc < $nomvais_bc[$vaisEN_type]) {
$vaisEN_bc = $ENvais_bc[$vaisEN_id] = $nomvais_bc[$vaisEN_type];
}
//Le bouclier est intact, on attaque aléatoirement une défense ou un vaisseau
else {
//Le vaisseau attaque tant qu'il lui reste des points d'attaques disponibles ou tant qu'il reste des vaisseaux et des défenses à attaquer
while($vaisEN_at > 0 && resteVaisseau($ATvais)) {
//Détermine le nombre de vaisseaux
$ATnbvais = count($ATvais);
//Choix du vaisseau qui va être attaquée
$vaisAT_id = rand(1,$ATnbvais);
//Si l'unité attaquée est un vaisseau
if ($vaisAT_id <= $ATnbvais) {
$vaisAT_id--;
//Définition des paramètres du vaisseau attaqué
$vaisAT_type = $ATvais[$vaisAT_id] - 1;
$vaisAT_pv = $ATvais_pv[$vaisAT_id];
$vaisAT_bc = $ATvais_bc[$vaisAT_id];
//Si le vaisseau n'a plus de PV, on en attaque un autre
if ($vaisAT_pv <= 0) continue;
//Recherche du rapide fire pour le vaisseau attaqué
$vaisEN_rf = $nomvais_rf[$vaisEN_type][$vaisAT_type];
//Si le vaisseau est détruit
if ($vaisAT_pv + $vaisAT_bc <= $vaisEN_at * $vaisEN_rf) {
//On efface la trace du vaisseau
$ATvais[$vaisAT_id] = '';
$ATvais_pv[$vaisAT_id] = 0;
//Recalcul de l'attaque restante du vaisseau
$vaisEN_at -= floor(($vaisAT_pv + $vaisAT_bc) / $vaisEN_rf);
//On ajoute les débris du vaisseau dans le champ de débris de la planète
$deb_met += $nomvais_md[$vaisAT_type];
$deb_cri += $nomvais_cd[$vaisAT_type];
}
//Si le vaisseau est endommagé
else {
//Calcul du nombre de points de vies perdu par le vaisseau
$atarr = $vaisAT_bc - ($vaisEN_at * $vaisEN_rf);
if ($atarr < 0) $ATvais_pv[$vaisAT_id] += $atarr;
$vaisEN_at -= floor(($vaisAT_pv + $vaisAT_bc) / $vaisEN_rf);
}
}
}
}
}
}
}
//Récalcul des vaisseaux restants
$ATvaisseaux = array_count_values($ATvais);
$ATvaisseau_1 = $ATvaisseaux['1']; $ATvaisseau_2 = $ATvaisseaux['2']; $ATvaisseau_3 = $ATvaisseaux['3']; $ATvaisseau_4 = $ATvaisseaux['4']; $ATvaisseau_5 = $ATvaisseaux['5']; $ATvaisseau_6 = $ATvaisseaux['6']; $ATvaisseau_7 = $ATvaisseaux['7']; $ATvaisseau_8 = $ATvaisseaux['8']; $ATvaisseau_9 = $ATvaisseaux['9']; $ATvaisseau_10 = $ATvaisseaux['10']; $ATvaisseau_11 = $ATvaisseaux['11']; $ATvaisseau_12 = $ATvaisseaux['12'];
$AT_nbvais = $ATvaisseau_1 + $ATvaisseau_2 + $ATvaisseau_3 + $ATvaisseau_4 + $ATvaisseau_5 + $ATvaisseau_6 + $ATvaisseau_7 + $ATvaisseau_8 + $ATvaisseau_9 + $ATvaisseau_10 + $ATvaisseau_11 + $ATvaisseau_12;
$contenu_max = $nomvais_rs[0]*$ATvaisseau_1 + $nomvais_rs[1]*$ATvaisseau_2 + $nomvais_rs[2]*$ATvaisseau_3 + $nomvais_rs[3]*$ATvaisseau_4 + $nomvais_rs[4]*$ATvaisseau_5 + $nomvais_rs[5]*$ATvaisseau_6 + $nomvais_rs[6]*$ATvaisseau_7 + $nomvais_rs[7]*$ATvaisseau_8 + $nomvais_rs[8]*$ATvaisseau_9 + $nomvais_rs[9]*$ATvaisseau_10 + $nomvais_rs[10]*$ATvaisseau_11 + $nomvais_rs[11]*$ATvaisseau_12;
$ENvaisseaux = array_count_values($ENvais);
$ENvaisseau_1 = $ENvaisseaux['1']; $ENvaisseau_2 = $ENvaisseaux['2']; $ENvaisseau_3 = $ENvaisseaux['3']; $ENvaisseau_4 = $ENvaisseaux['4']; $ENvaisseau_5 = $ENvaisseaux['5']; $ENvaisseau_6 = $ENvaisseaux['6']; $ENvaisseau_7 = $ENvaisseaux['7']; $ENvaisseau_8 = $ENvaisseaux['8']; $ENvaisseau_9 = $ENvaisseaux['9']; $ENvaisseau_10 = $ENvaisseaux['10']; $ENvaisseau_11 = $ENvaisseaux['11']; $ENvaisseau_12 = $ENvaisseaux['12'];
$ENdefenses = array_count_values($ENdef);
$ENdefense_1 = $ENdefenses['1']; $ENdefense_2 = $ENdefenses['2']; $ENdefense_3 = $ENdefenses['3']; $ENdefense_4 = $ENdefenses['4']; $ENdefense_5 = $ENdefenses['5'];
if (!resteVaisseau($ATvais)) {
$win = false;
mysql_query("DELETE FROM `flottes` WHERE `id` = '$id_flotte'") or die ("erreur sql ".mysql_error());
}
else {
$win = true;
if ($contenu_max-$resultat['contenu_metal']-$resultat['contenu_cristal']-$resultat['contenu_hydrogene'] > 0) {
$pillage = pillage($resultatd['metal'], $resultatd['cristal'], $resultatd['hydrogene'], $contenu_max-$resultat['contenu_metal']-$resultat['contenu_cristal']-$resultat['contenu_hydrogene']);
$Cmetal = $resultat['contenu_metal'] + $pillage[0];
$Ccristal = $resultat['contenu_cristal'] + $pillage[1];
$Chydrogene = $resultat['contenu_hydrogene'] + $pillage[2];
}
else {
$Cmetal = 0;
$Ccristal = 0;
$Chydrogene = 0;
}
mysql_query("UPDATE `flottes` SET `effectue` = '1', `contenu_metal` = '$Cmetal', `contenu_cristal` = '$Ccristal', `contenu_hydrogene` = '$Chydrogene', `nb_vais` = '$AT_nbvais', `vaisseau_1` = '$ATvaisseau_1', `vaisseau_2` = '$ATvaisseau_2', `vaisseau_3` = '$ATvaisseau_3', `vaisseau_4` = '$ATvaisseau_4', `vaisseau_5` = '$ATvaisseau_5', `vaisseau_6` = '$ATvaisseau_6', `vaisseau_7` = '$ATvaisseau_7', `vaisseau_8` = '$ATvaisseau_8', `vaisseau_9` = '$ATvaisseau_9', `vaisseau_10` = '$ATvaisseau_10', `vaisseau_11` = '$ATvaisseau_11', `vaisseau_12` = '$ATvaisseau_12' WHERE `id` = '$id_flotte'") or die ("erreur sql ".mysql_error());
//Mise à jour de la quantité de ressources sur la planète pillée
$planMetal = $resultatd['metal'] - $pillage[0];
$planCristal = $resultatd['cristal'] - $pillage[1];
$planHydrogene = $resultatd['hydrogene'] - $pillage[2];
mysql_query("UPDATE `planete` SET `metal` = '$planMetal', `cristal` = '$planCristal', `hydrogene` = '$planHydrogene' WHERE `galaxie` = '$end_galaxie' AND `ss` = '$end_ss' AND `position` = '$end_position'") or die ("erreur sql ".mysql_error());
}
mysql_query("UPDATE `planete` SET `debris_met` = '$deb_met', `debris_cri` = '$deb_cri', `vaisseau_1` = '$ENvaisseau_1', `vaisseau_2` = '$ENvaisseau_2', `vaisseau_3` = '$ENvaisseau_3', `vaisseau_4` = '$ENvaisseau_4', `vaisseau_5` = '$ENvaisseau_5', `vaisseau_6` = '$ENvaisseau_6', `vaisseau_7` = '$ENvaisseau_7', `vaisseau_8` = '$ENvaisseau_8', `vaisseau_9` = '$ENvaisseau_9', `vaisseau_10` = '$ENvaisseau_10', `vaisseau_11` = '$ENvaisseau_11', `vaisseau_12` = '$ENvaisseau_12', `def_1` = '$ENdefense_1', `def_2` = '$ENdefense_2', `def_3` = '$ENdefense_3', `def_4` = '$ENdefense_4', `def_5` = '$ENdefense_5' WHERE `galaxie` = '$end_galaxie' AND `ss` = '$end_ss' AND `position` = '$end_position'") or die ("erreur sql ".mysql_error());
//Envoie d'un mail à l'attaquant
if ($win) $message = 'L\'attaque que nous avons lancé contre la planète '.$end_galaxie.':'.$end_ss.':'.$end_position.' s\'est terminée avec succès puisque nous avons gagné.<br /><br />Nous rapportons dans nos cales : '.$pillage[0].' de '.$ressourc[0].', '.$pillage[1].' de '.$ressourc[1].' et '.$pillage[2].' de '.$ressourc[2].'.';
else $message = 'L\'attaque que nous avons lancé contre la planète '.$end_galaxie.':'.$end_ss.':'.$end_position.' s\'est terminée par une défaite.<br /><br />Un champ de débris composé de '.$deb_met.' de '.$ressourc[0].' et '.$deb_cri.' de '.$ressourc[1].' s\'est formé à la suite de cette bataille.';
$pseudo = trouvNom($resultat['id_user']);
$temps = $resultat['start_time'] + $resultat['end_time'];
mysql_query("INSERT INTO mail VALUES('', '1', '$pseudo', '', 'Attaque', '$message', '$temps')");
//Envoie d'un mail au défenseur
if ($win) $message = 'Nous venons de subir une attaque sur la planète '.$end_galaxie.':'.$end_ss.':'.$end_position.'. Nos défenses n\'ont pas suffi à arrêter l\'ennemi qui est reparti avec près de '.$pillage[0].' de '.$ressourc[0].', '.$pillage[1].' de '.$ressourc[1].' et '.$pillage[2].' de '.$ressourc[2].'.';
$pseudo = trouvNom($resultatd['id_user']);
mysql_query("INSERT INTO mail VALUES('', '1', '$pseudo', '', 'Attaque', '$message', '$temps')");
}
//Mission Transporter
elseif ($mission == 2) {
$reqT = mysql_query("SELECT metal,cristal,hydrogene FROM `planete` WHERE `galaxie` = '$end_galaxie' AND `ss` = '$end_ss' AND `position` = '$end_position'") or die ("erreur sql ".mysql_error());
$resultatT = mysql_fetch_array($reqT);
$Cmetal = $resultat['contenu_metal'] + $resultatT['metal'];
$Ccristal = $resultat['contenu_cristal'] + $resultatT['cristal'];
$Chydrogene = $resultat['contenu_hydrogene'] + $resultatT['hydrogene'];
mysql_query("UPDATE `planete` SET `metal` = '$Cmetal', `cristal` = '$Ccristal', `hydrogene` = '$Chydrogene' WHERE `galaxie` = '$end_galaxie' AND `ss` = '$end_ss' AND `position` = '$end_position'") or die ("erreur sql ".mysql_error());
mysql_query("UPDATE `flottes` SET `effectue` = '1', `contenu_metal` = '0', `contenu_cristal` = '0', `contenu_hydrogene` = '0' WHERE `id` = '$id_flotte'") or die ("erreur sql ".mysql_error());
$message = 'Vos vaisseaux ont déposés '.$resultat['contenu_metal'].' de métal, '.$resultat['contenu_cristal'].' de cristal et '.$resultat['contenu_hydrogene'].' d\'hydrogène aux coordonnées '.$end_galaxie.':'.$end_ss.':'.$end_position;
mysql_query("INSERT INTO mail VALUES('', '1', '$pseudo', '', 'Transport', '$message', '$temps')");
}
//Mission Coloniser
elseif ($mission == 3) {
$reqT = mysql_query("SELECT * FROM `planete` WHERE `galaxie` = '$end_galaxie' AND `ss` = '$end_ss' AND `position` = '$end_position'") or die ("erreur sql ".mysql_error());
if (!mysql_num_rows($reqT) > 0) {
$time = time();
$temps = time();
$cases = mt_rand(125,222);
$image = mt_rand(1,15);
$reqIsol = mysql_query("SELECT * FROM planete WHERE id_user='$id'");
if (mysql_num_rows($reqIsol) >= 11) $isolement = time() + rand(9000,170000);
else $isolement = 0;
mysql_query("INSERT INTO planete (`id_user`, `isolement`, `nom_planete`, `galaxie`, `ss`, `position`, `image`, `cases`, `timestamp`, `metal`, `cristal`) VALUES ('$id', '$isolement', 'Planète colonisée', '$end_galaxie', '$end_ss', '$end_position', '$image', '$cases', '$time', '1000', '700')") or die ("erreur sql ".mysql_error());
mysql_query("UPDATE `flottes` SET `effectue` = '1', `vaisseau_3` = '0' WHERE `id` = '$id_flotte'") or die ("erreur sql ".mysql_error());
$message = 'Votre vaisseau a atteint la planète ['.$end_galaxie.':'.$end_ss.':'.$end_position.'] et commence la colonisation';
$pseudo = trouvNom($resultat['id_user']);
mysql_query("INSERT INTO mail VALUES('', '1', '$pseudo', '', 'Colonisation', '$message', '$temps')") or die ("erreur sql ".mysql_error());
$reqP = mysql_query("SELECT * FROM `planete` WHERE `id_user` = '$id'") or die ("erreur sql ".mysql_error());
$reqPM = mysql_query("SELECT `planeteMere` FROM `user` WHERE `id` = '$id'") or die ("erreur sql ".mysql_error());
$resultatPM = mysql_fetch_array($reqPM);
$c=0;
for ($m=0 ; $m<mysql_num_rows($reqP) ; $m++) {
$resultatP = mysql_fetch_array($reqP);
$idP = $resultatP['id'];
if ($resultatPM['planeteMere'] == $idP || ($resultatPM['planeteMere'] == 0 && $m == 0)) mysql_query("UPDATE `planete` SET `nColo` = '0' WHERE `id`='$idP';");
else {
$c++;
mysql_query("UPDATE `planete` SET `nColo` = '$c' WHERE `id`='$idP';");
}
}
}
else mysql_query("INSERT INTO mail VALUES('', '1', '$pseudo', '', 'Colonisation', 'Nous n''avons pas pu coloniser la planète [$end_galaxie:$end_ss:$end_position] car lorsque nous sommes arrivé sur place, elle était déjà colonisée.', '$temps')") or die ("erreur sql ".mysql_error());
}
//Mission Recycler
elseif ($mission == 4) {
$reqT = mysql_query("SELECT * FROM `planete` WHERE `galaxie` = '$end_galaxie' AND `ss` = '$end_ss' AND `position` = '$end_position'") or die ("erreur sql ".mysql_error());
if (mysql_num_rows($reqT) > 0) {
$resultatT = mysql_fetch_array($reqT);
$resultat['contenu_max'] -= vais_conso($resultat['end_time'],count($resultat['nbvais'])) + $resultat['contenu_metal'] + $resultat['contenu_cristal'] + $resultat['contenu_hydrogene'];
$debris_met = $resultatT['debris_met'];
$debris_cri = $resultatT['debris_cri'];
if ($debris_met+$debris_cri > $resultat['contenu_max']) {
$a=pow($capacite/2);
$b=pow($capacite/2);
if ($a > $debris_met && $b > $debris_cri) {
$a = $debris_met;
$b = $debris_cri;
}
else if ($a > $debris_met) {
$a = $debris_met;
$b = ($capacite - $a);
}
else if ($b > $debris_cri) {
$b = $debris_cri;
$a = ($capacite - $b);
}
}
else {
$a = $debris_met;
$b = $debris_cri;
}
$Cmetal += $a + $resultat['contenu_metal'];
$Ccristal += $b + $resultat['contenu_cristal'];
$debris_met -= $a;
$debris_cri -= $b;
mysql_query("UPDATE `flottes` SET `effectue` = '1', `contenu_metal` = '$Cmetal', `contenu_cristal` = '$Ccristal' WHERE `id` = '$id_flotte'") or die ("erreur sql ".mysql_error());
mysql_query("UPDATE `planete` SET `debris_met` = '$debris_met', `debris_cri` = '$debris_cri' WHERE `galaxie` = '$end_galaxie' AND `ss` = '$end_ss' AND `position` = '$end_position'") or die ("erreur sql ".mysql_error());
$message = 'Vos vaisseaux récoltent '.$a.' de métal et '.$b.' de cristal aux coordonnées '.$end_galaxie.':'.$end_ss.':'.$end_position;
$pseudo = trouvNom($resultat['id_user']);
mysql_query("INSERT INTO mail VALUES('', '1', '$pseudo', '', 'Transport', '$message', '$temps')") or die ("erreur sql ".mysql_error());
}
}
}
if (time() >= $resultat['start_time'] + $resultat['end_time'] * 2 && !empty($resultat['end_time']) && $resultat['mission'] != 0) {
$start_galaxie = $resultat['start_galaxie'];
$start_ss = $resultat['start_ss'];
$start_position = $resultat['start_position'];
$id_flotte = $resultat['id'];
$reqP = mysql_query("SELECT * FROM planete WHERE `id_user` = '$id' AND `galaxie` = '$start_galaxie' AND `ss` = '$start_ss' AND `position` = '$start_position'") or die ("erreur sql ".mysql_error());
$resultatP = mysql_fetch_array($reqP);
$metal = $resultat['contenu_metal'] + $resultatP['metal'];
$cristal = $resultat['contenu_cristal'] + $resultatP['cristal'];
$hydrogene = $resultat['contenu_hydrogene'] + $resultatP['hydrogene'];
for($i = 1; $i <= 12; $i++) {
${'Pvaisseaux_'.$i} = $resultatP['vaisseau_'.$i] + $resultat['vaisseau_'.$i];
mysql_query("UPDATE `planete` SET `vaisseau_$i` = '${'Pvaisseaux_'.$i}' WHERE `id_user` = '$id' AND `galaxie` = '$start_galaxie' AND `ss` = '$start_ss' AND `position` = '$start_position'");
}
mysql_query("UPDATE `planete` SET `metal` = '$metal', `cristal` = '$cristal', `hydrogene` = '$hydrogene' WHERE `id_user` = '$id' AND `galaxie` = '$start_galaxie' AND `ss` = '$start_ss' AND `position` = '$start_position'");
mysql_query("DELETE FROM `flottes` WHERE `id_user` = '$id' AND `id` = '$id_flotte'");
}
}
mysql_close();
?>

View file

@ -0,0 +1,381 @@
*
{
margin: 0;
padding: 0;
border: 0;
}
a
{
text-decoration: none;
font-weight: bold;
color: #FF3B01;
}
a:hover,a:visited:hover
{
text-decoration: underline;
}
a:visited
{
text-decoration: none;
}
body, html
{
background-color: #000000;
text-align: center;
font-family: "arial";
font-size: 10px;
color: #585858;
}
.all
{
background-color: #161616;
width: 930px;
margin-top: 30px;
margin-bottom: 70px;
margin-left: auto;
margin-right: auto;
padding: 16px;
}
.header
{
background-color: #1C1C1C;
border: #222222 solid 1px;
color: #FF3B01;
margin-bottom: 20px;
}
.header_link
{
text-align: left;
margin-left: 30px;
}
.buttons
{
margin-top: 5px;
margin-left: auto;
margin-right: auto;
width: 890px;
text-align: center;
}
.buttons a
{
display: block;
float: left;
width: 105px;
height: 30px;
text-align: center;
padding-top: 10px;
margin-right: 15px;
color: #FFFFFF;
border: #373737 solid 1px;
background: #232323 url(images/button.gif) repeat-x bottom;
}
.buttons a:hover
{
color: #FF3B01;
background: #414141 url(images/button_hover.gif) repeat-x bottom;
text-decoration: none;
}
.pub
{
background-color: transparent;
border: none;
}
.corps
{
background-color: #1C1C1C;
border: #222222 solid 1px;
padding: 30px;
line-height: 18px;
}
.cadre
{
background-color: #222222;
border: #303030 solid 1px;
padding: 20px;
margin-bottom: 50px;
}
.titre_cadre
{
background-color: #1C1C1C;
border: #303030 solid 1px;
padding: 5px;
margin-bottom: 30px;
}
.titre
{
border: #303030 solid 1px;
padding: 15px;
margin-bottom: 10px;
}
.accueil_planete
{
border: #3E3E3E solid 1px;
margin: 20px;
}
.contour
{
background-color: #1C1C1C;
border: #303030 solid 1px;
padding: 5px;
}
.accueil
{
border: #303030 solid 1px;
padding: 15px;
margin-top: 20px;
}
.footer
{
background-color: #FFFFFF;
padding: 15px;
font-size: 11px;
color: #925F46;
}
.hightlight
{
color: #C2671E;
font-family: sans-serif;
font-size: 12px;
word-spacing: 2px;
}
.construction
{
margin-left: auto;
margin-right: auto;
text-align: center;
border-collapse: separate;
border-spacing: 20px;
}
.constructionD
{
width: 130px;
height: 132px;
border: #464646 solid 1px;
cursor: pointer;
float: left;
}
.constructionI
{
height: 150px;
width: 20px;
float: left;
border: none;
}
.espace
{
width: 450px;
text-align: right;
}
input[type="text"]
{
color: #E88607;
width: 60px;
background-color: #DFDFDF;
border: #4F4F4F solid 1px;
}
input[type="text"]:focus
{
background-color: #FFD49D;
color: #000000;
}
input[type="text"]:hover
{
color: #8F5100;
}
input[type="submit"]
{
color: #F26701;
background-color:#FFFFFF;
font-weight: bold;
font-size: 12px;
border: outset #3A3A3A 2px;
margin: 8px;
padding: 2px;
}
input[type="submit"]:focus
{
border: inset #3A3A3A 2px;
}
.espace a
{
font-size: 22px;
font-family: sans-serif;
}
.systeme
{
margin-left: auto;
margin-right: auto;
text-align: center;
border-collapse: separate;
border-spacing: 4px;
empty-cells: show;
}
.systeme td
{
border: #614F3E solid 1px;
padding: 4px 10px;
font-size: 11px;
font-weight: bold;
color: #93846F;
}
#arbre
{
position:absolute;
bottom: 60px;
left: 20px;
width: 220px;
display: none;
}
#menu
{
float: left;
width: 50px;
height: 15px;
background-color: #C05B01;
color: #FFFFFF;
border: outset #3A3A3A 1px;
margin: 20px;
cursor: pointer;
}
#arbre a
{
display: block;
background-color: #7A7A7A;
width: 220px;
height: 15px;
margin-bottom: 1px;
color: #FFFFFF;
font-size: 11px;
font-weight: bold;
}
#arbre a:hover
{
background-color: #373737;
color: #FF3B01;
}
#arbre .space
{
background-color: transparent;
height: 3px;
}
.bulle
{
position: absolute;
width: 200px;
height: 250px;
background-color: #000000;
filter: alpha(opacity=70);
-moz-opacity: 0.70;
opacity: 0.70;
padding: 5px;
}
.bulle a
{
font-size: 13px;
}
#barre
{
position: fixed;
left: 0px;
bottom: 0px;
z-index: 50;
width: 100%;
height: 65px;
background-color: #2B2B2B;
}
#barre span
{
float: left;
display: block;
padding: 4px;
margin: 15px 20px;
font-size: 12px;
border: #E28500 ridge 2px;
background-color: #A8A8A8;
}
#barre .planetes img
{
width: 55px;
height: 55px;
padding: 2px;
}
#barre a.planetes
{
display: block;
margin: 0 10px;
float: right;
display: block;
color: #FFFFFF;
filter: alpha(opacity=50);
-moz-opacity: 0.50;
opacity: 0.50;
border: #2B2B2B 1px dashed;
}
#barre a.planetes:hover
{
filter: alpha(opacity=100);
-moz-opacity: 1;
opacity: 1;
border: #E14C03 1px dashed;
}
.versions
{
font-size: 12px;
}
.versions th
{
background-color: #222222;
border: #3C3C3C solid 1px;
}
.versions td
{
background-color: #222222;
border: #3C3C3C solid 1px;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 588 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

View file

@ -0,0 +1,149 @@

var view = false;
function menu()
{
/*
var x = 0;
var y = -15;
var menu1 = document.getElementById("menu");
var menu2 = document.getElementById("menu");
var xmenu = menu1.offsetLeft;
var ymenu = menu1.offsetBottom;
while (menu1 && menu1.tagName != 'BODY')
{
x += xmenu;
menu1 = menu1.offsetParent;
xmenu = menu1.offsetLeft;
}
while (menu2 && menu2.tagName != 'BODY')
{
y += ymenu;
menu2 = menu2.offsetParent;
ymenu = menu2.offsetBottom;
}
if (document.getElementById("arbre").style.display=="none" || !view)
{*/
document.getElementById("arbre").style.display = "block";
view = true;
/* }
else
{
document.getElementById("arbre").style.display = "none";
}
*/
return true;
}
function hidemenu()
{
setTimeout("hidemenuV()",750);
view = false;
}
function hidemenuV()
{
if (view == false) {
document.getElementById("arbre").style.display = "none";
}
}
var info_var;
var onclick_var;
var kill = false;
function view_info(objet,nom,metal,cristal,hydrogene,temps,info,lien,display,form)
{
if(document.getElementById("bulle"))
{
var bulle = document.getElementById("bulle").parentNode;
bulle.innerHTML = info_var;
bulle.setAttribute("onclick",onclick_var);
info_var= false;
return(view_info(objet,nom,metal,cristal,hydrogene,temps,info,lien,display,form));
}
if (!info_var)
{
var x = 20;
var y = 80;
var menu1 = objet;
var menu2 = objet;
var xmenu = menu1.offsetLeft;
var ymenu = menu1.offsetTop;
while (menu1 && menu1.tagName != 'BODY')
{
x += xmenu;
menu1 = menu1.offsetParent;
xmenu = menu1.offsetLeft;
}
while (menu2 && menu2.tagName != 'BODY')
{
y += ymenu;
menu2 = menu2.offsetParent;
ymenu = menu2.offsetTop;
}
info_var = objet.innerHTML;
onclick_var = objet.getAttribute("onclick");
objet.setAttribute("onclick", "hide_info(this,\'"+nom+"\')");
var envoi = form?'<form action=\"'+lien+'\" method=\"post\">'+(display=="none"?"<span style=\"font-weight: bold; color: #FF3600\" class=\"hightlight\">Ressources insuffisantes</span><br />":"")+'nombre: <input'+(display=="none"?" disabled":"")+' onfocus=\"kill=true\" onblur=\"kill=false\" type=\"text\" name="sa" value=\"0\" /><br /><input'+(display=="none"?" disabled":"")+' onfocus=\"kill=true\" onblur=\"kill=false\" type=\"submit\" value=\"Envoyer\" /></form>':(display=='none'?'<span style=\"font-weight: bold; color: #FF3600\" class=\"hightlight\">Ressources insuffisantes</span>':'<a href=\"'+lien+'\">'+(display=="stop"?"Stopper":"Construire")+'</a>');
objet.innerHTML += '<div id="bulle" onclick=\"hide_info(this.parentNode,\''+nom+'\')\" class=\"bulle\" style=\"top: '+y+'px; left: '+x+'px;\"><span class=\"hightlight\">nom: </span>'+nom+'<br /><span class=\"hightlight\">Coût métal: </span>'+metal+'<br /><span class=\"hightlight\">Coût crisal: </span>'+cristal+'<br /><span class=\"hightlight\">Coût hydrogène: </span>'+hydrogene+'<br /><span class=\"hightlight\">Temps de construction: </span>'+temps+'<br /><span class=\"hightlight\">Description: </span>'+info+'<br /><br />'+envoi+'</div>';
}
return true;
}
function hide_info(objet,nom)
{
if(kill)
{
return;
}
if (info_var)
{
objet.innerHTML = info_var;
objet.setAttribute("onclick",onclick_var);
info_var= false;
return true;
}
else return false;
}
function reste(zetime) {
if (zetime>0) {
var heures = Math.floor(zetime / 3600);
var minutes = Math.floor(((zetime / 3600) - Math.floor(zetime / 3600)) * 60);
var secondes = zetime - ((Math.floor(zetime / 60)) * 60);
if (heures < 10) heures = "0" + heures;
if (minutes < 10) minutes = "0" + minutes;
if (secondes < 10) secondes = "0" + secondes;
document.getElementById("axion").innerHTML = heures + ":" + minutes + ":" + secondes;
var restant = zetime - 1;
setTimeout("reste(" + restant + ")", 1000);
}
else {
document.getElementById("axion").innerHTML = "Terminé";
setTimeout(window.document.location.reload(),3000);
}
}

BIN
pages/diz/humain/1720.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 247 KiB

BIN
pages/diz/humain/Thumbs.db Normal file

Binary file not shown.

270
pages/diz/humain/base.css Normal file
View file

@ -0,0 +1,270 @@
body
{
color: #7093DB;
background-color: #040e1e;
background-image: url('1720.jpg');
background-attachment: fixed;
background-repeat: no-repeat;
background-position: top left;
scrollbar-arrow-color: #E6EBFB;
scrollbar-base-color: #344566;
scrollbar-track-color: #344566;
scrollbar-face-color: #344566;
scrollbar-highlight-color: #344566;
scrollbar-3dlight-color: #465673;
scrollbar-darkshadow-color: #344566;
scrollbar-shadow-color: #465673;
font-size: 13px;
font-family: Tahoma,sans-serif;
margin-left: 68px;
margin-bottom: 20px;
}
u {
font-style: underline;
}
i {
font-style: italic;
}
a {
color: #4080ff;
font-size: 12px;
font-family: verdana, serif;
text-decoration: underline;
border: none;
}
img {
border: none;
}
a:hover {
cursor: pointer;
}
a:active, a:focus {
cursor: wait;
}
a:visited {
cursor: pointer;
}
.zone_texte {
background-color: #000031;
color: #4080ff;
border: 1px solid #1256C6;
font-family: verdana, serif;
}
.bouton {
background-color: navy;
color: #afbdff;
font-family: verdana, serif;
BORDER-LEFT-COLOR: white;
BORDER-BOTTOM-COLOR: navy;
BORDER-TOP-COLOR: white;
BACKGROUND-COLOR: navy;
BORDER-RIGHT-COLOR: navy;
BORDER-STYLE: outset;
}
.bouton:hover {
color: red;
}
.bouton:active {
BORDER-STYLE: inset;
color: red;
}
div {
border: 1px solid #004080;
float: left;
margin: 1 1 1 1;
}
div.centre {
border: none;
float: none;
margin: auto;
text-align: center;
}
div.a {
height: 132px;
width: 130px;
}
div.b {
height: 132px;
width: 400px;
text-align: justify;
background-image: url(fond/apb.jpg);
}
div.c {
height: 132px;
width: 149px;
text-align: center;
background-image: url(fond/apc.jpg);
}
div.d {
background-color: #00024A;
border: 1px solid #02058A;
margin-bottom: 20;
margin-left: 450;
}
div.fin {
height: 20px;
width: 339px;
text-align: center;
background-image: url(fond/apfin.jpg);
}
div.long {
font-weight: bold;
color: #ff8040;
width: 550px;
text-align: center;
margin-left: 90px;
}
div.ensemble {
width: 550;
height: 300;
margin-left: 90px;
}
div.e {
height: 280px;
width: 125px;
text-align: justify;
background-color: #000151;
border: 0;
border-right: 1px solid #004080;
float: left;
margin: 0;
margin-right: 8px;
padding: 15 10 5 10;
}
#axion {
color: white;
font-weight: bold;
border: none;
background-color: transparent;
margin-top: 50px;
}
.description {
width: 99%;
font-style: italic;
border: none;
}
br.a {
clear: both;
}
span.rc {
font-size: 13px;
font-family: Tahoma,sans-serif;
font-weight: bold;
color: #ffc080;
}
table {
border-collapse: separate;
empty-cells: show;
text-align: center;
border: 0px;
font-size: 12px;
vertical-align: middle;
}
table#ressource {
margin-bottom: 35px;
}
TD {
background-color: #00024A;
border: 1px solid #02058A;
}
TD.a {
background-color: #000151;
border: 1px solid #040e1e;
width: 210px;
}
TD.b {
background-color: #000151;
border: 1px solid #040e1e;
width: 150px;
}
TD.xyz {
background-color: #000151;
border: 1px solid #000170;
}
td.bla {
height: 132px;
width: 130px;
border: 1px solid #004080;
background-repeat: no-repeat;
}
td.blb {
height: 132px;
width: 400px;
text-align: justify;
background-image: url(fond/apb.jpg);
border: 1px solid #004080;
}
td.blc {
height: 132px;
width: 149px;
text-align: center;
background-image: url(fond/apc.jpg);
border: 1px solid #004080;
}
td.bld {
background-color: #00024A;
border: 1px solid #02058A;
margin-bottom: 20;
margin-left: 450;
}
.versions
{
font-size: 12px;
}
.versions th
{
background-color: black;
border: 1px solid #7093DB;
}
.versions td
{
border: 1px solid;
background-color: black;
}
/*attaque {
color: #CC0000;
}
filter: alpha(opacity=10);
-moz-opacity: 0.9; */