mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-19 16:57:38 +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)
|
||||
|
||||
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 }
|
||||
|| (
|
||||
canBePurchasedWithAnyStat(cityConstructions.city)
|
||||
@ -539,7 +544,7 @@ class Building : RulesetStatsObject(), INonPerpetualConstruction {
|
||||
val equivalentBuildingName = civ.getEquivalentBuilding(buildingName).name
|
||||
yield(
|
||||
// replace with civ-specific building for user
|
||||
RejectionReasonType.RequiresBuildingInAllCities.toInstance(
|
||||
RejectionReasonType.RequiresBuildingInSomeCities.toInstance(
|
||||
unique.text.fillPlaceholders(equivalentBuildingName, numberOfCitiesRequired.toString()) +
|
||||
" ($numberOfCitiesWithBuilding/$numberOfCitiesRequired)"
|
||||
) )
|
||||
|
@ -174,6 +174,7 @@ enum class RejectionReasonType(val shouldShow: Boolean, val errorMessage: String
|
||||
|
||||
RequiresBuildingInThisCity(true, "Requires a specific building in this city!"),
|
||||
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!"),
|
||||
|
||||
WonderAlreadyBuilt(false, "Wonder already built"),
|
||||
|
Loading…
Reference in New Issue
Block a user