Terrace Farms: Bonus resource restriction (#2522)

This commit is contained in:
SomeTroglodyte 2020-04-26 18:39:48 +02:00 committed by GitHub
parent 818adbd1a3
commit 5e5a175f06
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View file

@ -184,13 +184,13 @@
{
"name": "Terrace farm",
"uniqueTo": "Inca",
"terrainsCanBeBuiltOn": ["Hill"],
"food": 1,
"turnsToBuild": 7,
"uniques": ["+1 food for each adjacent Mountain"],
"uniques": ["+1 food for each adjacent Mountain", "Cannot be built on bonus resource"],
"techRequired": "Construction",
"improvingTech": "Fertilizer",
"improvingTechStats": {"food":1},
"terrainsCanBeBuiltOn": ["Hill"]
"improvingTechStats": {"food":1}
},
{ "name": "Ancient ruins" },

View file

@ -271,6 +271,8 @@ open class TileInfo {
improvement.name == this.improvement -> false
improvement.uniqueTo != null && improvement.uniqueTo != civInfo.civName -> false
improvement.techRequired?.let { civInfo.tech.isResearched(it) } == false -> false
"Cannot be built on bonus resource" in improvement.uniques && resource != null
&& getTileResource().resourceType == ResourceType.Bonus -> false
improvement.terrainsCanBeBuiltOn.contains(topTerrain.name) -> true
improvement.name == "Road" && roadStatus == RoadStatus.None -> true
improvement.name == "Railroad" && this.roadStatus != RoadStatus.Railroad -> true