From e9835eab12803d16d77c034d6878b1cc3fadd919 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Wed, 7 Oct 2020 13:41:56 +0300 Subject: [PATCH] Resolved #3229 - added "Not displayed as an available construction unless [] is built" unique --- core/src/com/unciv/models/ruleset/Building.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/src/com/unciv/models/ruleset/Building.kt b/core/src/com/unciv/models/ruleset/Building.kt index 25dadcebe3..8622412eb9 100644 --- a/core/src/com/unciv/models/ruleset/Building.kt +++ b/core/src/com/unciv/models/ruleset/Building.kt @@ -233,6 +233,7 @@ class Building : NamedStats(), IConstruction { || rejectionReason.startsWith("Requires") || rejectionReason.startsWith("Consumes") || rejectionReason == "Wonder is being built elsewhere" + || rejectionReason == "Should not be displayed" } fun getRejectionReason(construction: CityConstructions):String { @@ -243,6 +244,11 @@ class Building : NamedStats(), IConstruction { val cityCenter = construction.cityInfo.getCenterTile() val civInfo = construction.cityInfo.civInfo + // This overrides the others + if(uniqueObjects.any { it.placeholderText=="Not displayed as an available construction unless [] is built" + && !construction.containsBuildingOrEquivalent(it.params[0])} ) + return "Should not be displayed" + for(unique in uniqueObjects) when (unique.placeholderText) { "Must be on []" -> if (!cityCenter.fitsUniqueFilter(unique.params[0])) return unique.text "Must not be on []" -> if (cityCenter.fitsUniqueFilter(unique.params[0])) return unique.text