Refonte de la fonction needed pour les technos

Cette fonction utilisait sans doute l'ancienne version du sysètme et donc répondait true
à quasiment tous les coups. J'ai donc réécrit la forêt d'array en me basant sur les
descriptions, Il faut le niveau 1 de la tech A pour développer le niveau 2 de la techno A.

Cela veut dire que toutes les technos sont actuellement débloquée, mais c'est une décision
de gameplay dont nous allons devoir discuter :)
This commit is contained in:
Nigel Sheldon 2020-11-22 14:35:38 +01:00 committed by Gitea
parent a1fbca438a
commit e85a70e334

View File

@ -1050,31 +1050,389 @@ class dTechnologies implements Donnees
{
switch ($object[0]) {
case 0:
$tableau = array( 0 => 1, 1 => 2, 2 => 3, 3 => 0, 4 => 1, 5 => 2, 6 => 3, 7 => 1, 8 => 2, 9 => 3, 10 => 1, 11 => 2, 12 => 3, 13 => 1, 14 => 2, 15 => 3, 16 => 1, 17 => 2, 18 => 3);
$tableau = array(
0,
array(
array("technologies", 0, 0)
),
array(
array("technologies", 0, 1)
),
0,
0,
array(
array("technologies", 0, 4)
),
array(
array("technologies", 0, 5)
),
0,
array(
array("technologies", 0, 7)
),
array(
array("technologies", 0, 8)
),
0,
array(
array("technologies", 0, 10)
),
array(
array("technologies", 0, 11)
),
0,
array(
array("technologies", 0, 13)
),
array(
array("technologies", 0, 14)
),
0,
array(
array("technologies", 0, 16)
),
array(
array("technologies", 0, 17)
)
);
break;
case 1:
$tableau = array( 0 => 1, 1 => 2, 2 => 3, 3 => 1, 4 => 2, 5 => 3, 6 => 1, 7 => 2, 8 => 3, 9 => 1, 10 => 2, 11 => 3, 12 => 1, 13 => 2, 14 => 3, 15 => 1, 16 => 2, 17 => 3, 18 => 1, 19 => 2, 20 => 3, 21 => 1, 22 => 2, 23 => 3, 24 => 1, 25 => 2, 26 => 3, 27 => 1, 28 => 2, 29 => 3);
$tableau = array(
0,
array(
array("technologies", 1, 0)
),
array(
array("technologies", 1, 1)
),
0,
array(
array("technologies", 1, 3)
),
array(
array("technologies", 1, 4)
),
0,
array(
array("technologies", 1, 6)
),
array(
array("technologies", 1, 7)
),
0,
array(
array("technologies", 1, 9)
),
array(
array("technologies", 1, 10)
),
0,
array(
array("technologies", 1, 12)
),
array(
array("technologies", 1, 13)
),
0,
array(
array("technologies", 1, 15)
),
array(
array("technologies", 1, 16)
),
0,
array(
array("technologies", 1, 18)
),
array(
array("technologies", 1, 19)
),
0,
array(
array("technologies", 1, 21)
),
array(
array("technologies", 1, 22)
),
0,
array(
array("technologies", 1, 24)
),
array(
array("technologies", 1, 25)
),
0,
array(
array("technologies", 1, 27)
),
array(
array("technologies", 1, 28)
)
);
break;
case 2:
$tableau = array( 0 => 1, 1 => 2, 2 => 3, 3 => 0, 4 => 0, 5 => 1, 6 => 2, 7 => 3);
$tableau = array(
0,
array(
array("technologies", 2, 0)
),
array(
array("technologies", 2, 1)
),
0,
0,
0,
array(
array("technologies", 2,5)
),
array(
array("technologies", 2, 6)
)
);
break;
case 3:
$tableau = array( 0 => 1, 1 => 2, 2 => 3, 3 => 1, 4 => 2, 5 => 3, 6 => 0, 7 => 0, 8 => 0, 9 => 1, 10 => 2, 11 => 3, 12 => 1, 13 => 2, 14 => 3);
$tableau = array(
0,
array(
array("technologies", 3, 0)
),
array(
array("technologies", 3, 1)
),
0,
array(
array("technologies", 3, 3)
),
array(
array("technologies", 3, 4)
),
0,
0,
0,
0,
array(
array("technologies", 3, 9)
),
array(
array("technologies", 3, 10)
),
0,
array(
array("technologies", 3, 12)
),
array(
array("technologies", 3, 13)
)
);
break;
case 4:
$tableau = array( 0 => 1, 1 => 2, 2 => 3, 3 => 1, 4 => 2, 5 => 3, 6 => 1, 7 => 2, 8 => 3, 9 => 1, 10 => 2, 11 => 3, 12 => 1, 13 => 2, 14 => 3, 15 => 1, 16 => 2, 17 => 3);
$tableau = array(
0,
array(
array("technologies", 4, 0)
),
array(
array("technologies", 4, 1)
),
0,
array(
array("technologies", 4, 3)
),
array(
array("technologies", 4, 4)
),
0,
array(
array("technologies", 4, 6)
),
array(
array("technologies", 4, 7)
),
0,
array(
array("technologies", 4, 9)
),
array(
array("technologies", 4, 10)
),
0,
array(
array("technologies", 4, 12)
),
array(
array("technologies", 4, 13)
),
0,
array(
array("technologies", 4, 15)
),
array(
array("technologies", 4, 16)
),
);
break;
case 5:
$tableau = array( 0 => 1, 1 => 2, 2 => 3, 3 => 1, 4 => 2, 5 => 3, 6 => 1, 7 => 2, 8 => 3, 9 => 1, 10 => 2, 11 => 3, 12 => 1, 13 => 2, 14 => 3, 15 => 1, 16 => 2, 17 => 3, 18 => 1, 19 => 2, 20 => 3, 21 => 1, 22 => 2, 23 => 3, 24 => 1, 25 => 2, 26 => 3);
$tableau = array(
0,
array(
array("technologies", 5, 0)
),
array(
array("technologies", 5, 1)
),
0,
array(
array("technologies", 5, 3)
),
array(
array("technologies", 5, 4)
),
0,
array(
array("technologies", 5, 6)
),
array(
array("technologies", 5, 7)
),
0,
array(
array("technologies", 5, 9)
),
array(
array("technologies", 5, 10)
),
0,
array(
array("technologies", 5, 12)
),
array(
array("technologies", 5, 13)
),
0,
array(
array("technologies", 5, 15)
),
array(
array("technologies", 5, 16)
),
0,
array(
array("technologies", 5, 18)
),
array(
array("technologies", 5, 19)
),
0,
array(
array("technologies", 5, 21)
),
array(
array("technologies", 5, 22)
),
0,
array(
array("technologies", 5, 24)
),
array(
array("technologies", 5, 25)
),
);
break;
case 6:
$tableau = array( 0 => 0, 1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0);
$tableau = array(
0,
0,
0,
0,
0,
0,
0,
);
break;
case 7:
$tableau = array( 0 => 0, 1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0, 7 => 0, 8 => 0, 9 => 0, 10 => 0, 11 => 0, 12 => 1, 13 => 2, 14 => 3);
$tableau = array(
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
array(
array("technologies", 7, 12)
),
array(
array("technologies", 7, 13)
),
);
break;
case 8:
$tableau = array(
0,
array(
array("technologies", 8, 1)
),
array(
array("technologies", 8, 2)
),
array(
array("technologies", 8, 3)
),
array(
array("technologies", 8, 4)
),
array(
array("technologies", 8, 5)
),
array(
array("technologies", 8, 6)
),
array(
array("technologies", 8, 7)
),
array(
array("technologies", 8, 8)
),
array(
array("technologies", 8, 9)
),
array(
array("technologies", 8, 10)
),
array(
array("technologies", 8, 11)
),
array(
array("technologies", 8, 12)
),
array(
array("technologies", 8, 13)
),
array(
array("technologies", 8, 14)
),
array(
array("technologies", 8, 15)
),
array(
array("technologies", 8, 16)
),
array(
array("technologies", 8, 17)
),
array(
array("technologies", 8, 18)
),
);
break;
default:
trigger_error("Branche ".$branche." introuvable dans les données", E_USER_ERROR);
trigger_error("Branche ".$object[0]." introuvable dans les données", E_USER_ERROR);
}
if ($print) {