Fixed fresh water adjacency - @HadeanLake

This commit is contained in:
Yair Morgenstern 2020-09-11 11:02:05 +03:00
parent 265e6416f9
commit 4844a0e005
2 changed files with 3 additions and 2 deletions

View file

@ -309,7 +309,7 @@ open class TileInfo {
fun fitsUniqueFilter(filter:String): Boolean {
return filter == baseTerrain
|| (filter == "River" || filter == "Fresh water") && isAdjacentToRiver()
|| filter == "River" && isAdjacentToRiver()
|| filter == terrainFeature
|| baseTerrainObject.uniques.contains(filter)
|| terrainFeature != null && getTerrainFeature()!!.uniques.contains(filter)

View file

@ -235,7 +235,8 @@ class Building : NamedStats(), IConstruction {
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
"Must be next to []" -> if (cityCenter.getTilesInDistance(1).none { it.fitsUniqueFilter(unique.params[0]) }) return unique.text
"Must be next to []" -> if (!(unique.params[0] == "Fresh water" && cityCenter.isAdjacentToRiver()) // Fresh water is special, in that rivers are not tiles themselves but also fit the filter..
&& cityCenter.getTilesInDistance(1).none { it.fitsUniqueFilter(unique.params[0])}) return unique.text
"Must not be next to []" -> if (cityCenter.getTilesInDistance(1).any { it.fitsUniqueFilter(unique.params[0]) }) return unique.text
"Must have an owned [] within [] tiles" -> if (cityCenter.getTilesInDistance(distance = unique.params[1].toInt()).none {
it.fitsUniqueFilter(unique.params[0]) && it.getOwner() == construction.cityInfo.civInfo }) return unique.text