mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-05 13:08:48 +07:00
Added 'upon gaining/losing [promotionName] promotion' unit trigger uniques - see #3242
This commit is contained in:
parent
916317a048
commit
980126ff06
@ -75,6 +75,10 @@ class UnitPromotions : IsPartOfGameInfoSerialization {
|
||||
|
||||
for (unique in unit.getTriggeredUniques(UniqueType.TriggerUponPromotion))
|
||||
UniqueTriggerActivation.triggerUnique(unique, unit)
|
||||
|
||||
for (unique in promotion.getMatchingUniques(UniqueType.TriggerUponPromotionGain))
|
||||
if (unique.params[0] == promotionName)
|
||||
UniqueTriggerActivation.triggerUnique(unique, unit)
|
||||
}
|
||||
|
||||
if (!promotion.hasUnique(UniqueType.SkipPromotion))
|
||||
@ -100,6 +104,10 @@ class UnitPromotions : IsPartOfGameInfoSerialization {
|
||||
promotions.remove(promotionName)
|
||||
unit.updateUniques()
|
||||
unit.updateVisibleTiles()
|
||||
|
||||
for (unique in unit.getMatchingUniques(UniqueType.TriggerUponPromotionLoss))
|
||||
if (unique.params[0] == promotionName)
|
||||
UniqueTriggerActivation.triggerUnique(unique, unit)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -918,6 +918,8 @@ enum class UniqueType(
|
||||
TriggerUponExpendingUnit("upon expending a [mapUnitFilter] unit", UniqueTarget.UnitTriggerCondition),
|
||||
TriggerUponDefeat("upon being defeated", UniqueTarget.UnitTriggerCondition),
|
||||
TriggerUponPromotion("upon being promoted", UniqueTarget.UnitTriggerCondition),
|
||||
TriggerUponPromotionGain("upon gaining the [promotion] promotion", UniqueTarget.UnitTriggerCondition),
|
||||
TriggerUponPromotionLoss("upon losing the [promotion] promotion", UniqueTarget.UnitTriggerCondition),
|
||||
TriggerUponLosingHealth("upon losing at least [amount] HP in a single attack", UniqueTarget.UnitTriggerCondition),
|
||||
TriggerUponEndingTurnInTile("upon ending a turn in a [tileFilter] tile", UniqueTarget.UnitTriggerCondition),
|
||||
TriggerUponDiscoveringTile("upon discovering a [tileFilter] tile", UniqueTarget.UnitTriggerCondition),
|
||||
|
Loading…
Reference in New Issue
Block a user