Closed eliopinho closed 5 years ago
That's another bug, i'll look into it.
It should be fixed, shouldn't it?
I noticed one problem. I have not built Grain Mill although all the conditions for this have been met and it is displayed in "avaliable". Accordingly, all conditions are met for the construction of Bakery. And now the Bakery are displayed in "more", maybe Bakery should be displayed in "soon"? It turns out that I had to fulfill only one condition for the construction of Bakery, this is to build Grain Mill. This is certainly not critical :)
@velhbxtyrj It should be fixed in a067344e03fd426a04ce58ff622f704b16af36ea.
If build Grain Mill on level 1, then the bakery is displayed in "soon". By code, this works correctly. But if we not built Grain Mill then bakery is displayed in "more".
This is displayed in the "soon" if set $grainmill >= 0
. I'm not sure if it will be right :)
I forgotten a little thing, it should be fixed in 00d5021.
Now, if you meet at least one prerequisite, the Bakery will show in the "Soon" building list.
The three prerequisites are: Grain Mill from level 1 to level 5, Cropland from level 5 to level 10, Main Building from level 2 to level 5.
This needs to be reviewed carefully. Tomorrow I will study it. I just noticed another oddity. If the residence is established in the village and I am removing the main building on level 3 from level 20, then the palace appears in the "soon". I think it is necessary to relate two different conditions. For example, that the building would appear "soon" if we have 3 conditions and two of them are fulfilled. In this case, the main building should go from level 2 to level 20. It should be the same with cropland.
Yeah, you're right, the problem is related to nearly all buildings in the "Soon" and "Show more" list.
Maybe it should be done in this form:
if($bakery == 0 && $grainmill >= 1 && $cropland >= 5 || $bakery == 0 && $cropland >= 5 && $mainbuilding >= 2 || $bakery == 0 && $mainbuilding >= 2 && $grainmill >= 1) {
include("soon/bakery.tpl");
}
I thinl it should be refactored and taken these conditions in account.
The amount of different buildings thst have to been build before. And the total of levels that other buildings need. And then sort all the buildings accordingly. That way you always have the correct displayment
@velhbxtyrj, Ok, i'll code it in the game. @TerraSkye, This can be an idea, but someone should do a complete list with all the conditions.
I could try it if you say in what form it should be.
A building is shown in "Sho soon" if the sum of the actual required buildings level is greater than 45/50% of the total sum of required buildings level for building that building.
A building is shown in "Show more" if the sum of the actual required buildings level is greater than 45/50% of the total sum of required buildings level for building that building.
For example:
I've a level 2 Barracks and a level 1 Main Building, to build the Academy i need a level 3 Barracks and a level 3 Main Building, so it will be shown in "Show Soon" because the sum of the needed levels is 6, but the sum of the actual levels is 3 --> I've exactly 50% of the required levels.
Let me know if you like it.
I think it requires a deeper logic.
For example:
I have the Main Building of the 3rd level to build the Academy, I need the 3rd level barracks and the Main building of the 3rd level, so it will be shown in the "soon" because the sum of the required levels is 6, but the sum of the actual levels - 3 -> I have exactly 50% of the required levels.
We can build 50% of the total amount of two buildings to fulfill this condition. In the same way, we can build one single building requirement completely and this will also be 50% of the two buildings.
Sorry for paraphrasing your expression :)
Ok, i agree with you, i like your algorithm :)!
@iopietro for example i already have a market and no granary (destroyed by catapults) in construction list shows the market..