forked from halo-battle/game
Version 0.9b
This commit is contained in:
parent
59fbc7104e
commit
73645ccc1f
25 changed files with 841 additions and 466 deletions
|
|
@ -22,80 +22,80 @@ else {
|
|||
if (!isset($_POST['sa'])) exit;
|
||||
else $sa = abs(floor($_POST['sa']));
|
||||
|
||||
if ($_POST['type'] == 1) {
|
||||
if ($_POST['type'] == 1 && $chantier_spatial >= 1 && $reacteur >= 4) {
|
||||
$metal -= 1000*$sa;
|
||||
$cristal -= 800*$sa;
|
||||
$temps_s = ceil(1080/pow(1.25,($chantier_spatial-1)));
|
||||
$vai = 1;
|
||||
}
|
||||
elseif ($_POST['type'] == 2) {
|
||||
elseif ($_POST['type'] == 2 && $chantier_spatial >= 5 && $reacteur_f >= 2) {
|
||||
$metal -= 4000*$sa;
|
||||
$cristal -= 3000*$sa;
|
||||
$temps_s = ceil(6300/pow(1.25,($chantier_spatial-5)));
|
||||
$vai = 2;
|
||||
}
|
||||
elseif ($_POST['type'] == 3) {
|
||||
elseif ($_POST['type'] == 3 && $chantier_spatial >= 5 && $reacteur_ff >= 1) {
|
||||
$metal -= 9000*$sa;
|
||||
$cristal -= 9000*$sa;
|
||||
$hydrogene -= 1000*$sa;
|
||||
$temps_s = ceil(8280/pow(1.25,($chantier_spatial-5)));
|
||||
$vai = 3;
|
||||
}
|
||||
elseif ($_POST['type'] == 4) {
|
||||
elseif ($_POST['type'] == 4 && $chantier_spatial >= 3 && $reacteur >= 5 && $detection >= 2) {
|
||||
$metal -= 1000*$sa;
|
||||
$cristal -= 1200*$sa;
|
||||
$hydrogene -= 100*$sa;
|
||||
$temps_s = ceil(1440/pow(1.25,($chantier_spatial-3)));
|
||||
$vai = 4;
|
||||
}
|
||||
elseif ($_POST['type'] == 5 && $centrale_s >= 12 && $energie_t >= 5) {
|
||||
elseif ($_POST['type'] == 5 && $chantier_spatial >= 5 && $reacteur_f >= 4 && $blindage >= 5) {
|
||||
$metal -= 15000*$sa;
|
||||
$cristal -= 9000*$sa;
|
||||
$hydrogene -= 1000*$sa;
|
||||
$temps_s = ceil(7380/pow(1.25,($chantier_spatial-5)));
|
||||
$vai = 5;
|
||||
}
|
||||
elseif ($_POST['type'] == 6 && $detection >= 1) {
|
||||
elseif ($_POST['type'] == 6 && $chantier_spatial >= 1 && $reacteur >= 4) {
|
||||
$metal -= 1700*$sa;
|
||||
$cristal -= 1220*$sa;
|
||||
$temps_s = ceil(1200/pow(1.25,($chantier_spatial-1)));
|
||||
$vai = 6;
|
||||
}
|
||||
elseif ($_POST['type'] == 7) {
|
||||
elseif ($_POST['type'] == 7 && $chantier_spatial >= 3 && $reacteur_f >= 3 && $armement >=1) {
|
||||
$metal -= 5800*$sa;
|
||||
$cristal -= 1400*$sa;
|
||||
$temps_s = ceil(4680/pow(1.25,($chantier_spatial-3)));
|
||||
$vai = 7;
|
||||
}
|
||||
elseif ($_POST['type'] == 8) {
|
||||
elseif ($_POST['type'] == 8 && $chantier_spatial >= 6 && $reacteur_ff >= 2 && $armement >= 3 && $blindage >= 4) {
|
||||
$metal -= 20000*$sa;
|
||||
$cristal -= 16000*$sa;
|
||||
$hydrogene -= 1600*$sa;
|
||||
$temps_s = ceil(16800/pow(1.25,($chantier_spatial-6)));
|
||||
$vai = 8;
|
||||
}
|
||||
elseif ($_POST['type'] == 9 && $chantier_terrestre >= 2) {
|
||||
elseif ($_POST['type'] == 9 && $chantier_spatial >= 6 && $reacteur_ff >= 3 && $armement >= 4 && $blindage >= 4) {
|
||||
$metal -= 26000*$sa;
|
||||
$cristal -= 16400*$sa;
|
||||
$hydrogene -= 1600*$sa;
|
||||
$temps_s = ceil(18060/pow(1.25,($chantier_spatial-6)));
|
||||
$vai = 9;
|
||||
}
|
||||
elseif ($_POST['type'] == 10) {
|
||||
elseif ($_POST['type'] == 10 && $chantier_spatial >= 8 && $reacteur_ff >= 5 && $armement >=6 && $blindage >= 6) {
|
||||
$metal -= 60000*$sa;
|
||||
$cristal -= 40000*$sa;
|
||||
$hydrogene -= 3000*$sa;
|
||||
$temps_s = ceil(32400/pow(1.25,($chantier_spatial-8)));
|
||||
$vai = 10;
|
||||
}
|
||||
elseif ($_POST['type'] == 11) {
|
||||
elseif ($_POST['type'] == 11 && $chantier_spatial >= 12 && $reacteur_ff >= 10 && $armement >= 12 && $blindage >= 12) {
|
||||
$metal -= 500000*$sa;
|
||||
$cristal -= 400000*$sa;
|
||||
$hydrogene -= 250000*$sa;
|
||||
$temps_s = ceil(117000/pow(1.25,($chantier_spatial-12)));
|
||||
$vai = 11;
|
||||
}
|
||||
elseif ($_POST['type'] == 12) {
|
||||
elseif ($_POST['type'] == 12 && $chantier_spatial >= 12 && $reacteur_ff >= 10 && $armement >= 12 && $blindage >= 12) {
|
||||
$metal -= 500000*$sa;
|
||||
$cristal -= 400000*$sa;
|
||||
$hydrogene -= 250000*$sa;
|
||||
|
|
@ -125,7 +125,7 @@ if (isset($vai) && $vai != '' && (!empty($nomvaisn[$vai-1]) || $vai == 'e' || (i
|
|||
$temps_s = $temps_ss;
|
||||
}
|
||||
|
||||
mysql_query("UPDATE planete SET metal='$metal', cristal='$cristal', temps_spatial='$temps_s', unit_s='$vai' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'") or die ("erreur sql ".mysql_error());
|
||||
mysql_query("UPDATE planete SET metal='$metal', cristal='$cristal', hydrogene='$hydrogene', temps_spatial='$temps_s', unit_s='$vai' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'") or die ("erreur sql ".mysql_error());
|
||||
}
|
||||
else {
|
||||
header('Location: chantier_spatial.php?err=3');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue