mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-31 18:04:55 +07:00
Resolved #9242 - Hide buildings requiring multiple cities in one city challenge
This commit is contained in:
parent
fab32e8c8a
commit
4b9c7171d3
@ -456,6 +456,11 @@ class Building : RulesetStatsObject(), INonPerpetualConstruction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
val rejectionReasons = getRejectionReasons(cityConstructions)
|
val rejectionReasons = getRejectionReasons(cityConstructions)
|
||||||
|
|
||||||
|
if (rejectionReasons.any { it.type == RejectionReasonType.RequiresBuildingInSomeCities }
|
||||||
|
&& cityConstructions.city.civ.gameInfo.gameParameters.oneCityChallenge)
|
||||||
|
return false // You will never be able to get more cities, this building is effectively disabled
|
||||||
|
|
||||||
return rejectionReasons.none { !it.shouldShow }
|
return rejectionReasons.none { !it.shouldShow }
|
||||||
|| (
|
|| (
|
||||||
canBePurchasedWithAnyStat(cityConstructions.city)
|
canBePurchasedWithAnyStat(cityConstructions.city)
|
||||||
@ -539,7 +544,7 @@ class Building : RulesetStatsObject(), INonPerpetualConstruction {
|
|||||||
val equivalentBuildingName = civ.getEquivalentBuilding(buildingName).name
|
val equivalentBuildingName = civ.getEquivalentBuilding(buildingName).name
|
||||||
yield(
|
yield(
|
||||||
// replace with civ-specific building for user
|
// replace with civ-specific building for user
|
||||||
RejectionReasonType.RequiresBuildingInAllCities.toInstance(
|
RejectionReasonType.RequiresBuildingInSomeCities.toInstance(
|
||||||
unique.text.fillPlaceholders(equivalentBuildingName, numberOfCitiesRequired.toString()) +
|
unique.text.fillPlaceholders(equivalentBuildingName, numberOfCitiesRequired.toString()) +
|
||||||
" ($numberOfCitiesWithBuilding/$numberOfCitiesRequired)"
|
" ($numberOfCitiesWithBuilding/$numberOfCitiesRequired)"
|
||||||
) )
|
) )
|
||||||
|
@ -174,6 +174,7 @@ enum class RejectionReasonType(val shouldShow: Boolean, val errorMessage: String
|
|||||||
|
|
||||||
RequiresBuildingInThisCity(true, "Requires a specific building in this city!"),
|
RequiresBuildingInThisCity(true, "Requires a specific building in this city!"),
|
||||||
RequiresBuildingInAllCities(true, "Requires a specific building in all cities!"),
|
RequiresBuildingInAllCities(true, "Requires a specific building in all cities!"),
|
||||||
|
RequiresBuildingInSomeCities(true, "Requires a specific building in more cities!"),
|
||||||
RequiresBuildingInSomeCity(true, "Requires a specific building anywhere in your empire!"),
|
RequiresBuildingInSomeCity(true, "Requires a specific building anywhere in your empire!"),
|
||||||
|
|
||||||
WonderAlreadyBuilt(false, "Wonder already built"),
|
WonderAlreadyBuilt(false, "Wonder already built"),
|
||||||
|
Loading…
Reference in New Issue
Block a user