diff --git a/core/src/com/unciv/logic/map/mapunit/UnitPromotions.kt b/core/src/com/unciv/logic/map/mapunit/UnitPromotions.kt index 3daa0d6b4e..5192aef61b 100644 --- a/core/src/com/unciv/logic/map/mapunit/UnitPromotions.kt +++ b/core/src/com/unciv/logic/map/mapunit/UnitPromotions.kt @@ -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) } } diff --git a/core/src/com/unciv/models/ruleset/unique/UniqueType.kt b/core/src/com/unciv/models/ruleset/unique/UniqueType.kt index 8de66c70d2..7bd9861bf3 100644 --- a/core/src/com/unciv/models/ruleset/unique/UniqueType.kt +++ b/core/src/com/unciv/models/ruleset/unique/UniqueType.kt @@ -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),