From 197ec9dc9a531cd96309a0b636d33f0ef111929c Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Thu, 25 Jan 2024 20:04:15 +0200 Subject: [PATCH] Returned deprecated StrengthBonusVsCityStates to work for the usual transitional period --- core/src/com/unciv/logic/battle/BattleDamage.kt | 6 ++++++ core/src/com/unciv/models/ruleset/unique/UniqueType.kt | 2 +- docs/Modders/Unique-parameters.md | 4 +++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/core/src/com/unciv/logic/battle/BattleDamage.kt b/core/src/com/unciv/logic/battle/BattleDamage.kt index 839366925c..7e36530da1 100644 --- a/core/src/com/unciv/logic/battle/BattleDamage.kt +++ b/core/src/com/unciv/logic/battle/BattleDamage.kt @@ -109,6 +109,12 @@ object BattleDamage { if (strengthMalus != null) { modifiers.add("Adjacent enemy units", strengthMalus.params[0].toInt()) } + + // e.g., Mongolia - https://civilization.fandom.com/wiki/Mongolian_(Civ5) + if (enemy.getCivInfo().isCityState() + && civInfo.hasUnique(UniqueType.StrengthBonusVsCityStates) + ) + modifiers["vs [City-States]"] = 30 } private fun addResourceLackingMalus(combatant: MapUnitCombatant, modifiers: Counter) { diff --git a/core/src/com/unciv/models/ruleset/unique/UniqueType.kt b/core/src/com/unciv/models/ruleset/unique/UniqueType.kt index 224e2c5729..461bff1294 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), - @Deprecated("as of 4.9.0",ReplaceWith("[+30]% Strength "), DeprecationLevel.ERROR) + @Deprecated("as of 4.10.3", ReplaceWith("[+30]% Strength ")) 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! diff --git a/docs/Modders/Unique-parameters.md b/docs/Modders/Unique-parameters.md index 06ed843f32..70860cf053 100644 --- a/docs/Modders/Unique-parameters.md +++ b/docs/Modders/Unique-parameters.md @@ -152,7 +152,9 @@ A filter determining a part of the population of a city. It can be any of the fo Can be any of: - [mapUnitFilter](#mapunitfilter), for unit combatants -- "City", "All", or [civFilter](#civfilter), for city combatants +- `City`, `All`, or [civFilter](#civfilter), for city combatants + +Since mapUnitFilter contains civFilter, that means civFilter can be applied to combatantFilter for both units and cities. ## regionType