diff --git a/core/src/com/unciv/logic/GameInfo.kt b/core/src/com/unciv/logic/GameInfo.kt index 3629eac570..b1ad5f6ed2 100644 --- a/core/src/com/unciv/logic/GameInfo.kt +++ b/core/src/com/unciv/logic/GameInfo.kt @@ -6,7 +6,6 @@ import com.unciv.logic.automation.NextTurnAutomation import com.unciv.logic.city.CityConstructions import com.unciv.logic.city.PerpetualConstruction import com.unciv.logic.civilization.* -import com.unciv.logic.map.MapSizeNew import com.unciv.logic.map.TileInfo import com.unciv.logic.map.TileMap import com.unciv.models.metadata.GameParameters @@ -278,12 +277,6 @@ class GameInfo { if (currentPlayer == "") currentPlayer = civilizations.first { it.isPlayerCivilization() }.civName currentPlayerCiv = getCivilization(currentPlayer) - // as of version 3.9.18, added new custom map size - // empty mapSize name and non-custom map type means - it is old style map size, - // therefore we need to create new mapSize property - if (tileMap.mapParameters.mapSize.name == "" && tileMap.mapParameters.type != Constants.custom) - tileMap.mapParameters.mapSize = MapSizeNew(tileMap.mapParameters.size.name) - // this is separated into 2 loops because when we activate updateVisibleTiles in civ.setTransients, // we try to find new civs, and we check if civ is barbarian, which we can't know unless the gameInfo is already set. for (civInfo in civilizations) civInfo.gameInfo = this diff --git a/core/src/com/unciv/logic/battle/BattleDamage.kt b/core/src/com/unciv/logic/battle/BattleDamage.kt index 8b140879b6..ebbeec4c6c 100644 --- a/core/src/com/unciv/logic/battle/BattleDamage.kt +++ b/core/src/com/unciv/logic/battle/BattleDamage.kt @@ -98,11 +98,6 @@ object BattleDamage { if (enemy.getCivInfo().isBarbarian()) { modifiers["Difficulty"] = (civInfo.gameInfo.getDifficulty().barbarianBonus * 100).toInt() - // Deprecated since 3.14.17 - if (civInfo.hasUnique("+25% bonus vs Barbarians")) { - modifiers["vs Barbarians (deprecated)"] = 25 - } - // } return modifiers diff --git a/core/src/com/unciv/logic/city/CityConstructions.kt b/core/src/com/unciv/logic/city/CityConstructions.kt index 839978d12a..2e1177a588 100644 --- a/core/src/com/unciv/logic/city/CityConstructions.kt +++ b/core/src/com/unciv/logic/city/CityConstructions.kt @@ -84,9 +84,6 @@ class CityConstructions { "[] per [] population []" -> if (cityInfo.matchesFilter(unique.params[2])) stats.add(unique.stats.times(cityInfo.population.population / unique.params[1].toFloat())) "[] once [] is discovered" -> if (cityInfo.civInfo.tech.isResearched(unique.params[1])) stats.add(unique.stats) - // Deprecated since 3.14.17, left for modding compatibility - "[] Per [] Population in this city" -> - stats.add(unique.stats.times(cityInfo.population.population / unique.params[1].toFloat())) } return stats diff --git a/core/src/com/unciv/logic/map/MapParameters.kt b/core/src/com/unciv/logic/map/MapParameters.kt index 5c5749da88..07279bd751 100644 --- a/core/src/com/unciv/logic/map/MapParameters.kt +++ b/core/src/com/unciv/logic/map/MapParameters.kt @@ -120,8 +120,6 @@ class MapParameters { var name = "" var type = MapType.pangaea var shape = MapShape.hexagonal - @Deprecated("replaced by mapSize since 3.14.7") - var size = MapSize.Medium var mapSize = MapSizeNew(MapSize.Medium) var noRuins = false var noNaturalWonders = false diff --git a/core/src/com/unciv/logic/map/MapUnit.kt b/core/src/com/unciv/logic/map/MapUnit.kt index b8c7706c48..3731a8c8b1 100644 --- a/core/src/com/unciv/logic/map/MapUnit.kt +++ b/core/src/com/unciv/logic/map/MapUnit.kt @@ -146,11 +146,6 @@ class MapUnit { // Deprecated since 3.15.6 movement += getUniques().count { it.text == "+1 Movement" } // - // Deprecated since 3.14.17 - if (type.isMilitary() && type.isWaterUnit() && civInfo.hasUnique("All military naval units receive +1 movement and +1 sight")) { - movement += 1 - } - // for (unique in civInfo.getMatchingUniques("+[] Movement for all [] units")) if (matchesFilter(unique.params[1])) @@ -224,11 +219,7 @@ class MapUnit { if (civInfo.hasUnique("+1 Sight for all land military units") && type.isMilitary() && type.isLandUnit()) visibilityRange += 1 // - - // Deprecated since 3.14.17 - if (type.isMilitary() && type.isWaterUnit() && civInfo.hasUnique("All military naval units receive +1 movement and +1 sight")) - visibilityRange += 1 - // + for (unique in getTile().getAllTerrains().flatMap { it.uniqueObjects }) if (unique.placeholderText == "[] Sight for [] units" && matchesFilter(unique.params[1])) diff --git a/core/src/com/unciv/logic/map/TileInfo.kt b/core/src/com/unciv/logic/map/TileInfo.kt index 68a442d644..d45e47e01d 100644 --- a/core/src/com/unciv/logic/map/TileInfo.kt +++ b/core/src/com/unciv/logic/map/TileInfo.kt @@ -165,17 +165,9 @@ open class TileInfo { // and the toSequence so that aggregations (like neighbors.flatMap{it.units} don't take up their own space fun getHeight(): Int { - if (ruleset.terrains.values.asSequence().flatMap { it.uniqueObjects } - .any { it.placeholderText == "Has an elevation of [] for visibility calculations" }) - return getAllTerrains().flatMap { it.uniqueObjects } - .filter { it.placeholderText == "Has an elevation of [] for visibility calculations" } - .map { it.params[0].toInt() }.sum() - - // Old method - deprecated 3.14.7 - if (baseTerrain == Constants.mountain) return 4 - if (isHill()) return 2 - if (terrainFeatures.contains(Constants.forest) || terrainFeatures.contains(Constants.jungle)) return 1 - return 0 + return getAllTerrains().flatMap { it.uniqueObjects } + .filter { it.placeholderText == "Has an elevation of [] for visibility calculations" } + .map { it.params[0].toInt() }.sum() } fun getBaseTerrain(): Terrain = baseTerrainObject diff --git a/core/src/com/unciv/models/ruleset/Building.kt b/core/src/com/unciv/models/ruleset/Building.kt index d177bfe99c..09629c19d2 100644 --- a/core/src/com/unciv/models/ruleset/Building.kt +++ b/core/src/com/unciv/models/ruleset/Building.kt @@ -469,8 +469,6 @@ class Building : NamedStats(), IConstruction { if (get(stat) > 0) return true if (getStatPercentageBonuses(null).get(stat) > 0) return true if (uniqueObjects.any { it.placeholderText == "[] per [] population []" && it.stats.get(stat) > 0 }) return true - // Deprecated since 3.14.17, left for modding compatibility - if (uniqueObjects.any { it.placeholderText == "[] Per [] Population in this city"}) return true return false } diff --git a/core/src/com/unciv/models/ruleset/tile/Terrain.kt b/core/src/com/unciv/models/ruleset/tile/Terrain.kt index 17a4cd8985..cd2f23cfcc 100644 --- a/core/src/com/unciv/models/ruleset/tile/Terrain.kt +++ b/core/src/com/unciv/models/ruleset/tile/Terrain.kt @@ -36,14 +36,7 @@ class Terrain : NamedStats() { var defenceBonus:Float = 0f var impassable = false - /** Use isRough() instead */ - @Deprecated("As of 3.14.1") - var rough = false - - fun isRough(): Boolean { - // "rough" property deprecated since 3.14.1 - return uniques.contains("Rough terrain") || rough - } + fun isRough(): Boolean = uniques.contains("Rough terrain") fun getColor(): Color { // Can't be a lazy initialize, because we play around with the resulting color with lerp()s and the like if (RGB == null) return Color.GOLD diff --git a/core/src/com/unciv/models/ruleset/tile/TileImprovement.kt b/core/src/com/unciv/models/ruleset/tile/TileImprovement.kt index 3c904683fe..0708c86bc3 100644 --- a/core/src/com/unciv/models/ruleset/tile/TileImprovement.kt +++ b/core/src/com/unciv/models/ruleset/tile/TileImprovement.kt @@ -11,19 +11,11 @@ import kotlin.math.roundToInt class TileImprovement : NamedStats() { var terrainsCanBeBuiltOn: Collection = ArrayList() - - // Used only for Camp - but avoid hardcoded comparison and *allow modding* - // Terrain Features that need not be cleared if the improvement enables a resource - @Deprecated("As of 3.14.15") - var resourceTerrainAllow: Collection = ArrayList() - var techRequired: String? = null - var uniqueTo:String? = null var uniques = ArrayList() val uniqueObjects:List by lazy { uniques.map { Unique(it) } } val shortcutKey: Char? = null - val turnsToBuild: Int = 0 // This is the base cost. fun getTurnsToBuild(civInfo: CivilizationInfo): Int { @@ -78,9 +70,7 @@ class TileImprovement : NamedStats() { /** * Check: Is this improvement allowed on a [given][name] terrain feature? - * - * Uses both _legacy_ [resourceTerrainAllow] and unique "Does not need removal of []" - * + * * Background: This not used for e.g. a lumbermill - it derives the right to be placed on forest * from [terrainsCanBeBuiltOn]. Other improvements may be candidates without fulfilling the * [terrainsCanBeBuiltOn] check - e.g. they are listed by a resource as 'their' improvement. @@ -89,7 +79,6 @@ class TileImprovement : NamedStats() { * a terrain feature, thus the unique name. */ fun isAllowedOnFeature(name: String): Boolean { - if (name in resourceTerrainAllow) return true return uniqueObjects.filter { it.placeholderText == "Does not need removal of []" && it.params[0] == name }.any()