diff --git a/android/build.gradle.kts b/android/build.gradle.kts index af621c9711..0ca5328c23 100644 --- a/android/build.gradle.kts +++ b/android/build.gradle.kts @@ -7,7 +7,7 @@ plugins { } android { - compileSdkVersion(30) + compileSdk = 30 sourceSets { getByName("main").apply { manifest.srcFile("AndroidManifest.xml") diff --git a/core/src/com/unciv/logic/battle/Battle.kt b/core/src/com/unciv/logic/battle/Battle.kt index 47477d3d41..44d8b223b2 100644 --- a/core/src/com/unciv/logic/battle/Battle.kt +++ b/core/src/com/unciv/logic/battle/Battle.kt @@ -659,12 +659,6 @@ object Battle { } else { var populationLoss = city.population.population * (0.6 + Random().nextFloat() * 0.2) var populationLossReduced = false - // Deprecated since 3.15.11 - for (unique in city.getLocalMatchingUniques("Population loss from nuclear attacks -[]%")) { - populationLoss *= 1 - unique.params[0].toFloat() / 100f - populationLossReduced = true - } - // for (unique in city.getMatchingUniques("Population loss from nuclear attacks []% []")) { if (!city.matchesFilter(unique.params[1])) populationLoss *= unique.params[0].toPercent() diff --git a/core/src/com/unciv/logic/map/TileInfo.kt b/core/src/com/unciv/logic/map/TileInfo.kt index 9026c9a90e..75a921f7e2 100644 --- a/core/src/com/unciv/logic/map/TileInfo.kt +++ b/core/src/com/unciv/logic/map/TileInfo.kt @@ -411,9 +411,6 @@ open class TileInfo { topTerrain.unbuildable && !improvement.isAllowedOnFeature(topTerrain.name) -> false // DO NOT reverse this &&. isAdjacentToFreshwater() is a lazy which calls a function, and reversing it breaks the tests. improvement.hasUnique("Can also be built on tiles adjacent to fresh water") && isAdjacentToFreshwater -> true - // deprecated as of 3.15.15 - "Can only be built on Coastal tiles" in improvement.uniques && isCoastalTile() -> true - // // If an unique of this type exists, we want all to match (e.g. Hill _and_ Forest would be meaningful). improvement.uniqueObjects.filter { it.placeholderText == "Can only be built on [] tiles" }.let { diff --git a/core/src/com/unciv/models/ruleset/Building.kt b/core/src/com/unciv/models/ruleset/Building.kt index b7f354cbfb..2ce81b2dfc 100644 --- a/core/src/com/unciv/models/ruleset/Building.kt +++ b/core/src/com/unciv/models/ruleset/Building.kt @@ -65,8 +65,6 @@ class Building : NamedStats(), INonPerpetualConstruction, ICivilopediaText { var replaces: String? = null var uniqueTo: String? = null var quote: String = "" - @Deprecated("As of 3.15.16 - replaced with 'Provides a free [buildingName] [cityFilter]'") - var providesFreeBuilding: String? = null override var uniques = ArrayList() override val uniqueObjects: List by lazy { uniques.map { Unique(it) } } var replacementTextForUniques = "" @@ -130,8 +128,6 @@ class Building : NamedStats(), INonPerpetualConstruction, ICivilopediaText { lines += if (amount == 1) "Consumes 1 [$resource]" // For now, to keep the existing translations else "Consumes [$amount] [$resource]" } - if (providesFreeBuilding != null) - lines += "Provides a free [$providesFreeBuilding] in the city" if (uniques.isNotEmpty()) { if (replacementTextForUniques != "") lines += replacementTextForUniques else lines += getUniquesStringsWithoutDisablers() @@ -256,12 +252,6 @@ class Building : NamedStats(), INonPerpetualConstruction, ICivilopediaText { } } - if (providesFreeBuilding != null) { - textList += FormattedLine() - textList += FormattedLine("Provides a free [$providesFreeBuilding] in the city", - link="Building/$providesFreeBuilding") - } - val stats = this.clone() val percentStats = getStatPercentageBonuses(null) val specialists = newSpecialists() @@ -314,7 +304,7 @@ class Building : NamedStats(), INonPerpetualConstruction, ICivilopediaText { val seeAlso = ArrayList() for (building in ruleset.buildings.values) { - if (building.replaces == name || building.providesFreeBuilding == name + if (building.replaces == name || building.uniqueObjects.any { unique -> unique.params.any { it ==name } }) seeAlso += FormattedLine(building.name, link=building.makeLink(), indent=1) } @@ -611,12 +601,6 @@ class Building : NamedStats(), INonPerpetualConstruction, ICivilopediaText { if (!civInfo.gameInfo.gameParameters.victoryTypes.contains(VictoryType.valueOf(unique.params[0]))) rejectionReasons.add(RejectionReason.HiddenWithoutVictory.apply { errorMessage = unique.text }) } - // Deprecated since 3.15.14 - "Hidden when cultural victory is disabled" -> { - if (!civInfo.gameInfo.gameParameters.victoryTypes.contains(VictoryType.Cultural)) - rejectionReasons.add(RejectionReason.HiddenWithoutVictory.apply { errorMessage = unique.text }) - } - // } if (requiredBuilding != null && !cityConstructions.containsBuildingOrEquivalent(requiredBuilding!!)) { @@ -631,11 +615,9 @@ class Building : NamedStats(), INonPerpetualConstruction, ICivilopediaText { ) } } - // cannotBeBuiltWith is Deprecated as of 3.15.19 val cannotBeBuiltWith = uniqueObjects .firstOrNull { it.placeholderText == "Cannot be built with []" } ?.params?.get(0) - ?: this.cannotBeBuiltWith if (cannotBeBuiltWith != null && cityConstructions.isBuilt(cannotBeBuiltWith)) rejectionReasons.add(RejectionReason.CannotBeBuiltWith.apply { errorMessage = "Cannot be built with [$cannotBeBuiltWith]" }) @@ -687,8 +669,7 @@ class Building : NamedStats(), INonPerpetualConstruction, ICivilopediaText { } // "Provides a free [buildingName] [cityFilter]" - var freeBuildingUniques = uniqueObjects.asSequence().filter { it.placeholderText=="Provides a free [] []" } - if (providesFreeBuilding!=null) freeBuildingUniques += sequenceOf(Unique("Provides a free [$providesFreeBuilding] [in this city]")) + val freeBuildingUniques = uniqueObjects.asSequence().filter { it.placeholderText=="Provides a free [] []" } for (unique in freeBuildingUniques) { val affectedCities = diff --git a/core/src/com/unciv/models/ruleset/Ruleset.kt b/core/src/com/unciv/models/ruleset/Ruleset.kt index 48bb69c743..240ef7d15a 100644 --- a/core/src/com/unciv/models/ruleset/Ruleset.kt +++ b/core/src/com/unciv/models/ruleset/Ruleset.kt @@ -375,8 +375,6 @@ class Ruleset { lines += "${building.name} requires ${building.requiredBuilding} which does not exist!" if (building.requiredBuildingInAllCities != null && !buildings.containsKey(building.requiredBuildingInAllCities!!)) lines += "${building.name} requires ${building.requiredBuildingInAllCities} in all cities which does not exist!" - if (building.providesFreeBuilding != null && !buildings.containsKey(building.providesFreeBuilding!!)) - lines += "${building.name} provides a free ${building.providesFreeBuilding} which does not exist!" for (unique in building.uniqueObjects) if (unique.placeholderText == "Creates a [] improvement on a specific tile" && !tileImprovements.containsKey(unique.params[0])) lines += "${building.name} creates a ${unique.params[0]} improvement which does not exist!" diff --git a/core/src/com/unciv/models/ruleset/tile/TileImprovement.kt b/core/src/com/unciv/models/ruleset/tile/TileImprovement.kt index 839bd4031a..38023fdac1 100644 --- a/core/src/com/unciv/models/ruleset/tile/TileImprovement.kt +++ b/core/src/com/unciv/models/ruleset/tile/TileImprovement.kt @@ -34,12 +34,6 @@ class TileImprovement : NamedStats(), ICivilopediaText, IHasUniques { for (unique in civInfo.getMatchingUniques("[]% tile improvement construction time")) { realTurnsToBuild *= unique.params[0].toPercent() } - // Deprecated since 3.14.17 - if (civInfo.hasUnique("Worker construction increased 25%")) - realTurnsToBuild *= 0.75f - if (civInfo.hasUnique("Tile improvement speed +25%")) - realTurnsToBuild *= 0.75f - // // In some weird cases it was possible for something to take 0 turns, leading to it instead never finishing if (realTurnsToBuild < 1) realTurnsToBuild = 1f return realTurnsToBuild.roundToInt() diff --git a/core/src/com/unciv/models/ruleset/unit/BaseUnit.kt b/core/src/com/unciv/models/ruleset/unit/BaseUnit.kt index 94431993dd..50f1470f9d 100644 --- a/core/src/com/unciv/models/ruleset/unit/BaseUnit.kt +++ b/core/src/com/unciv/models/ruleset/unit/BaseUnit.kt @@ -257,14 +257,6 @@ class BaseUnit : INamed, INonPerpetualConstruction, ICivilopediaText { var cost = getBaseBuyCost(cityInfo, stat)?.toDouble() if (cost == null) return null - - // Deprecated since 3.15.15 - if (stat == Stat.Gold) { - for (unique in cityInfo.getMatchingUniques("Cost of purchasing items in cities reduced by []%")) - cost *= 1f - (unique.params[0].toFloat() / 100f) - } - // - for (unique in cityInfo.getMatchingUniques("[] cost of purchasing [] units []%")) { if (stat.name == unique.params[0] && matchesFilter(unique.params[1])) cost *= unique.params[2].toPercent()