From 1a731a7ec1542a4eae7cafcb4185c7a9a63d8d8a Mon Sep 17 00:00:00 2001 From: Duan Tao Date: Fri, 14 Dec 2018 17:16:33 +0800 Subject: [PATCH] Add observatory requirement. --- android/assets/jsons/Buildings.json | 2 +- core/src/com/unciv/models/gamebasics/Building.kt | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/android/assets/jsons/Buildings.json b/android/assets/jsons/Buildings.json index 1a4d0f3c13..f9b68e5419 100644 --- a/android/assets/jsons/Buildings.json +++ b/android/assets/jsons/Buildings.json @@ -360,7 +360,7 @@ hurryCostModifier:25, percentStatBonus:{science:50}, requiredBuilding:"Library", - uniques:[] //todo: "City must be bordering a mountain", + uniques:["Must be next to mountain"], requiredTech:"Astronomy" }, { diff --git a/core/src/com/unciv/models/gamebasics/Building.kt b/core/src/com/unciv/models/gamebasics/Building.kt index e5cbb07d8a..c66978af38 100644 --- a/core/src/com/unciv/models/gamebasics/Building.kt +++ b/core/src/com/unciv/models/gamebasics/Building.kt @@ -186,6 +186,9 @@ class Building : NamedStats(), IConstruction{ if ("Must be next to desert" in uniques && !construction.cityInfo.getCenterTile().getTilesInDistance(1).any { it.baseTerrain == "Desert" }) return false + if ("Must be next to mountain" in uniques + && !construction.cityInfo.getCenterTile().getTilesInDistance(1).any { it.baseTerrain == "Mountain" }) + return false if("Can only be built in coastal cities" in uniques && construction.cityInfo.getCenterTile().neighbors.none { it.baseTerrain=="Coast" }) return false