Building resource requirements now appear in Civilopedia

This commit is contained in:
Yair Morgenstern 2019-06-14 14:59:36 +03:00
parent 5943d1e12e
commit 22f44d328b
2 changed files with 6 additions and 2 deletions

View file

@ -182,7 +182,7 @@ class CityConstructions {
construction.postBuildEvent(this)
inProgressConstructions.remove(currentConstruction)
if (construction is Building && construction.requiredBuildingInAllCities == null) {
if (construction is Building && construction.isWonder) {
for (civ in cityInfo.civInfo.gameInfo.civilizations) {
if (civ.exploredTiles.contains(cityInfo.location))
civ.addNotification("[$currentConstruction] has been built in [${cityInfo.name}]", cityInfo.location, Color.BROWN)

View file

@ -86,6 +86,8 @@ class Building : NamedStats(), IConstruction{
stringBuilder.appendln("Requires [$requiredBuilding] to be built in the city".tr())
if (!forBuildingPickerScreen && requiredBuildingInAllCities != null)
stringBuilder.appendln("Requires [$requiredBuildingInAllCities] to be built in all cities".tr())
if(requiredResource!=null)
stringBuilder.appendln("Requires [$requiredResource]".tr())
if (providesFreeBuilding != null)
stringBuilder.appendln("Provides a free [$providesFreeBuilding] in the city".tr())
if(uniques.isNotEmpty()) stringBuilder.appendln(uniques.asSequence().map { it.tr() }.joinToString("\n"))
@ -238,7 +240,9 @@ class Building : NamedStats(), IConstruction{
if(isNationalWonder) {
if (civInfo.cities.any {it.cityConstructions.isBuilt(name) })
return "National Wonder is already built"
if (civInfo.cities.any { !it.cityConstructions.containsBuildingOrEquivalent(requiredBuildingInAllCities!!) })
if (requiredBuildingInAllCities!=null
&& civInfo.cities.any { !it.cityConstructions
.containsBuildingOrEquivalent(requiredBuildingInAllCities!!) })
return "Requires a [$requiredBuildingInAllCities] in all cities"
if (civInfo.cities.any {it!=construction.cityInfo && it.cityConstructions.isBeingConstructed(name) })
return "National Wonder is being built elsewhere"