forked from halo-battle/game
Version 1.13a
This commit is contained in:
parent
de31cd3e9a
commit
ba8f323879
1634 changed files with 10080 additions and 213021 deletions
|
|
@ -1,6 +1,11 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
if(!defined('INDEX') || SURFACE != "planete") { header('Location: ./'.$VAR['first_page']); exit; }
|
||||
$page = $p;
|
||||
$onglet = gpc('n');
|
||||
if (!empty($onglet))
|
||||
$template->assign('onglet', $onglet);
|
||||
else
|
||||
$template->assign('onglet', "unites");
|
||||
$titre = ucfirst($LANG[$planete->race]['batiments']['noms_sing'][7]);
|
||||
|
||||
//Vérification que le joueur ait bien un labo avant d'afficher la page
|
||||
|
|
@ -8,26 +13,28 @@ $titre = ucfirst($LANG[$planete->race]['batiments']['noms_sing'][7]);
|
|||
erreur('Vous devez d\'abord construire un '.$LANG[$planete->race]['batiments']['noms_sing'][7], "red", '?p=batiments', 3500);
|
||||
|
||||
//Lancement d'une nouvelle construction
|
||||
if (isset($_GET['v']) && is_numeric($_GET['v']) && $nbv = floor(gpc('nombre', 'post'))) {
|
||||
$planete->file_ter->terrestre_addObjet(intval(gpc('v')), $nbv, $planete);
|
||||
|
||||
redirection($VAR['menu'][$p]);
|
||||
}
|
||||
if (isset($_GET['v']) && ($id = intval(gpc('v'))) >= 0 && $nbv = floor(gpc('terr'.$id, 'post')))
|
||||
{
|
||||
$planete->file_ter->terrestre_addObjet($id, $nbv, $planete);
|
||||
|
||||
redirection($VAR['menu'][$p].'&n='.$onglet);
|
||||
}
|
||||
//Annulation d'une nouvelle construction
|
||||
if (isset($_GET['a'])) {
|
||||
$n = intval(gpc('n'));
|
||||
if (empty($n)) $n = 1;
|
||||
$planete->file_ter->terrestre_delObjet(intval(gpc('a')), $n, $planete);
|
||||
|
||||
redirection($VAR['menu'][$p]);
|
||||
}
|
||||
if (isset($_GET['a']))
|
||||
{
|
||||
$n = intval(gpc('s'));
|
||||
if (empty($n)) $n = 1;
|
||||
$planete->file_ter->terrestre_delObjet(intval(gpc('a')), $n, $planete);
|
||||
|
||||
redirection($VAR['menu'][$p].'&n='.$onglet);
|
||||
}
|
||||
|
||||
$TEMP_liste = array();
|
||||
foreach($planete->terrestres as $i => $nombre)
|
||||
{
|
||||
$type = Donnee::typeTerrestre($i);
|
||||
|
||||
if (!empty($LANG[$planete->race]['terrestre']['noms_sing'][$i]) && (($p == "defenses" && !$type) || ($p == "chantierterrestre" && $type)) && Donnee::neededTerrestre($i, $planete))
|
||||
if (!empty($LANG[$planete->race]['terrestre']['noms_sing'][$i]) && (($onglet == "defenses" && !$type) || ($onglet != "defenses" && $type)) && Donnee::neededTerrestre($i, $planete))
|
||||
{
|
||||
$TEMP_liste[] = array (
|
||||
'id' => $i,
|
||||
|
|
@ -44,4 +51,6 @@ $titre = ucfirst($LANG[$planete->race]['batiments']['noms_sing'][7]);
|
|||
|
||||
$template->assign('unites', $TEMP_liste);
|
||||
$template->assign('file', $planete->file_ter->printFile($planete));
|
||||
|
||||
unset($TEMP_liste, $i, $n, $niveau, $onglet);
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue