From e3f1c3365443f629c4a762ba5def77ad02183370 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Thu, 17 Dec 2020 15:46:17 +0200 Subject: [PATCH] Building.requiredBuildingInAllCities -> "Requires a [] in all cities" unique --- .../jsons/Civ V - Vanilla/Buildings.json | 25 +++++++------------ .../logic/civilization/CivilizationInfo.kt | 4 +-- core/src/com/unciv/models/ruleset/Building.kt | 3 +++ core/src/com/unciv/ui/utils/Popup.kt | 1 - 4 files changed, 14 insertions(+), 19 deletions(-) diff --git a/android/assets/jsons/Civ V - Vanilla/Buildings.json b/android/assets/jsons/Civ V - Vanilla/Buildings.json index 66af5f9285..f510b4ac78 100644 --- a/android/assets/jsons/Civ V - Vanilla/Buildings.json +++ b/android/assets/jsons/Civ V - Vanilla/Buildings.json @@ -218,8 +218,7 @@ "happiness": 5, "culture": 1, "isNationalWonder": true, - "requiredBuildingInAllCities": "Colosseum", - "uniques": ["Cost increases by [30] per owned city"], + "uniques": ["Requires a [Colosseum] in all cities", "Cost increases by [30] per owned city"], "requiredTech": "Horseback Riding" }, { @@ -300,9 +299,8 @@ "name": "National Epic", "cost": 125, "culture": 1, - "uniques": ["+[25]% great person generation in this city", "Cost increases by [30] per owned city"], "isNationalWonder": true, - "requiredBuildingInAllCities": "Monument", + "uniques": ["Requires a [Monument] in all cities", "+[25]% great person generation in this city", "Cost increases by [30] per owned city"], "requiredTech": "Philosophy" }, { @@ -319,8 +317,7 @@ "gold": 8, "culture": 1, "isNationalWonder": true, - "requiredBuildingInAllCities": "Market", - "uniques": ["Cost increases by [30] per owned city"], + "uniques": ["Requires a [Market] in all cities", "Cost increases by [30] per owned city"], "requiredTech": "Currency" }, { @@ -376,8 +373,8 @@ "cost": 125, "culture": 1, "isNationalWonder": true, - "requiredBuildingInAllCities": "Barracks", - "uniques": ["All newly-trained [non-air] units in this city receive the [Morale] promotion", "Cost increases by [30] per owned city"], + "uniques": ["Requires a [Barracks] in all cities", "All newly-trained [non-air] units in this city receive the [Morale] promotion", + "Cost increases by [30] per owned city"], "requiredTech": "Iron Working" }, @@ -415,8 +412,7 @@ "culture": 1, "isNationalWonder": true, "percentStatBonus": {"science": 50}, - "requiredBuildingInAllCities": "Library", - "uniques": ["Cost increases by [30] per owned city"], + "uniques": ["Requires a [Library] in all cities", "Cost increases by [30] per owned city"], "requiredTech": "Philosophy" }, { @@ -505,8 +501,7 @@ "science": 3, "culture": 1, "isNationalWonder": true, - "requiredBuildingInAllCities": "University", - "uniques": ["Free Technology", "Cost increases by [30] per owned city"], + "uniques": ["Requires a [University] in all cities", "Free Technology", "Cost increases by [30] per owned city"], "requiredTech": "Education" }, { @@ -556,8 +551,7 @@ "production": 8, "culture": 1, "isNationalWonder": true, - "requiredBuildingInAllCities": "Workshop", - "uniques": ["Cost increases by [30] per owned city"], + "uniques": ["Requires a [Workshop] in all cities", "Cost increases by [30] per owned city"], "requiredTech": "Machinery" }, { @@ -691,8 +685,7 @@ "percentStatBonus": {"culture": 50}, "culture": 5, "isNationalWonder": true, - "requiredBuildingInAllCities": "Opera House", - "uniques": ["Cost increases by [30] per owned city"], + "uniques": ["Requires a [Opera House] in all cities", "Cost increases by [30] per owned city"], "requiredTech": "Archaeology" }, { diff --git a/core/src/com/unciv/logic/civilization/CivilizationInfo.kt b/core/src/com/unciv/logic/civilization/CivilizationInfo.kt index 613b520632..7383b0484b 100644 --- a/core/src/com/unciv/logic/civilization/CivilizationInfo.kt +++ b/core/src/com/unciv/logic/civilization/CivilizationInfo.kt @@ -228,10 +228,10 @@ class CivilizationInfo { } } - fun removeUnit(mapUnit: MapUnit){ + fun removeUnit(mapUnit: MapUnit) { val newList = ArrayList(units) newList.remove(mapUnit) - units=newList + units = newList updateStatsForNextTurn() // unit upkeep updateDetailedCivResources() } diff --git a/core/src/com/unciv/models/ruleset/Building.kt b/core/src/com/unciv/models/ruleset/Building.kt index 613de52af8..87cec534ac 100644 --- a/core/src/com/unciv/models/ruleset/Building.kt +++ b/core/src/com/unciv/models/ruleset/Building.kt @@ -273,6 +273,9 @@ class Building : NamedStats(), IConstruction { "Requires a [] in this city" -> if (!construction.containsBuildingOrEquivalent(unique.params[0])) return "Requires a [${civInfo.getEquivalentBuilding(unique.params[0])}] in this city" // replace with civ-specific building for user + "Requires a [] in all cities" -> if (civInfo.cities.any { !it.cityConstructions.containsBuildingOrEquivalent(unique.params[0]) } ) + return "Requires a [${civInfo.getEquivalentBuilding(unique.params[0])}] in all cities" // replace with civ-specific building for user + "Obsolete with []" -> if (civInfo.tech.isResearched(unique.params[0])) return unique.text "Must have an owned mountain within 2 tiles" -> // Deprecated as of 3.10.8 . Use "Must have an owned [Mountain] within [2] tiles" instead diff --git a/core/src/com/unciv/ui/utils/Popup.kt b/core/src/com/unciv/ui/utils/Popup.kt index e5f6d726fc..16b2920866 100644 --- a/core/src/com/unciv/ui/utils/Popup.kt +++ b/core/src/com/unciv/ui/utils/Popup.kt @@ -34,7 +34,6 @@ open class Popup(val screen: CameraStageBaseScreen): Table(CameraStageBaseScreen screen.stage.addActor(this) pack() center(screen.stage) - } open fun close() {