forked from halo-battle/game
Version 1.12
This commit is contained in:
parent
2a066a7498
commit
de31cd3e9a
1373 changed files with 156282 additions and 45238 deletions
47
onyx2/include/game/jeu/chantierterrestre.php
Normal file
47
onyx2/include/game/jeu/chantierterrestre.php
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
$page = $p;
|
||||
$titre = ucfirst($LANG[$planete->race]['batiments']['noms_sing'][7]);
|
||||
|
||||
//Vérification que le joueur ait bien un labo avant d'afficher la page
|
||||
if ($planete->batiments[7] <= 0)
|
||||
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]);
|
||||
}
|
||||
//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]);
|
||||
}
|
||||
|
||||
$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))
|
||||
{
|
||||
$TEMP_liste[] = array (
|
||||
'id' => $i,
|
||||
'image' => $nomterri[$i],
|
||||
'nombre' => $nombre,
|
||||
'nec_metal' => Donnee::metalTerrestre($i, $planete),
|
||||
'nec_cristal' => Donnee::cristalTerrestre($i, $planete),
|
||||
'nec_hydrogene' => Donnee::hydrogeneTerrestre($i, $planete),
|
||||
'temps' => sec(Donnee::tempsTerrestre($i, $planete)),
|
||||
'enfile' => $planete->file_ter->objectInFile($i)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$template->assign('unites', $TEMP_liste);
|
||||
$template->assign('file', $planete->file_ter->printFile($planete));
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue