La techno expansion peut monter jusqu'au niveau 18, il faut donc la calculer à part, sinon on ne peux pas passer au dessus du niveau 3
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Nigel Sheldon 2021-04-18 19:59:03 +02:00 committed by Gitea
parent 4d61e17021
commit 9805b58f2b
1 changed files with 21 additions and 0 deletions

View File

@ -81,14 +81,35 @@ function traiterBranche($onglet, $branche, $start = false)
}
}
//La technologie Expansion peut monter jusqu'au niveau 18 \o/
if ($onglet == 8) {
$i = 1;
while ($i < 18) {
$b = $origin_b;
if ((dTechnologies::idToBit($b + ($i - 1)) & $planete->technologies[$onglet]) &&
isset($LANG[$planete->race]["technologies"]["noms_sing"][$onglet][$b+$i]) &&
$LANG[$planete->race]["technologies"]["noms_sing"][$onglet][$b] ==
$LANG[$planete->race]["technologies"]["noms_sing"][$onglet][$b+$i]) {
//La techno est déjà a ce niveau, on ne fait rien
} else {
$b += ($i - 1);
break;
}
$i++;
}
}
if ($key >= 1) {
$return .= "</dl><dl>";
}
//La techno est au plus haut niveau
if (dTechnologies::idToBit($b) & $planete->technologies[$onglet]) {
$return .= '<dt><a href="#">';
//La techno peut encore être augmentée
} elseif (dTechnologies::idToBit($origin_b) & $planete->technologies[$onglet]) {
$return .= '<dt class="partial"><a href="?p=laboratoire&amp;n='.$onglet.'&amp;t='.$b.'">';
//La techno n'a pas encore été recherchée
} else {
$return .= '<dt class="lack"><a href="?p=laboratoire&amp;n='.$onglet.'&amp;t='.$b.'">';
}