Added "All [] Cities get a free []" unique. (#3352)

* Added "All [] Cities get a free []" unique.

The first parameter is for city type. Currently "new" and "coastal" are supported.
"new" matches every city and "coastal" matches cities on a coastal tile.
"new" and "coastal" were added to template.properties for translation.

Upon city founding, the second parameter building is added to the city.

In civ 5 G&K, Carthage gets a free harbor for every coastal city.

* -Syntax changed to "Get a free [] []"
First paramater is the building and second is the city filter.
Supports "in every city" and "in every coastal city"

-new and coastal was removed from template.properties
-in every coastal city was added to template.properties

* Changed syntax to "Gain a free [] []"
This commit is contained in:
givehub99 2020-11-22 01:55:34 -08:00 committed by GitHub
parent 2d2117936e
commit 072226ff9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View File

@ -930,3 +930,4 @@ Must be on [terrain] =
in this city =
in every city =
in capital =
in every coastal city =

View File

@ -88,6 +88,15 @@ class CityInfo {
civInfo.policies.tryAddLegalismBuildings()
for (unique in civInfo.getMatchingUniques("Gain a free [] []")) {
val freeBuildingName = unique.params[0]
val cityFilter = unique.params[1]
if (cityFilter == "in every city" || (cityFilter == "in every coastal city" && getCenterTile().isCoastalTile()) ) {
if (!cityConstructions.isBuilt(freeBuildingName))
cityConstructions.addBuilding(freeBuildingName)
}
}
expansion.reset()