diff --git a/core/src/com/unciv/models/ruleset/unique/Unique.kt b/core/src/com/unciv/models/ruleset/unique/Unique.kt index a8576e40f7..ed78c0ed2e 100644 --- a/core/src/com/unciv/models/ruleset/unique/Unique.kt +++ b/core/src/com/unciv/models/ruleset/unique/Unique.kt @@ -318,6 +318,8 @@ class Unique(val text: String, val sourceObjectType: UniqueTarget? = null, val s relevantTile?.matchesFilter(condition.params[0], state.civInfo) == true UniqueType.ConditionalInTilesNot -> relevantTile?.matchesFilter(condition.params[0], state.civInfo) == false + UniqueType.ConditionalAdjacentTo -> relevantTile?.isAdjacentTo(condition.params[0]) == true + UniqueType.ConditionalNotAdjacentTo -> relevantTile?.isAdjacentTo(condition.params[0]) == false UniqueType.ConditionalFightingInTiles -> state.attackedTile?.matchesFilter(condition.params[0], state.civInfo) == true UniqueType.ConditionalInTilesAnd -> diff --git a/core/src/com/unciv/models/ruleset/unique/UniqueType.kt b/core/src/com/unciv/models/ruleset/unique/UniqueType.kt index f380258545..d1908cc766 100644 --- a/core/src/com/unciv/models/ruleset/unique/UniqueType.kt +++ b/core/src/com/unciv/models/ruleset/unique/UniqueType.kt @@ -344,7 +344,7 @@ enum class UniqueType( Strength("[relativeAmount]% Strength", UniqueTarget.Unit, UniqueTarget.Global), StrengthNearCapital("[relativeAmount]% Strength decreasing with distance from the capital", UniqueTarget.Unit, UniqueTarget.Global), FlankAttackBonus("[relativeAmount]% to Flank Attack bonuses", UniqueTarget.Unit, UniqueTarget.Global), - // There's currently no conditional that would allow you strength vs city-state *cities* and that's why this isn't deprecated yet + @Deprecated("as of 4.9.0",ReplaceWith("[+30%]% Strength "), DeprecationLevel.ERROR) StrengthBonusVsCityStates("+30% Strength when fighting City-State units and cities", UniqueTarget.Global), StrengthForAdjacentEnemies("[relativeAmount]% Strength for enemy [combatantFilter] units in adjacent [tileFilter] tiles", UniqueTarget.Unit), StrengthWhenStacked("[relativeAmount]% Strength when stacked with [mapUnitFilter]", UniqueTarget.Unit), // candidate for conditional! @@ -682,7 +682,8 @@ enum class UniqueType( @Deprecated("as of 4.10.3", ReplaceWith("in [{tileFilter} {tileFilter}] tiles")) ConditionalInTilesAnd("in [tileFilter] [tileFilter] tiles", UniqueTarget.Conditional), ConditionalInTilesNot("in tiles without [tileFilter]", UniqueTarget.Conditional), - // TODO: Add adjacency ("in tiles adjacent to [tileFilter]", "in tiles not adjacent to [tileFilter]) + ConditionalAdjacentTo("in tiles adjacent to [tileFilter]", UniqueTarget.Conditional), + ConditionalNotAdjacentTo("in tiles not adjacent to [tileFilter]", UniqueTarget.Conditional), ConditionalNearTiles("within [amount] tiles of a [tileFilter]", UniqueTarget.Conditional), /////// area conditionals diff --git a/docs/Modders/Unique-parameters.md b/docs/Modders/Unique-parameters.md index e89d671d3a..06ed843f32 100644 --- a/docs/Modders/Unique-parameters.md +++ b/docs/Modders/Unique-parameters.md @@ -148,6 +148,12 @@ A filter determining a part of the population of a city. It can be any of the fo - `Unemployed` - `Followers of the Majority Religion` or `Followers of this Religion`, both of which only apply when this religion is the majority religion in that city +## combatantFilter + +Can be any of: +- [mapUnitFilter](#mapunitfilter), for unit combatants +- "City", "All", or [civFilter](#civfilter), for city combatants + ## regionType Used for dividing the world into regions in each of which a single player is placed at the start of the game.