mirror of
https://github.com/yairm210/Unciv.git
synced 2025-03-13 19:39:34 +07:00
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:
parent
2d2117936e
commit
072226ff9a
@ -930,3 +930,4 @@ Must be on [terrain] =
|
|||||||
in this city =
|
in this city =
|
||||||
in every city =
|
in every city =
|
||||||
in capital =
|
in capital =
|
||||||
|
in every coastal city =
|
@ -88,6 +88,15 @@ class CityInfo {
|
|||||||
|
|
||||||
civInfo.policies.tryAddLegalismBuildings()
|
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()
|
expansion.reset()
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user