forked from halo-battle/game
Version 1.2
This commit is contained in:
parent
c4a18d4281
commit
083eb365c5
73 changed files with 1165 additions and 361 deletions
|
|
@ -16,7 +16,7 @@ $titre = 'Batiments';
|
|||
if (isset($_GET['c']) && isset($batiment[$_GET['c']])) {
|
||||
$i = $_GET['c'];
|
||||
if(requestDeblok($batimentTECH[$i], $queryPlanete, $queryUser)) {
|
||||
$n=($queryPlanete[$batimentVAR[$i]]+1);
|
||||
$n = $queryPlanete[$batimentVAR[$i]]+1;
|
||||
eval($batimentCALC[$i][0]); $metal -= $a;
|
||||
eval($batimentCALC[$i][1]); $cristal -= $b;
|
||||
eval($batimentCALC[$i][2]); $hydrogene -= $c;
|
||||
|
|
@ -35,9 +35,17 @@ $titre = 'Batiments';
|
|||
exit;
|
||||
}
|
||||
eval($batimentCALC[$i][3]);
|
||||
if ($file->addObjet($i, 1, ceil($sec))) {
|
||||
$export = mysql_real_escape_string(serialize($file));
|
||||
mysql_query("UPDATE `planete` SET `file_bat` = '$export', `metal` = '$metal', `cristal` = '$cristal', `hydrogene` = '$hydrogene' WHERE `id` = '$idPlan';");
|
||||
if (!$file->existe($i) && $file->addObjet($i, 1, ceil($sec))) {
|
||||
$export = serialize($file);
|
||||
$chapeau->escape($export);
|
||||
$chapeau->query("UPDATE `$table_planete` SET `file_bat` = '$export', `metal` = '$metal', `cristal` = '$cristal', `hydrogene` = '$hydrogene' WHERE `id` = '$idPlan';");
|
||||
}
|
||||
elseif ($file->existe($i)) {
|
||||
$template->assign('message','Ce bâtiment est déjà dans la file d\'attente !');
|
||||
$template->assign('script','<script type="text/javascript">setTimeout(\'document.location.href="?p=batiments";\', 3500);</script>');
|
||||
$template->assign('couleur','red');
|
||||
$template->display('game/erreur.tpl');
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
$template->assign('message','Vous ne pouvez pas mettre plus de batiments en file d\'attente.');
|
||||
|
|
@ -49,6 +57,13 @@ $titre = 'Batiments';
|
|||
header('Location: ?p=batiments');
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
$template->assign('message','Vous n\'avez pas les technologies nécessaire pour construire ce batiment !');
|
||||
$template->assign('script','<script type="text/javascript">setTimeout(\'document.location.href="?p=batiments";\', 3500);</script>');
|
||||
$template->assign('couleur','red');
|
||||
$template->display('game/erreur.tpl');
|
||||
exit;
|
||||
}
|
||||
}
|
||||
//Annulation d'une nouvelle construction
|
||||
if (isset($_GET['a']) && isset($batiment[$_GET['a']])) {
|
||||
|
|
@ -59,8 +74,9 @@ $titre = 'Batiments';
|
|||
eval($batimentCALC[$i][1]); $cristal += $b;
|
||||
eval($batimentCALC[$i][2]); $hydrogene += $c;
|
||||
$file->delobjet($i);
|
||||
$export = mysql_real_escape_string(serialize($file));
|
||||
mysql_query("UPDATE `planete` SET `file_bat` = '$export', `metal` = '$metal', `cristal` = '$cristal', `hydrogene` = '$hydrogene' WHERE `id` = '$idPlan';");
|
||||
$export = serialize($file);
|
||||
$chapeau->escape($export);
|
||||
$chapeau->query("UPDATE `$table_planete` SET `file_bat` = '$export', `metal` = '$metal', `cristal` = '$cristal', `hydrogene` = '$hydrogene' WHERE `id` = '$idPlan';");
|
||||
header('Location: ?p=batiments');
|
||||
exit;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue