From 4f897d9cc1ab9098a5323fda5681e7b4d9fd6061 Mon Sep 17 00:00:00 2001 From: yairm210 Date: Sun, 31 Oct 2021 22:54:23 +0200 Subject: [PATCH] Fully deprecated older uniques --- core/src/com/unciv/logic/map/MapUnit.kt | 14 ------------- .../unciv/models/ruleset/unique/UniqueType.kt | 20 +++++++++---------- .../com/unciv/models/ruleset/unit/BaseUnit.kt | 6 ------ 3 files changed, 10 insertions(+), 30 deletions(-) diff --git a/core/src/com/unciv/logic/map/MapUnit.kt b/core/src/com/unciv/logic/map/MapUnit.kt index 961fa09493..d1d82c9860 100644 --- a/core/src/com/unciv/logic/map/MapUnit.kt +++ b/core/src/com/unciv/logic/map/MapUnit.kt @@ -259,20 +259,6 @@ class MapUnit { roughTerrainPenalty = hasUnique(UniqueType.RoughTerrainPenalty) doubleMovementInTerrain.clear() - // Cache the deprecated uniques - if (hasUnique(UniqueType.DoubleMovementCoast)) { - doubleMovementInTerrain[Constants.coast] = DoubleMovementTerrainTarget.Base - } - if (hasUnique(UniqueType.DoubleMovementForestJungle)) { - doubleMovementInTerrain[Constants.forest] = DoubleMovementTerrainTarget.Feature - doubleMovementInTerrain[Constants.jungle] = DoubleMovementTerrainTarget.Feature - } - if (hasUnique(UniqueType.DoubleMovementSnowTundraHill)) { - doubleMovementInTerrain[Constants.snow] = DoubleMovementTerrainTarget.Base - doubleMovementInTerrain[Constants.tundra] = DoubleMovementTerrainTarget.Base - doubleMovementInTerrain[Constants.hill] = DoubleMovementTerrainTarget.Feature - } - // Now the current unique for (unique in getMatchingUniques(UniqueType.DoubleMovementOnTerrain)) { val param = unique.params[0] val terrain = ruleset.terrains[param] diff --git a/core/src/com/unciv/models/ruleset/unique/UniqueType.kt b/core/src/com/unciv/models/ruleset/unique/UniqueType.kt index 1208800906..a3a0ca9dec 100644 --- a/core/src/com/unciv/models/ruleset/unique/UniqueType.kt +++ b/core/src/com/unciv/models/ruleset/unique/UniqueType.kt @@ -131,7 +131,7 @@ enum class UniqueType(val text:String, vararg targets: UniqueTarget) { UnitMaintenanceDiscount("[amount]% maintenance costs for [mapUnitFilter] units", UniqueTarget.Global), @Deprecated("As of 3.16.16 - removed as of 3.17.11", ReplaceWith("[amount]% maintenance costs for [mapUnitFilter] units"), DeprecationLevel.ERROR) DecreasedUnitMaintenanceCostsByFilter("-[amount]% [mapUnitFilter] unit maintenance costs", UniqueTarget.Global), - @Deprecated("As of 3.16.16", ReplaceWith("[amount]% maintenance costs for [mapUnitFilter] units"), DeprecationLevel.ERROR) + @Deprecated("As of 3.16.16 - removed as of 3.17.11", ReplaceWith("[amount]% maintenance costs for [mapUnitFilter] units"), DeprecationLevel.ERROR) DecreasedUnitMaintenanceCostsGlobally("-[amount]% unit upkeep costs", UniqueTarget.Global), ConsumesResources("Consumes [amount] [resource]", UniqueTarget.Improvement, UniqueTarget.Building, UniqueTarget.Unit), @@ -140,7 +140,7 @@ enum class UniqueType(val text:String, vararg targets: UniqueTarget) { GrowthPercentBonus("[amount]% growth [cityFilter]", UniqueTarget.Global, UniqueTarget.FollowerBelief), @Deprecated("As of 3.16.14 - removed as of 3.17.11", ReplaceWith("[amount]% growth [cityFilter]"), DeprecationLevel.ERROR) GrowthPercentBonusPositive("+[amount]% growth [cityFilter]", UniqueTarget.Global), - @Deprecated("As of 3.16.14", ReplaceWith("[amount]% growth [cityFilter] "), DeprecationLevel.ERROR) + @Deprecated("As of 3.16.14 - removed as of 3.17.11", ReplaceWith("[amount]% growth [cityFilter] "), DeprecationLevel.ERROR) GrowthPercentBonusWhenNotAtWar("+[amount]% growth [cityFilter] when not at war", UniqueTarget.Global), GainFreeBuildings("Gain a free [buildingName] [cityFilter]", UniqueTarget.Global), @@ -194,15 +194,15 @@ enum class UniqueType(val text:String, vararg targets: UniqueTarget) { Strength("[amount]% Strength", UniqueTarget.Unit, UniqueTarget.Global), StrengthNearCapital("[amount]% Strength decreasing with distance from the capital", UniqueTarget.Unit), - @Deprecated("As of 3.17.3", ReplaceWith("[amount]% Strength"), DeprecationLevel.WARNING) + @Deprecated("As of 3.17.3 - removed as of 3.17.13", ReplaceWith("[amount]% Strength"), DeprecationLevel.ERROR) StrengthPlus("+[amount]% Strength", UniqueTarget.Unit), - @Deprecated("As of 3.17.3", ReplaceWith("[amount]% Strength"), DeprecationLevel.WARNING) + @Deprecated("As of 3.17.3 - removed as of 3.17.13", ReplaceWith("[amount]% Strength"), DeprecationLevel.ERROR) StrengthMin("-[amount]% Strength", UniqueTarget.Unit), - @Deprecated("As of 3.17.3", ReplaceWith("[amount]% Strength /"), DeprecationLevel.WARNING) + @Deprecated("As of 3.17.3 - removed as of 3.17.13", ReplaceWith("[amount]% Strength /"), DeprecationLevel.ERROR) StrengthPlusVs("+[amount]% Strength vs [combatantFilter]", UniqueTarget.Unit), - @Deprecated("As of 3.17.3", ReplaceWith("[amount]% Strength /"), DeprecationLevel.WARNING) + @Deprecated("As of 3.17.3 - removed as of 3.17.13", ReplaceWith("[amount]% Strength /"), DeprecationLevel.ERROR) StrengthMinVs("-[amount]% Strength vs [combatantFilter]", UniqueTarget.Unit), - @Deprecated("As of 3.17.3", ReplaceWith("[amount]% Strength"), DeprecationLevel.WARNING) + @Deprecated("As of 3.17.3 - removed as of 3.17.13", ReplaceWith("[amount]% Strength"), DeprecationLevel.ERROR) CombatBonus("+[amount]% Combat Strength", UniqueTarget.Unit), @Deprecated("As of 3.17.5", ReplaceWith("[amount]% Strength "), DeprecationLevel.WARNING) StrengthAttacking("+[amount]% Strength when attacking", UniqueTarget.Unit), @@ -260,11 +260,11 @@ enum class UniqueType(val text:String, vararg targets: UniqueTarget) { // The following block gets cached in MapUnit for faster getMovementCostBetweenAdjacentTiles DoubleMovementOnTerrain("Double movement in [terrainFilter]", UniqueTarget.Unit), - @Deprecated("As of 3.17.1", ReplaceWith("Double movement in [terrainFilter]"), DeprecationLevel.WARNING) + @Deprecated("As of 3.17.1 - removed as of 3.17.13", ReplaceWith("Double movement in [terrainFilter]"), DeprecationLevel.ERROR) DoubleMovementCoast("Double movement in coast", UniqueTarget.Unit), - @Deprecated("As of 3.17.1", ReplaceWith("Double movement in [terrainFilter]"), DeprecationLevel.WARNING) + @Deprecated("As of 3.17.1 - removed as of 3.17.13", ReplaceWith("Double movement in [terrainFilter]"), DeprecationLevel.ERROR) DoubleMovementForestJungle("Double movement rate through Forest and Jungle", UniqueTarget.Unit), - @Deprecated("As of 3.17.1", ReplaceWith("Double movement in [terrainFilter]"), DeprecationLevel.WARNING) + @Deprecated("As of 3.17.1 - removed as of 3.17.13", ReplaceWith("Double movement in [terrainFilter]"), DeprecationLevel.ERROR) DoubleMovementSnowTundraHill("Double movement in Snow, Tundra and Hills", UniqueTarget.Unit), AllTilesCost1Move("All tiles cost 1 movement", UniqueTarget.Unit), CanPassImpassable("Can pass through impassable tiles", UniqueTarget.Unit), diff --git a/core/src/com/unciv/models/ruleset/unit/BaseUnit.kt b/core/src/com/unciv/models/ruleset/unit/BaseUnit.kt index 6bffdf2ad8..472b23ef66 100644 --- a/core/src/com/unciv/models/ruleset/unit/BaseUnit.kt +++ b/core/src/com/unciv/models/ruleset/unit/BaseUnit.kt @@ -662,12 +662,6 @@ class BaseUnit : RulesetObject(), INonPerpetualConstruction { unique.isOfType(UniqueType.StrengthNearCapital) && unique.params[0].toInt() > 0 -> power *= (unique.params[0].toInt() / 4f).toPercent() // Bonus decreasing with distance from capital - not worth much most of the map??? - // Deprecated since 3.17.3 - unique.isOfType(UniqueType.StrengthPlusVs) && unique.params[1] == "City" // City Attack - half the bonus - -> power += (power * unique.params[0].toInt()) / 200 - unique.isOfType(UniqueType.StrengthPlusVs) && unique.params[1] != "City" // Bonus vs something else - a quarter of the bonus - -> power += (power * unique.params[0].toInt()) / 400 - // // Deprecated since 3.17.4 unique.isOfType(UniqueType.StrengthAttacking) // Attack - half the bonus -> power += (power * unique.params[0].toInt()) / 200