Version 2007-11-04

This commit is contained in:
nemunaire 2007-11-04 12:00:00 +01:00
commit ebc73c5744
377 changed files with 5163 additions and 2495 deletions

View file

@ -15,18 +15,20 @@ if (isset($_POST['cons_sto']) || isset($_POST['cons_sonde']) || isset($_POST['co
if (isset($_POST['cons_transporteur'])) $sa = floor($_POST['cons_transporteur']);
if (isset($_POST['cons_vcolo'])) $sa = floor($_POST['cons_vcolo']);
if (isset($_POST['cons_sonde'])) $sa = floor($_POST['cons_sonde']);
if (isset($_POST['cons_recycleur'])) $sa = floor($_POST['cons_recycleur']);
if (isset($_POST['cons_chasseur'])) $sa = floor($_POST['cons_chasseur']);
if (isset($_POST['cons_croiseur'])) $sa = floor($_POST['cons_croiseur']);
if (isset($_POST['cons_croiseur2'])) $sa = floor($_POST['cons_croiseur2']);
if (isset($_POST['cons_fregate'])) $sa = floor($_POST['cons_fregate']);
if (isset($_POST['cons_gtransporteur'])) $sa = floor($_POST['cons_gtransporteur']);
if (isset($_POST['cons_pv'])) $sa = floor($_POST['cons_pv']);
if (isset($_POST['cons_sto'])) $sa = floor($_POST['cons_sto']);
if ($sa < 0) $sa=0;
if (isset($_POST['cons_transporteur']) && $sa != 0) {
if ($metal - ($sa*1000) >= 0) {
if ($cristal - ($sa*800) >= 0) {
$temps_caserne = time() + $sa*ceil(1080/pow(1.25,$chantier_spatial));
$temps_caserne = time() + $sa*ceil(1080/pow(1.25,($chantier_spatial-1)));
$unit = 1;
$metal -= ($sa*1000);
$cristal -= ($sa*800);
@ -43,7 +45,7 @@ if (isset($_POST['cons_sto']) || isset($_POST['cons_sonde']) || isset($_POST['co
elseif (isset($_POST['cons_gtransporteur']) && $sa != 0) {
if ($metal - ($sa*4000) >= 0) {
if ($cristal - ($sa*3000) >= 0) {
$temps_caserne = time() + $sa*ceil(6300/pow(1.25,$chantier_spatial));
$temps_caserne = time() + $sa*ceil(6300/pow(1.25,($chantier_spatial-5)));
$unit = 2;
$metal -= ($sa*4000);
$cristal -= ($sa*3000);
@ -61,7 +63,7 @@ if (isset($_POST['cons_sto']) || isset($_POST['cons_sonde']) || isset($_POST['co
if ($metal - ($sa*9000) >= 0) {
if ($cristal - ($sa*9000) >= 0) {
if($hydrogene - ($sa*1000) >= 0) {
$temps_caserne = time() + $sa*ceil(8280/pow(1.25,$chantier_spatial));
$temps_caserne = time() + $sa*ceil(8280/pow(1.25,($chantier_spatial-5)));
$unit = 3;
$metal -= ($sa*9000);
$cristal -= ($sa*9000);
@ -77,11 +79,31 @@ if (isset($_POST['cons_sto']) || isset($_POST['cons_sonde']) || isset($_POST['co
}
else echo "Pas assez de métal !";
}
elseif (isset($_POST['cons_gtransporteur']) && $sa != 0) {
elseif (isset($_POST['cons_sonde']) && $sa != 0) {
if ($metal - ($sa*1000) >= 0) {
if ($cristal - ($sa*1200) >= 0) {
if($hydrogene - ($sa*100) >= 0) {
$temps_caserne = time() + $sa*ceil(1440/pow(1.25,($chantier_spatial-3)));
$unit = 4;
$metal -= ($sa*1000);
$cristal -= ($sa*1200);
$hydrogene -= ($sa*100);
mysql_query("UPDATE planete SET unit_s='$unit', metal='$metal', cristal='$cristal', hydrogene='$hydrogene' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
mysql_query("UPDATE planete SET cons_spatial='$sa', temps_spatial='$temps_caserne' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
@header("Location: chantier_spatial.php");
}
else echo "Pas assez d'hydrogène !";
}
else echo "Pas assez de cristal !";
}
else echo "Pas assez de métal !";
}
elseif (isset($_POST['cons_recycleur']) && $sa != 0) {
if ($metal - ($sa*15000) >= 0) {
if ($cristal - ($sa*9000) >= 0) {
if($hydrogene - ($sa*1000) >= 0) {
$temps_caserne = time() + $sa*ceil(7380/pow(1.25,$chantier_spatial));
$temps_caserne = time() + $sa*ceil(7380/pow(1.25,($chantier_spatial-5)));
$unit = 5;
$metal -= ($sa*15000);
$cristal -= ($sa*9000);
@ -100,7 +122,7 @@ if (isset($_POST['cons_sto']) || isset($_POST['cons_sonde']) || isset($_POST['co
elseif (isset($_POST['cons_chasseur']) && $sa != 0) {
if ($metal - ($sa*1700) >= 0) {
if ($cristal - ($sa*1220) >= 0) {
$temps_caserne = time() + $sa*ceil(1200/pow(1.25,$chantier_spatial));
$temps_caserne = time() + $sa*ceil(1200/pow(1.25,($chantier_spatial-1)));
$unit = 6;
$metal -= ($sa*1700);
$cristal -= ($sa*1220);
@ -116,7 +138,7 @@ if (isset($_POST['cons_sto']) || isset($_POST['cons_sonde']) || isset($_POST['co
elseif (isset($_POST['cons_fregate']) && $sa != 0) {
if ($metal - ($sa*5800) >= 0) {
if ($cristal - ($sa*1400) >= 0) {
$temps_caserne = time() + $sa*ceil(4680/pow(1.25,$chantier_spatial));
$temps_caserne = time() + $sa*ceil(4680/pow(1.25,($chantier_spatial-3)));
$unit = 7;
$metal -= ($sa*5800);
$cristal -= ($sa*1400);
@ -134,7 +156,7 @@ if (isset($_POST['cons_sto']) || isset($_POST['cons_sonde']) || isset($_POST['co
if ($metal - ($sa*20000) >= 0) {
if ($cristal - ($sa*16000) >= 0) {
if($hydrogene - ($sa*1600) >= 0) {
$temps_caserne = time() + $sa*ceil(16800/pow(1.25,$chantier_spatial));
$temps_caserne = time() + $sa*ceil(16800/pow(1.25,($chantier_spatial-6)));
$unit = 8;
$metal -= ($sa*20000);
$cristal -= ($sa*16000);
@ -154,7 +176,7 @@ if (isset($_POST['cons_sto']) || isset($_POST['cons_sonde']) || isset($_POST['co
if ($metal - ($sa*26000) >= 0) {
if ($cristal - ($sa*16400) >= 0) {
if($hydrogene - ($sa*1600) >= 0) {
$temps_caserne = time() + $sa*ceil(18060/pow(1.25,$chantier_spatial));
$temps_caserne = time() + $sa*ceil(18060/pow(1.25,($chantier_spatial-6)));
$unit = 9;
$metal -= ($sa*26000);
$cristal -= ($sa*16400);
@ -170,15 +192,15 @@ if (isset($_POST['cons_sto']) || isset($_POST['cons_sonde']) || isset($_POST['co
}
else echo "Pas assez de métal !";
}
elseif (isset($_POST['cons_sonde']) && $sa != 0) {
if ($metal - ($sa*1000) >= 0) {
if ($cristal - ($sa*1200) >= 0) {
if($hydrogene - ($sa*100) >= 0) {
$temps_caserne = time() + $sa*ceil(1440/pow(1.25,$chantier_spatial));
$unit = 4;
$metal -= ($sa*1000);
$cristal -= ($sa*1200);
$hydrogene -= ($sa*100);
elseif (isset($_POST['cons_pv']) && $sa != 0) {
if ($metal - ($sa*60000) >= 0) {
if ($cristal - ($sa*40000) >= 0) {
if($hydrogene - ($sa*3000) >= 0) {
$temps_caserne = time() + $sa*ceil(32400/pow(1.25,($chantier_spatial-8)));
$unit = 10;
$metal -= ($sa*60000);
$cristal -= ($sa*40000);
$hydrogene -= ($sa*3000);
mysql_query("UPDATE planete SET unit_s='$unit', metal='$metal', cristal='$cristal', hydrogene='$hydrogene' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
mysql_query("UPDATE planete SET cons_spatial='$sa', temps_spatial='$temps_caserne' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
@ -194,7 +216,7 @@ if (isset($_POST['cons_sto']) || isset($_POST['cons_sonde']) || isset($_POST['co
if ($metal - ($sa*500000) >= 0) {
if ($cristal - ($sa*400000) >= 0) {
if($hydrogene - ($sa*250000) >= 0) {
$temps_caserne = time() + $sa*ceil(117000/pow(1.25,$chantier_spatial));
$temps_caserne = time() + $sa*ceil(117000/pow(1.25,($chantier_spatial-12)));
$unit = 11;
$metal -= ($sa*500000);
$cristal -= ($sa*400000);