mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 13:55:54 -04:00
Resolved #3229 - added "Not displayed as an available construction unless [] is built" unique
This commit is contained in:
parent
b96cdae232
commit
e9835eab12
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user