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
45
onyx2/include/game/jeu/chantierspatial.php
Normal file
45
onyx2/include/game/jeu/chantierspatial.php
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
$page = 'chantierspatial';
|
||||
$titre = ucfirst($LANG[$planete->race]['batiments']['noms_sing'][8]);
|
||||
|
||||
//Vérification que le joueur ait bien un labo avant d'afficher la page
|
||||
if ($planete->batiments[8] <= 0)
|
||||
erreur('Vous devez d\'abord construire un '.$LANG[$planete->race]['batiments']['noms_sing'][8], "red", '?p=batiments', 3500);
|
||||
|
||||
//Lancement d'une nouvelle construction
|
||||
if (isset($_GET['v']) && is_numeric($_GET['v']) && $nbv = floor(gpc('nombre', 'post'))) {
|
||||
$planete->file_vais->vaisseaux_addObjet(intval(gpc('v')), $nbv, $planete);
|
||||
|
||||
redirection($VAR['menu']['chantierspatial']);
|
||||
}
|
||||
//Annulation d'une nouvelle construction
|
||||
if (isset($_GET['a'])) {
|
||||
$n = intval(gpc('n'));
|
||||
if (empty($n)) $n = 1;
|
||||
$planete->file_vais->vaisseaux_delObjet(intval(gpc('a')), $n, $planete);
|
||||
|
||||
redirection($VAR['menu']['chantierspatial']);
|
||||
}
|
||||
|
||||
$TEMP_liste = array();
|
||||
foreach($planete->vaisseaux as $i => $nombre)
|
||||
{
|
||||
if (!empty($LANG[$planete->race]['vaisseaux']['noms_sing'][$i]) && Donnee::neededVaisseaux($i, $planete))
|
||||
{
|
||||
$TEMP_liste[] = array (
|
||||
'id' => $i,
|
||||
'image' => $nomvaisi[$i],
|
||||
'nombre' => $nombre,
|
||||
'nec_metal' => Donnee::metalVaisseaux($i, $planete),
|
||||
'nec_cristal' => Donnee::cristalVaisseaux($i, $planete),
|
||||
'nec_hydrogene' => Donnee::hydrogeneVaisseaux($i, $planete),
|
||||
'temps' => sec(Donnee::tempsVaisseaux($i, $planete)),
|
||||
'enfile' => $planete->file_vais->objectInFile($i)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$template->assign('vaisseaux', $TEMP_liste);
|
||||
$template->assign('file', $planete->file_vais->printFile($planete));
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue