From ccfe4386b8b37d151cf1545c13e35ed41ace97f2 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Wed, 9 Feb 2022 12:26:04 +0200 Subject: [PATCH] Unique deprecation --- core/src/com/unciv/logic/battle/Battle.kt | 10 --------- core/src/com/unciv/logic/city/CityStats.kt | 5 ----- .../unciv/models/ruleset/unique/UniqueType.kt | 22 +++++++++---------- 3 files changed, 11 insertions(+), 26 deletions(-) diff --git a/core/src/com/unciv/logic/battle/Battle.kt b/core/src/com/unciv/logic/battle/Battle.kt index 8841d1bcad..a93a7c3f81 100644 --- a/core/src/com/unciv/logic/battle/Battle.kt +++ b/core/src/com/unciv/logic/battle/Battle.kt @@ -429,16 +429,6 @@ object Battle { for (unique in thisCombatant.getMatchingUniques(UniqueType.FlatXPGain, stateForConditionals, true)) baseXP += unique.params[0].toInt() - var xpModifier = 1f - // Deprecated since 3.18.12 - for (unique in thisCombatant.getCivInfo().getMatchingUniques(UniqueType.BonusXPGainForUnits, stateForConditionals)) { - if (thisCombatant.unit.matchesFilter(unique.params[0])) - xpModifier += unique.params[1].toFloat() / 100 - } - for (unique in thisCombatant.getMatchingUniques(UniqueType.BonuxXPGain, stateForConditionals, true)) - xpModifier += unique.params[0].toFloat() / 100 - // - for (unique in thisCombatant.getMatchingUniques(UniqueType.PercentageXPGain, stateForConditionals, true)) xpModifier += unique.params[0].toFloat() / 100 diff --git a/core/src/com/unciv/logic/city/CityStats.kt b/core/src/com/unciv/logic/city/CityStats.kt index 5e27492921..dca7d63693 100644 --- a/core/src/com/unciv/logic/city/CityStats.kt +++ b/core/src/com/unciv/logic/city/CityStats.kt @@ -243,11 +243,6 @@ class CityStats(val cityInfo: CityInfo) { if (cityInfo.getCenterTile().matchesTerrainFilter(unique.params[1])) addUniqueStats(unique) - // Deprecated since 3.18.14 - for (unique in cityInfo.getMatchingUniques(UniqueType.StatsFromCitiesBefore)) - if (!cityInfo.civInfo.hasTechOrPolicy(unique.params[1])) - addUniqueStats(unique) - // return sourceToStats } diff --git a/core/src/com/unciv/models/ruleset/unique/UniqueType.kt b/core/src/com/unciv/models/ruleset/unique/UniqueType.kt index 216262bdf0..8b1d3ab454 100644 --- a/core/src/com/unciv/models/ruleset/unique/UniqueType.kt +++ b/core/src/com/unciv/models/ruleset/unique/UniqueType.kt @@ -75,8 +75,6 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags: StatsFromXPopulation("[stats] in cities with [amount] or more population", UniqueTarget.Global, UniqueTarget.FollowerBelief), StatsFromCitiesOnSpecificTiles("[stats] in cities on [terrainFilter] tiles", UniqueTarget.Global, UniqueTarget.FollowerBelief), - @Deprecated("as of 3.18.14", ReplaceWith("[stats] [in all cities] OR [stats] [in all cities] ")) - StatsFromCitiesBefore("[stats] per turn from cities before [tech/policy]", UniqueTarget.Global, UniqueTarget.FollowerBelief), StatsFromBuildings("[stats] from all [buildingFilter] buildings", UniqueTarget.Global, UniqueTarget.FollowerBelief), @Deprecated("as of 3.19.1", ReplaceWith("[stats] from every [Wonder]")) StatsFromWondersDeprecated("[stats] from every Wonder", UniqueTarget.Global, UniqueTarget.FollowerBelief), @@ -432,15 +430,6 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags: ReligiousUnit("Religious Unit", UniqueTarget.Unit), SpaceshipPart("Spaceship part", UniqueTarget.Building, UniqueTarget.Unit), - - @Deprecated("as of 3.18.12", ReplaceWith("[amount]% XP gained from combat"), DeprecationLevel.WARNING) - BonuxXPGain("[amount]% Bonus XP gain", UniqueTarget.Unit), - @Deprecated("as of 3.18.12", ReplaceWith("[amount]% XP gained from combat "), DeprecationLevel.WARNING) - BonusXPGainForUnits("[mapUnitFilter] units gain [amount]% more Experience from combat", UniqueTarget.Global), - - @Deprecated("as of 3.18.14", ReplaceWith("[amount]% maintenance costs "), DeprecationLevel.WARNING) - UnitMaintenanceDiscountGlobal("[amount]% maintenance costs for [mapUnitFilter] units", UniqueTarget.Global), - //endregion @@ -646,6 +635,17 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags: // endregion // region DEPRECATED AND REMOVED + @Deprecated("as of 3.18.14", ReplaceWith("[stats] [in all cities] OR [stats] [in all cities] ")) + StatsFromCitiesBefore("[stats] per turn from cities before [tech/policy]", UniqueTarget.Global, UniqueTarget.FollowerBelief), + + @Deprecated("as of 3.18.12", ReplaceWith("[amount]% XP gained from combat"), DeprecationLevel.WARNING) + BonuxXPGain("[amount]% Bonus XP gain", UniqueTarget.Unit), + @Deprecated("as of 3.18.12", ReplaceWith("[amount]% XP gained from combat "), DeprecationLevel.WARNING) + BonusXPGainForUnits("[mapUnitFilter] units gain [amount]% more Experience from combat", UniqueTarget.Global), + + @Deprecated("as of 3.18.14", ReplaceWith("[amount]% maintenance costs "), DeprecationLevel.WARNING) + UnitMaintenanceDiscountGlobal("[amount]% maintenance costs for [mapUnitFilter] units", UniqueTarget.Global), + @Deprecated("as of 3.18.2", ReplaceWith("[50]% of excess happiness converted to [Culture]"), DeprecationLevel.ERROR) ExcessHappinessToCultureDeprecated("50% of excess happiness added to culture towards policies", UniqueTarget.Global), @Deprecated("as of 3.16.11", ReplaceWith("Not displayed as an available construction without [buildingName]"), DeprecationLevel.ERROR)