mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-07 14:02:48 +07:00
Add the SellBuilding Unique (#10514)
* Restored the SellBuilding Unique * Rephrased SellBuilding unique
This commit is contained in:
parent
1744d1271f
commit
e67fd6a28b
@ -687,6 +687,26 @@ object UniqueTriggerActivation {
|
||||
return true
|
||||
}
|
||||
|
||||
UniqueType.SellBuilding -> {
|
||||
|
||||
val applicableCities = civInfo.cities.asSequence().filter {
|
||||
it.matchesFilter(unique.params[1])
|
||||
}
|
||||
|
||||
for (applicableCity in applicableCities) {
|
||||
val buildingsToSell = applicableCity.cityConstructions.getBuiltBuildings().filter {
|
||||
it.matchesFilter(unique.params[0]) && it.isSellable()
|
||||
}
|
||||
|
||||
for (building in buildingsToSell) {
|
||||
applicableCity.sellBuilding(building)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
else -> {}
|
||||
}
|
||||
return false
|
||||
|
@ -133,6 +133,7 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags:
|
||||
GainFreeBuildings("Gain a free [buildingName] [cityFilter]", UniqueTarget.Global, UniqueTarget.Triggerable),
|
||||
BuildingMaintenance("[relativeAmount]% maintenance cost for buildings [cityFilter]", UniqueTarget.Global, UniqueTarget.FollowerBelief),
|
||||
RemoveBuilding("Remove [buildingFilter] [cityFilter]", UniqueTarget.Global, UniqueTarget.Triggerable),
|
||||
SellBuilding("Sell [buildingFilter] buildings [cityFilter]", UniqueTarget.Global, UniqueTarget.Triggerable),
|
||||
|
||||
/// Border growth
|
||||
BorderGrowthPercentage("[relativeAmount]% Culture cost of natural border growth [cityFilter]", UniqueTarget.Global, UniqueTarget.FollowerBelief),
|
||||
|
@ -18,6 +18,11 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl
|
||||
|
||||
Applicable to: Triggerable, Global
|
||||
|
||||
??? example "Sell [buildingFilter] [cityFilter]"
|
||||
Example: "Sell [Culture] [in all cities]"
|
||||
|
||||
Applicable to: Triggerable, Global
|
||||
|
||||
??? example "Free [unit] appears"
|
||||
Example: "Free [Musketman] appears"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user