diff --git a/android/assets/jsons/Civ V - Gods & Kings/UnitPromotions.json b/android/assets/jsons/Civ V - Gods & Kings/UnitPromotions.json index 6652f01906..d3b077dcea 100644 --- a/android/assets/jsons/Civ V - Gods & Kings/UnitPromotions.json +++ b/android/assets/jsons/Civ V - Gods & Kings/UnitPromotions.json @@ -756,7 +756,7 @@ }, { "name": "[Hakkapeliitta] ability", - "uniques": ["Transfer Movement to [Great General]", "[+15]% Strength when stacked with [Great General]"] + "uniques": ["Transfer Movement to [Great General]", "[+15]% Strength "] }, { "name": "[Zero] ability", diff --git a/core/src/com/unciv/models/ruleset/unique/Conditionals.kt b/core/src/com/unciv/models/ruleset/unique/Conditionals.kt index a955174aee..ae926e0dae 100644 --- a/core/src/com/unciv/models/ruleset/unique/Conditionals.kt +++ b/core/src/com/unciv/models/ruleset/unique/Conditionals.kt @@ -246,6 +246,8 @@ object Conditionals { UniqueType.ConditionalHasNotUsedOtherActions -> state.unit == null || // So we get the action as a valid action in BaseUnit.hasUnique() state.unit.abilityToTimesUsed.isEmpty() + UniqueType.ConditionalStackedWithUnit -> state.relevantUnit != null && + state.relevantUnit!!.getTile().getUnits().any { it != state.relevantUnit && it.matchesFilter(conditional.params[0]) } UniqueType.ConditionalInTiles -> state.relevantTile?.matchesFilter(conditional.params[0], state.relevantCiv) == true diff --git a/core/src/com/unciv/models/ruleset/unique/UniqueType.kt b/core/src/com/unciv/models/ruleset/unique/UniqueType.kt index 038adbee94..019d719fa9 100644 --- a/core/src/com/unciv/models/ruleset/unique/UniqueType.kt +++ b/core/src/com/unciv/models/ruleset/unique/UniqueType.kt @@ -395,6 +395,7 @@ enum class UniqueType( StrengthNearCapital("[relativeAmount]% Strength decreasing with distance from the capital", UniqueTarget.Unit, UniqueTarget.Global), FlankAttackBonus("[relativeAmount]% to Flank Attack bonuses", UniqueTarget.Unit, UniqueTarget.Global), StrengthForAdjacentEnemies("[relativeAmount]% Strength for enemy [mapUnitFilter] units in adjacent [tileFilter] tiles", UniqueTarget.Unit), + @Deprecated("As of 4.16.14", ReplaceWith("[relativeAmount]% Strength "), DeprecationLevel.WARNING) StrengthWhenStacked("[relativeAmount]% Strength when stacked with [mapUnitFilter]", UniqueTarget.Unit), // candidate for conditional! StrengthBonusInRadius("[relativeAmount]% Strength bonus for [mapUnitFilter] units within [amount] tiles", UniqueTarget.Unit), @@ -787,6 +788,7 @@ enum class UniqueType( ConditionalAboveHP("when above [positiveAmount] HP", UniqueTarget.Conditional), ConditionalBelowHP("when below [positiveAmount] HP", UniqueTarget.Conditional), ConditionalHasNotUsedOtherActions("if it hasn't used other actions yet", UniqueTarget.Conditional), + ConditionalStackedWithUnit("when stacked with a [mapUnitFilter] unit", UniqueTarget.Conditional), /////// tile conditionals ConditionalNeighborTiles("with [nonNegativeAmount] to [nonNegativeAmount] neighboring [tileFilter] tiles", UniqueTarget.Conditional), diff --git a/docs/Modders/uniques.md b/docs/Modders/uniques.md index e34b704cff..5f7642395a 100644 --- a/docs/Modders/uniques.md +++ b/docs/Modders/uniques.md @@ -3205,6 +3205,11 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl ??? example "<if it hasn't used other actions yet>" Applicable to: Conditional +??? example "<when stacked with a [mapUnitFilter] unit>" + Example: "<when stacked with a [Wounded] unit>" + + Applicable to: Conditional + ??? example "<with [nonNegativeAmount] to [nonNegativeAmount] neighboring [tileFilter] tiles>" Example: "<with [3] to [3] neighboring [Farm] tiles>"