Grosse passe sur les recherches #22
@ -311,6 +311,15 @@ class dBatiments implements Donnees
|
||||
$sec /= (pow(1.23, $planete->batiments[11]) + 1.0025 * $planete->casernes[7]);
|
||||
}
|
||||
|
||||
//Bonus technologique de vitesse de construction : Constructions Planétaires
|
||||
if ($planete->technologies[2]& dTechnologies::idToBit(2)) {
|
||||
$sec /= 1.15;
|
||||
} elseif ($planete->technologies[2]& dTechnologies::idToBit(1)) {
|
||||
$sec /= 1.10;
|
||||
} elseif ($planete->technologies[2]& dTechnologies::idToBit(0)) {
|
||||
$sec /= 1.05;
|
||||
}
|
||||
|
||||
//Accélération du temps de construction
|
||||
$sec /= VITESSE;
|
||||
|
||||
|
@ -422,7 +422,7 @@ class dSpatial implements Donnees
|
||||
$moins = 12;
|
||||
break;
|
||||
case 13:
|
||||
$temps = 34900;
|
||||
$temps = 2000;
|
||||
$moins = 12;
|
||||
break;
|
||||
default:
|
||||
@ -1298,6 +1298,42 @@ class dSpatial implements Donnees
|
||||
}
|
||||
|
||||
//On tient compte des bonus
|
||||
//Bonus pour les vaisseaux léger
|
||||
if ($id <= 3) {
|
||||
//Bonus Assistance de visée
|
||||
if ($planete->technologies[4]& dTechnologies::idToBit(5)) {
|
||||
$attaque *= 1.30;
|
||||
} elseif ($planete->technologies[4]& dTechnologies::idToBit(4)) {
|
||||
$attaque *= 1.20;
|
||||
} elseif ($planete->technologies[4]& dTechnologies::idToBit(3)) {
|
||||
$attaque *= 1.10;
|
||||
}
|
||||
}
|
||||
|
||||
//Bonus pour les vaisseaux moyen
|
||||
if ($id >= 4 && $id <= 7) {
|
||||
//Bonus Guidage laser
|
||||
if ($planete->technologies[4]& dTechnologies::idToBit(8)) {
|
||||
$attaque *= 1.30;
|
||||
} elseif ($planete->technologies[4]& dTechnologies::idToBit(7)) {
|
||||
$attaque *= 1.20;
|
||||
} elseif ($planete->technologies[4]& dTechnologies::idToBit(6)) {
|
||||
$attaque *= 1.10;
|
||||
}
|
||||
}
|
||||
|
||||
//Bonus pour les vaisseaux lourds
|
||||
if ($id >= 8) {
|
||||
//Bonus Condensateurs Rapides
|
||||
if ($planete->technologies[4]& dTechnologies::idToBit(11)) {
|
||||
$attaque *= 1.30;
|
||||
} elseif ($planete->technologies[4]& dTechnologies::idToBit(10)) {
|
||||
$attaque *= 1.20;
|
||||
} elseif ($planete->technologies[4]& dTechnologies::idToBit(9)) {
|
||||
$attaque *= 1.10;
|
||||
}
|
||||
}
|
||||
|
||||
return $attaque;
|
||||
}
|
||||
|
||||
@ -1526,6 +1562,42 @@ class dSpatial implements Donnees
|
||||
}
|
||||
|
||||
//On tient compte des bonus
|
||||
//Bonus pour les vaisseaux léger
|
||||
if ($id <= 3) {
|
||||
//Bonus Alliage
|
||||
if ($planete->technologies[5]& dTechnologies::idToBit(20)) {
|
||||
$armature *= 1.30;
|
||||
} elseif ($planete->technologies[5]& dTechnologies::idToBit(19)) {
|
||||
$armature *= 1.20;
|
||||
} elseif ($planete->technologies[5]& dTechnologies::idToBit(18)) {
|
||||
$armature *= 1.10;
|
||||
}
|
||||
}
|
||||
|
||||
//Bonus pour les vaisseaux moyen
|
||||
if ($id >= 4 && $id <= 7) {
|
||||
//Bonus Alliage avancé
|
||||
if ($planete->technologies[5]& dTechnologies::idToBit(23)) {
|
||||
$armature *= 1.30;
|
||||
} elseif ($planete->technologies[5]& dTechnologies::idToBit(22)) {
|
||||
$armature *= 1.20;
|
||||
} elseif ($planete->technologies[5]& dTechnologies::idToBit(21)) {
|
||||
$armature *= 1.10;
|
||||
}
|
||||
}
|
||||
|
||||
//Bonus pour les vaisseaux lourds
|
||||
if ($id >= 8) {
|
||||
//Bonus Armure Moléculaire
|
||||
if ($planete->technologies[5]& dTechnologies::idToBit(26)) {
|
||||
$armature *= 1.30;
|
||||
} elseif ($planete->technologies[5]& dTechnologies::idToBit(25)) {
|
||||
$armature *= 1.20;
|
||||
} elseif ($planete->technologies[5]& dTechnologies::idToBit(24)) {
|
||||
$armature *= 1.10;
|
||||
}
|
||||
}
|
||||
|
||||
return $armature;
|
||||
}
|
||||
}
|
||||
|
@ -471,6 +471,15 @@ class dTerrestre implements Donnees
|
||||
$temps /= VITESSE;
|
||||
|
||||
//On tient compte des bonus
|
||||
//Bonus technologique de vitesse de construction : Constructions Planétaires
|
||||
if ($planete->technologies[2]& dTechnologies::idToBit(2)) {
|
||||
$temps /= 1.15;
|
||||
} elseif ($planete->technologies[2]& dTechnologies::idToBit(1)) {
|
||||
$temps /= 1.10;
|
||||
} elseif ($planete->technologies[2]& dTechnologies::idToBit(0)) {
|
||||
$temps /= 1.05;
|
||||
}
|
||||
|
||||
return ceil($temps/pow(1.25, ($planete->batiments[7] - $moins))) * $nombre;
|
||||
}
|
||||
|
||||
@ -743,4 +752,269 @@ class dTerrestre implements Donnees
|
||||
return dDonnees::neededCheck($neededTerrestre[$id], $planete);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static function attaque($id, surface $planete, $race = null)
|
||||
{
|
||||
if ($race == null) {
|
||||
$race = $planete->race;
|
||||
}
|
||||
//Les véhicules ne sont pas implémenté pour le moment
|
||||
if ($id < 8) {
|
||||
return 0;
|
||||
}
|
||||
if ($race == "humain") {
|
||||
switch ($id) {
|
||||
case 8:
|
||||
$attaque = 15;
|
||||
break;
|
||||
case 9:
|
||||
$attaque = 50;
|
||||
break;
|
||||
case 10:
|
||||
$attaque = 1000;
|
||||
break;
|
||||
case 11:
|
||||
$attaque = 2000;
|
||||
break;
|
||||
case 12:
|
||||
$attaque = 3000;
|
||||
break;
|
||||
case 13:
|
||||
$attaque = 3500;
|
||||
break;
|
||||
case 14:
|
||||
$attaque = 6000;
|
||||
break;
|
||||
case 15:
|
||||
$attaque = 15000;
|
||||
break;
|
||||
default:
|
||||
trigger_error("Vaisseau ".$id." introuvable dans les données", E_USER_ERROR);
|
||||
}
|
||||
} else {
|
||||
switch ($id) {
|
||||
case 8:
|
||||
$attaque = 15;
|
||||
break;
|
||||
case 9:
|
||||
$attaque = 50;
|
||||
break;
|
||||
case 10:
|
||||
$attaque = 1000;
|
||||
break;
|
||||
case 11:
|
||||
$attaque = 2000;
|
||||
break;
|
||||
case 12:
|
||||
$attaque = 3000;
|
||||
break;
|
||||
default:
|
||||
trigger_error("Vaisseau ".$id." introuvable dans les données", E_USER_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
//On tient compte des bonus
|
||||
//Bonus pour les défenses légère
|
||||
if ($id == 8 || $id == 9) {
|
||||
//Bonus Projectiles haute densité
|
||||
if ($planete->technologies[4]& dTechnologies::idToBit(2)) {
|
||||
$attaque *= 1.30;
|
||||
} elseif ($planete->technologies[4]& dTechnologies::idToBit(1)) {
|
||||
$attaque *= 1.20;
|
||||
} elseif ($planete->technologies[4]& dTechnologies::idToBit(0)) {
|
||||
$attaque *= 1.10;
|
||||
}
|
||||
}
|
||||
|
||||
//Bonus pour les défenses moyenne
|
||||
if ($id == 10 || $id == 11) {
|
||||
//Bonus Ballistique avancée
|
||||
if ($planete->technologies[4]& dTechnologies::idToBit(14)) {
|
||||
$attaque *= 1.30;
|
||||
} elseif ($planete->technologies[4]& dTechnologies::idToBit(13)) {
|
||||
$attaque *= 1.20;
|
||||
} elseif ($planete->technologies[4]& dTechnologies::idToBit(12)) {
|
||||
$attaque *= 1.10;
|
||||
}
|
||||
}
|
||||
|
||||
//Bonus pour les défenses lourdes
|
||||
if ($id >= 12) {
|
||||
//Bonus Accélération Magnétique
|
||||
if ($planete->technologies[4]& dTechnologies::idToBit(17)) {
|
||||
$attaque *= 1.30;
|
||||
} elseif ($planete->technologies[4]& dTechnologies::idToBit(16)) {
|
||||
$attaque *= 1.20;
|
||||
} elseif ($planete->technologies[4]& dTechnologies::idToBit(15)) {
|
||||
$attaque *= 1.10;
|
||||
}
|
||||
}
|
||||
|
||||
return $attaque;
|
||||
}
|
||||
|
||||
public static function bouclier($id, surface $planete, $race = null)
|
||||
{
|
||||
if ($race == null) {
|
||||
$race = $planete->race;
|
||||
}
|
||||
//Les véhicules ne sont pas implémenté pour le moment
|
||||
if ($id < 8) {
|
||||
return 0;
|
||||
}
|
||||
if ($race == "humain") {
|
||||
switch ($id) {
|
||||
case 8:
|
||||
$bouclier = 25;
|
||||
break;
|
||||
case 9:
|
||||
$bouclier = 75;
|
||||
break;
|
||||
case 10:
|
||||
$bouclier = 1500;
|
||||
break;
|
||||
case 11:
|
||||
$bouclier = 1800;
|
||||
break;
|
||||
case 12:
|
||||
$bouclier = 4850;
|
||||
break;
|
||||
case 13:
|
||||
$bouclier = 5000;
|
||||
break;
|
||||
case 14:
|
||||
$bouclier = 5000;
|
||||
break;
|
||||
case 15:
|
||||
$bouclier = 7500;
|
||||
break;
|
||||
default:
|
||||
trigger_error("Vaisseau ".$id." introuvable dans les données", E_USER_ERROR);
|
||||
}
|
||||
} else {
|
||||
switch ($id) {
|
||||
case 8:
|
||||
$bouclier = 40;
|
||||
break;
|
||||
case 9:
|
||||
$bouclier = 120;
|
||||
break;
|
||||
case 10:
|
||||
$bouclier = 2600;
|
||||
break;
|
||||
case 11:
|
||||
$bouclier = 5000;
|
||||
break;
|
||||
case 12:
|
||||
$bouclier = 8600;
|
||||
break;
|
||||
default:
|
||||
trigger_error("Vaisseau ".$id." introuvable dans les données", E_USER_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
//On tient compte des bonus
|
||||
return $bouclier;
|
||||
}
|
||||
|
||||
public static function armature($id, surface $planete, $race = null)
|
||||
{
|
||||
if ($race == null) {
|
||||
$race = $planete->race;
|
||||
}
|
||||
//Les véhicules ne sont pas implémenté pour le moment
|
||||
if ($id < 8) {
|
||||
return 0;
|
||||
}
|
||||
if ($race == "humain") {
|
||||
switch ($id) {
|
||||
case 8:
|
||||
$armature = 25;
|
||||
break;
|
||||
case 9:
|
||||
$armature = 75;
|
||||
break;
|
||||
case 10:
|
||||
$armature = 1500;
|
||||
break;
|
||||
case 11:
|
||||
$armature = 1800;
|
||||
break;
|
||||
case 12:
|
||||
$armature = 4850;
|
||||
break;
|
||||
case 13:
|
||||
$armature = 5000;
|
||||
break;
|
||||
case 14:
|
||||
$armature = 5000;
|
||||
break;
|
||||
case 15:
|
||||
$armature = 7500;
|
||||
break;
|
||||
default:
|
||||
trigger_error("Vaisseau ".$id." introuvable dans les données", E_USER_ERROR);
|
||||
}
|
||||
} else {
|
||||
switch ($id) {
|
||||
case 8:
|
||||
$armature = 10;
|
||||
break;
|
||||
case 9:
|
||||
$armature = 30;
|
||||
break;
|
||||
case 10:
|
||||
$armature = 400;
|
||||
break;
|
||||
case 11:
|
||||
$armature = 700;
|
||||
break;
|
||||
case 12:
|
||||
$armature = 1400;
|
||||
break;
|
||||
default:
|
||||
trigger_error("Vaisseau ".$id." introuvable dans les données", E_USER_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
//On tient compte des bonus
|
||||
//Bonus pour les défenses légères
|
||||
if ($id == 8 || $id == 9) {
|
||||
//Bonus Alliage
|
||||
if ($planete->technologies[5]& dTechnologies::idToBit(20)) {
|
||||
$armature *= 1.30;
|
||||
} elseif ($planete->technologies[5]& dTechnologies::idToBit(19)) {
|
||||
$armature *= 1.20;
|
||||
} elseif ($planete->technologies[5]& dTechnologies::idToBit(18)) {
|
||||
$armature *= 1.10;
|
||||
}
|
||||
}
|
||||
|
||||
//Bonus pour les défense moyennes
|
||||
if ($id == 10 || $id == 11) {
|
||||
//Bonus Alliage avancé
|
||||
if ($planete->technologies[5]& dTechnologies::idToBit(23)) {
|
||||
$armature *= 1.30;
|
||||
} elseif ($planete->technologies[5]& dTechnologies::idToBit(22)) {
|
||||
$armature *= 1.20;
|
||||
} elseif ($planete->technologies[5]& dTechnologies::idToBit(21)) {
|
||||
$armature *= 1.10;
|
||||
}
|
||||
}
|
||||
|
||||
//Bonus pour les défenses lourdes
|
||||
if ($id >= 12) {
|
||||
//Bonus Armure Moléculaire
|
||||
if ($planete->technologies[5]& dTechnologies::idToBit(26)) {
|
||||
$armature *= 1.30;
|
||||
} elseif ($planete->technologies[5]& dTechnologies::idToBit(25)) {
|
||||
$armature *= 1.20;
|
||||
} elseif ($planete->technologies[5]& dTechnologies::idToBit(24)) {
|
||||
$armature *= 1.10;
|
||||
}
|
||||
}
|
||||
|
||||
return $armature;
|
||||
}
|
||||
}
|
||||
|
@ -273,11 +273,12 @@ class Planete extends Surface
|
||||
$popPlus *= 1.05;
|
||||
} //Démocratie : 5 % de population qui arrive en plus.
|
||||
|
||||
if ($this->technologies[2] & 4) {
|
||||
//Bonus techno immigration coloniale
|
||||
if ($this->technologies[3] & 4) {
|
||||
$popPlus *= 1.15;
|
||||
} elseif ($this->technologies[2] & 2) {
|
||||
} elseif ($this->technologies[3] & 2) {
|
||||
$popPlus *= 1.10;
|
||||
} elseif ($this->technologies[2] & 1) {
|
||||
} elseif ($this->technologies[3] & 1) {
|
||||
$popPlus *= 1.05;
|
||||
}
|
||||
|
||||
@ -671,7 +672,27 @@ class Planete extends Surface
|
||||
$prod_hy -= $conso_h;
|
||||
|
||||
if ($retarray) {
|
||||
return array(array(ceil($this->coeff_bat[0]*100), ceil($this->coeff_bat[1]*100), ceil($this->coeff_bat[2]*100), ceil($this->coeff_bat[3]*100), ceil($this->coeff_bat[4]*100)), array($prod_met, $prod_cri, $prod_hy + $conso_h, $energie_s*$this->coeff_bat[3], $energie_f*$this->coeff_bat[4]), array($energie_m*$this->coeff_bat[0], $energie_c*$this->coeff_bat[1], $energie_h*$this->coeff_bat[2], $conso_h, ($energie_s*$this->coeff_bat[3] + $energie_f*$this->coeff_bat[4])-($energie_m*$this->coeff_bat[0] + $energie_c*$this->coeff_bat[1] + $energie_h*$this->coeff_bat[2])));
|
||||
return array(
|
||||
array(
|
||||
ceil($this->coeff_bat[0]*100),
|
||||
ceil($this->coeff_bat[1]*100),
|
||||
ceil($this->coeff_bat[2]*100),
|
||||
ceil($this->coeff_bat[3]*100),
|
||||
ceil($this->coeff_bat[4]*100)),
|
||||
array(
|
||||
$prod_met,
|
||||
$prod_cri,
|
||||
$prod_hy + $conso_h,
|
||||
$energie_s*$this->coeff_bat[3],
|
||||
$energie_f*$this->coeff_bat[4]),
|
||||
array(
|
||||
$energie_m*$this->coeff_bat[0],
|
||||
$energie_c*$this->coeff_bat[1],
|
||||
$energie_h*$this->coeff_bat[2],
|
||||
$conso_h,
|
||||
($energie_s*$this->coeff_bat[3] + $energie_f*$this->coeff_bat[4])-($energie_m*$this->coeff_bat[0] + $energie_c*$this->coeff_bat[1] + $energie_h*$this->coeff_bat[2])
|
||||
)
|
||||
);
|
||||
} else {
|
||||
return array($prod_met, $prod_cri, $prod_hy);
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ $max_unite = count($LANG[$race]["terrestre"]["noms_sing"]);
|
||||
while ($id <= $max_unite) {
|
||||
if (!empty($LANG[$race]["terrestre"]["noms_sing"][$id])) {
|
||||
$TEMP_liste[$id] = array(
|
||||
'niveau' => $planete->terrestres[$id],
|
||||
'niveau' => ($race == $planete->race) ? $planete->terrestres[$id] : 0,
|
||||
'etat' => dTerrestre::needed($id, $planete, true, $race)
|
||||
);
|
||||
}
|
||||
|
@ -125,10 +125,7 @@ if (isset($_GET['t']) && is_numeric($_GET['t']) && !empty($LANG[$race]["technolo
|
||||
$template->assign('ressourcesNext', array(dTerrestre::metal($t, 1, $planete), dTerrestre::cristal($t, 1, $planete), dTerrestre::hydrogene($t, 1, $planete), dTerrestre::temps($t, 1, $planete)));
|
||||
|
||||
$template->assign('etat', dTerrestre::needed($t, $planete, true));
|
||||
if ($t-8 >= 0) {
|
||||
$t -= 8;
|
||||
$template->assign('caract', array($defense_at[$t], $defense_bc[$t], $defense_pv[$t]));
|
||||
}
|
||||
$template->assign('caract', array(dTerrestre::attaque($t, $planete, $race), dTerrestre::bouclier($t, $planete, $race), dTerrestre::armature($t, $planete, $race)));
|
||||
} elseif (isset($_GET['c']) && is_numeric($_GET['c']) && !empty($LANG[$race]["caserne"]["noms_sing"][$_GET['c']])) {
|
||||
$template->assign('type', 'caserne');
|
||||
$t = gpc('c');
|
||||
|
@ -860,11 +860,11 @@
|
||||
<var name="26">Armure moléculaire</var>
|
||||
</var>
|
||||
<var name="6">
|
||||
<var name="0">Tourelle légère M202 XP</var>
|
||||
<var name="1">Canon de défense automatique</var>
|
||||
<var name="2">Artillerie lourde de 440mm</var>
|
||||
<var name="3">Lance-missiles Archer</var>
|
||||
<var name="4">Batterie de missiles Anaconda</var>
|
||||
<var name="0">Shade</var>
|
||||
<var name="1">Strong Shade</var>
|
||||
<var name="2">Canon à plasma</var>
|
||||
<var name="3">Canon à combustible</var>
|
||||
<var name="4">Lanceur de torpille plasma</var>
|
||||
<var name="5">Silo de missiles Shiva</var>
|
||||
<var name="6">Canon à accélération magnétique</var>
|
||||
</var>
|
||||
@ -1038,11 +1038,11 @@
|
||||
<var name="26">~#DESCRIPTION MANQUANTE#~ Armure moléculaire</var>
|
||||
</var>
|
||||
<var name="6">
|
||||
<var name="0">~#DESCRIPTION MANQUANTE#~ Tourelle légère M202 XP</var>
|
||||
<var name="1">~#DESCRIPTION MANQUANTE#~ Canon de défense automatique</var>
|
||||
<var name="2">~#DESCRIPTION MANQUANTE#~ Artillerie lourde de 440mm</var>
|
||||
<var name="3">~#DESCRIPTION MANQUANTE#~ Lance-missiles Archer</var>
|
||||
<var name="4">~#DESCRIPTION MANQUANTE#~ Batterie de missiles Anaconda</var>
|
||||
<var name="0">Shade</var>
|
||||
<var name="1">Strong Shade</var>
|
||||
<var name="2">Canon à plasma</var>
|
||||
<var name="3">Canon à combustible</var>
|
||||
<var name="4">Lanceur de torpille plasma</var>
|
||||
<var name="5">~#DESCRIPTION MANQUANTE#~ Silo de missiles Shiva</var>
|
||||
<var name="6">~#DESCRIPTION MANQUANTE#~ Canon à accélération magnétique</var>
|
||||
</var>
|
||||
|
@ -27,7 +27,7 @@
|
||||
<h2>Infos</h2>
|
||||
{if $smarty.const.SURFACE == "planete"}
|
||||
<h4>{php}dDonnees::nameVilles($this->_tpl_vars['planete']->batiments[17]){/php}</h4>
|
||||
<h4>Diamètre: {$diametre|separerNombres} km <ins>({$planete->casesRest} case{if $planete->casesRest > 1}s{/if} disponible{if $planete->casesRest > 1}s{/if} sur {php}dDonnees::capaciteVilles($this->_tpl_vars['planete']){/php})</ins></h4>
|
||||
<h4>Diamètre: {$diametre|separerNombres} km <ins>({$planete->casesRest} case{if $planete->casesRest > 1}s{/if} disponible{if $planete->casesRest > 1}s{/if} sur {$planete->cases})</ins></h4>
|
||||
{/if}
|
||||
<h4>Race : {$planete->race}</h4>
|
||||
<h4>position: <a href="?p=carte&galaxie={$planete->galaxie}&ss={$planete->ss}">{$planete->galaxie}.{$planete->ss}.{$planete->position}</a></h4>
|
||||
@ -111,4 +111,4 @@
|
||||
<h2>Infos de l'alliance</h2>
|
||||
{$planete->details.texte_interne}
|
||||
{/if}
|
||||
{include file='game/footer.tpl'}
|
||||
{include file='game/footer.tpl'}
|
||||
|
Loading…
Reference in New Issue
Block a user