mirror of
https://github.com/yairm210/Unciv.git
synced 2025-03-09 04:09:35 +07:00
Add MovedToNewCapital buiding unique (#11213)
* Added MovedToNewCapital building unique Yet to be tested * Applied the suggestions Of @yairm210 and @SomeTroglodyte
This commit is contained in:
parent
61972cd50e
commit
2d1e55a4d4
@ -866,6 +866,22 @@ class Civilization : IsPartOfGameInfoSerialization {
|
||||
// move new capital
|
||||
city.cityConstructions.addBuilding(city.capitalCityIndicator())
|
||||
city.isBeingRazed = false // stop razing the new capital if it was being razed
|
||||
|
||||
// move the buildings with MovedToNewCapital unique
|
||||
if (oldCapital != null) {
|
||||
// Get the Set of the buildings to move
|
||||
val buildingsToMove = oldCapital.cityConstructions.getBuiltBuildings().filter {
|
||||
it.hasUnique(UniqueType.MovesToNewCapital)
|
||||
}.toSet()
|
||||
|
||||
// Remove the buildings from old capital
|
||||
oldCapital.cityConstructions.removeBuildings(buildingsToMove)
|
||||
|
||||
// Add the buildings to new capital
|
||||
buildingsToMove.forEach {
|
||||
city.cityConstructions.addBuilding(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
oldCapital?.cityConstructions?.removeBuilding(oldCapital.capitalCityIndicator())
|
||||
}
|
||||
|
@ -305,6 +305,7 @@ enum class UniqueType(
|
||||
Unsellable("Unsellable", UniqueTarget.Building),
|
||||
ObsoleteWith("Obsolete with [tech]", UniqueTarget.Building, UniqueTarget.Resource, UniqueTarget.Improvement),
|
||||
IndicatesCapital("Indicates the capital city", UniqueTarget.Building),
|
||||
MovesToNewCapital("Moves to new capital when capital changes", UniqueTarget.Building),
|
||||
ProvidesExtraLuxuryFromCityResources("Provides 1 extra copy of each improved luxury resource near this City", UniqueTarget.Building),
|
||||
|
||||
DestroyedWhenCityCaptured("Destroyed when the city is captured", UniqueTarget.Building),
|
||||
|
@ -1126,6 +1126,9 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl
|
||||
??? example "Indicates the capital city"
|
||||
Applicable to: Building
|
||||
|
||||
??? example "Moved to the new capital"
|
||||
Applicable to: Building
|
||||
|
||||
??? example "Provides 1 extra copy of each improved luxury resource near this City"
|
||||
Applicable to: Building
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user