mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-20 18:06:25 -04:00
Stacked with unit conditional unique (#13406)
* Added Stacked With Unit unique * Deprecated the old unique * Fixed a typo in Deprecated annotation * Added the exception of relevant unit * Replaced the old unique in ruleset * Added the missing + sign * Update android/assets/jsons/Civ V - Gods & Kings/UnitPromotions.json * Update core/src/com/unciv/models/ruleset/unique/UniqueType.kt * Swapped the conditions order --------- Co-authored-by: Yair Morgenstern <yairm210@hotmail.com>
This commit is contained in:
parent
f39f81d704
commit
686180fe4f
@ -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 <when stacked with a [Great General] unit>"]
|
||||
},
|
||||
{
|
||||
"name": "[Zero] ability",
|
||||
|
@ -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
|
||||
|
@ -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 <when stacked with a [mapUnitFilter] unit>"), 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),
|
||||
|
@ -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>"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user