Buildings that provide free buildings (e.g. The Great Library) now deal with civ uniques (e.g. Paper Maker)

This commit is contained in:
Yair Morgenstern 2018-11-27 23:50:08 +02:00
parent 324176d098
commit de4c042dd5

View file

@ -216,8 +216,16 @@ class Building : NamedStats(), IConstruction{
}
construction.addBuilding(name)
if (providesFreeBuilding != null && !construction.builtBuildings.contains(providesFreeBuilding!!))
construction.addBuilding(providesFreeBuilding!!)
if (providesFreeBuilding != null && !construction.containsBuildingOrEquivalent(providesFreeBuilding!!)) {
var buildingToAdd = providesFreeBuilding!!
for(building in GameBasics.Buildings.values)
if(building.replaces == buildingToAdd && building.uniqueTo==civInfo.civName)
buildingToAdd = building.name
construction.addBuilding(buildingToAdd)
}
when {
"Empire enters golden age" in uniques-> civInfo.goldenAges.enterGoldenAge()
"Free Great Artist Appears" in uniques-> civInfo.addGreatPerson("Great Artist")