Merge pull request #349 from ninjatao/Observatory_condition

Add observatory requirement.
This commit is contained in:
yairm210 2018-12-14 12:04:51 +02:00 committed by GitHub
commit 9a3dcf9a48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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