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
|
|
@ -140,6 +140,8 @@ class Planete extends Surface
|
|||
|
||||
//Calcul de la population logée
|
||||
$this->population_max = (pow($this->batiments[12],1.5)+pow($this->batiments[13],2.1))*1000+3000;
|
||||
//Détermination des capacités maximales
|
||||
$this->cap = pow(2, $this->batiments[10]) * 100000;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -151,9 +153,6 @@ class Planete extends Surface
|
|||
*/
|
||||
function actualiser($actuFile = true, $first = false)
|
||||
{
|
||||
//Détermination des capacités maximales
|
||||
$this->cap = pow(2, $this->batiments[10]) * 100000;
|
||||
|
||||
//Actualisation des files d'attentes
|
||||
if ($actuFile)
|
||||
{
|
||||
|
|
@ -220,13 +219,13 @@ class Planete extends Surface
|
|||
$this->cristal += $ressources[0];
|
||||
else
|
||||
{
|
||||
$this->alert_ressources[0] = true;
|
||||
$this->alert_ressources[1] = true;
|
||||
$this->cristal = $capnouv;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->alert_ressources[0] = true;
|
||||
$this->alert_ressources[1] = true;
|
||||
$this->cristal = $this->cap;
|
||||
}
|
||||
}
|
||||
|
|
@ -248,13 +247,13 @@ class Planete extends Surface
|
|||
$this->hydrogene += $ressources[0];
|
||||
else
|
||||
{
|
||||
$this->alert_ressources[0] = true;
|
||||
$this->alert_ressources[2] = true;
|
||||
$this->hydrogene = $capnouv;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->alert_ressources[0] = true;
|
||||
$this->alert_ressources[2] = true;
|
||||
$this->hydrogene = $this->cap;
|
||||
}
|
||||
}
|
||||
|
|
@ -413,7 +412,7 @@ class Planete extends Surface
|
|||
return false;
|
||||
}
|
||||
|
||||
function addRessources($metal, $cristal, $hydrogene)
|
||||
function addRessources($metal, $cristal, $hydrogene, $credits = 0)
|
||||
{
|
||||
$perte = 0;
|
||||
|
||||
|
|
@ -438,6 +437,12 @@ class Planete extends Surface
|
|||
$this->hydrogene = $this->cap;
|
||||
}
|
||||
|
||||
if (!empty($credits))
|
||||
{
|
||||
$this->credits += $credits;
|
||||
$this->addModifUser("credits");
|
||||
}
|
||||
|
||||
return $perte;
|
||||
}
|
||||
|
||||
|
|
@ -681,14 +686,19 @@ class Planete extends Surface
|
|||
return array($prod_met, $prod_cri, $prod_hy);
|
||||
}
|
||||
|
||||
function creer($id_user)
|
||||
function creer($id_user, $mere = false)
|
||||
{
|
||||
global $VAR;
|
||||
//Définition des paramètres de l'utilisateur pour la planète
|
||||
$this->id_user = $id_user;
|
||||
|
||||
//Génération du nombre de case et de l'image en fonction de la position dans le système
|
||||
if ($this->position > $VAR['nb_planete']*0.75)
|
||||
if ($mere)
|
||||
{
|
||||
$this->cases = 225;
|
||||
$this->image = mt_rand(1,19);
|
||||
}
|
||||
elseif ($this->position > $VAR['nb_planete']*0.75)
|
||||
{
|
||||
$this->cases = mt_rand(200,255);
|
||||
$this->image = mt_rand(1,19);
|
||||
|
|
@ -710,7 +720,11 @@ class Planete extends Surface
|
|||
}
|
||||
|
||||
//Définition des principaux paramètres de la planète
|
||||
$this->nom_planete = 'Planète colonisée';
|
||||
if ($mere)
|
||||
$this->nom_planete = 'Planète mère';
|
||||
else
|
||||
$this->nom_planete = 'Planète colonisée';
|
||||
|
||||
$this->metal = 1000;
|
||||
$this->cristal = 700;
|
||||
$this->hydrogene = 0;
|
||||
|
|
@ -718,12 +732,6 @@ class Planete extends Surface
|
|||
$this->modif = array("id_user", "nom_planete", "galaxie", "ss", "position", "image", "cases");
|
||||
}
|
||||
|
||||
function addModif($modif)
|
||||
{
|
||||
if (!in_array($modif, $this->modif))
|
||||
$this->modif[] = $modif;
|
||||
}
|
||||
|
||||
/**
|
||||
* Destructeur
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue