Add observatory requirement.

This commit is contained in:
Duan Tao 2018-12-14 17:16:33 +08:00
parent 5045d2c499
commit 1a731a7ec1
2 changed files with 4 additions and 1 deletions

View File

@ -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"
},
{

View File

@ -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