mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-25 02:16:06 +07:00
Added building trigger with city filter
This commit is contained in:
parent
239a6e238f
commit
d07c77fa2b
@ -442,10 +442,17 @@ class CityConstructions : IsPartOfGameInfoSerialization {
|
||||
}
|
||||
}
|
||||
|
||||
if (construction is Building)
|
||||
if (construction is Building){
|
||||
for (unique in cityInfo.civInfo.getTriggeredUniques(UniqueType.TriggerUponConstructingBuilding, StateForConditionals(cityInfo.civInfo, cityInfo)))
|
||||
if (unique.conditionals.any {it.type == UniqueType.TriggerUponConstructingBuilding && construction.matchesFilter(it.params[0])})
|
||||
UniqueTriggerActivation.triggerCivwideUnique(unique, cityInfo.civInfo, cityInfo)
|
||||
|
||||
for (unique in cityInfo.civInfo.getTriggeredUniques(UniqueType.TriggerUponConstructingBuildingCityFilter, StateForConditionals(cityInfo.civInfo, cityInfo)))
|
||||
if (unique.conditionals.any {it.type == UniqueType.TriggerUponConstructingBuildingCityFilter
|
||||
&& construction.matchesFilter(it.params[0])
|
||||
&& cityInfo.matchesFilter(it.params[1])})
|
||||
UniqueTriggerActivation.triggerCivwideUnique(unique, cityInfo.civInfo, cityInfo)
|
||||
}
|
||||
}
|
||||
|
||||
fun addBuilding(buildingName: String) {
|
||||
|
@ -706,10 +706,12 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags:
|
||||
TriggerUponEnteringGoldenAge("upon entering a Golden Age", UniqueTarget.TriggerCondition),
|
||||
TriggerUponConqueringCity("upon conquering a city", UniqueTarget.TriggerCondition),
|
||||
TriggerUponConstructingBuilding("upon constructing [buildingFilter]", UniqueTarget.TriggerCondition),
|
||||
// Not auto cityfiltered, since 'in all cities' can be read 'only if it's in all cities'
|
||||
TriggerUponConstructingBuildingCityFilter("upon constructing [buildingFilter] [cityFilter]", UniqueTarget.TriggerCondition),
|
||||
|
||||
TriggerUponFoundingPantheon("upon founding a Pantheon", UniqueTarget.TriggerCondition),
|
||||
TriggerUponFoundingReligion("upon founding a Religion", UniqueTarget.TriggerCondition),
|
||||
TriggerUponEnhancingReligion("upon enahncing a Religion", UniqueTarget.TriggerCondition),
|
||||
TriggerUponEnhancingReligion("upon enhancing a Religion", UniqueTarget.TriggerCondition),
|
||||
|
||||
|
||||
//endregion
|
||||
|
Loading…
Reference in New Issue
Block a user