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
|
|
@ -3,8 +3,12 @@ if(!defined('INDEX')) { header('Location: ../'); exit; }
|
|||
$page = 'laboratoire';
|
||||
$titre = 'Laboratoire';
|
||||
|
||||
//Si l'on est pas sur la planète mère, on bloque le laboratoire
|
||||
if ($queryPlanetes[0]['id'] != $planete->id)
|
||||
erreur('Vous devez être sur votre planète mère pour faire des recherches dans le laboratoire.');
|
||||
|
||||
//Vérification que le joueur ait bien un labo avant d'afficher la page
|
||||
if ($planete->batiments[6] == 0) erreur('Vous devez d\'abord construire un '.strtolower($batiment[6]), "red", '?p=batiments', 4000);
|
||||
if ($planete->batiments[6] <= 0) erreur('Vous devez d\'abord construire un '.strtolower($batiment[6]), "red", '?p=batiments', 4000);
|
||||
|
||||
//Lancement d'une nouvelle recherche
|
||||
if (isset($_GET['t']) && isset($_GET['f']) ) {
|
||||
|
|
@ -12,7 +16,7 @@ if (isset($_GET['t']) && isset($_GET['f']) ) {
|
|||
if ($planete->file_exist(6, 'file_bat')) erreur('Votre laboratoire est en travaux, vous ne pouvez pas faire de recherches pour le moment !');
|
||||
|
||||
//Récupération des erreurs de la mise en file d'attente pour traitement
|
||||
$construction = $planete->file_addObjet("technologies", intval(gpc('t')), intval(gpc('f')));
|
||||
$construction = $planete->file_addTechno(intval(gpc('f')), intval(gpc('t')));
|
||||
|
||||
switch($construction){
|
||||
case 1: erreur('Vous n\'avez pas les bâtiments et/ou technologies nécessaires pour effectuer cette recherche.'); break;
|
||||
|
|
@ -29,7 +33,7 @@ if (isset($_GET['a'])) {
|
|||
$i = intval(gpc('a'));
|
||||
//Vérification de la présence du batiment dans la file d'attente
|
||||
if(!empty($planete->file_tech[$i+1])) {
|
||||
$planete->file_delObjet("technologies", $i);
|
||||
$planete->file_delTechno($i);
|
||||
header('Location: ?p=laboratoire');
|
||||
exit;
|
||||
}
|
||||
|
|
@ -41,7 +45,7 @@ foreach ($planete->technologies as $key => $technologie){
|
|||
foreach ($technologiesCALC[$key] as $i => $calc){
|
||||
//On affiche uniquement les technologies
|
||||
if (($technologie & $calc[1]) == $calc[1] && !($technologie & $calc[0] && $technologie != 0)) {
|
||||
if ($planete->file_exist($i, $key)) $enFile = true;
|
||||
if ($planete->file_existTech($key, $i)) $enFile = true;
|
||||
else $enFile = false;
|
||||
|
||||
//On applique les bonus de test
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue