mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-26 13:27:22 -04:00
Deprecation
This commit is contained in:
parent
daaab81e28
commit
194c69a633
@ -7,7 +7,7 @@ plugins {
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion(30)
|
||||
compileSdk = 30
|
||||
sourceSets {
|
||||
getByName("main").apply {
|
||||
manifest.srcFile("AndroidManifest.xml")
|
||||
|
@ -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()
|
||||
|
@ -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 {
|
||||
|
@ -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<String>()
|
||||
override val uniqueObjects: List<Unique> 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<FormattedLine>()
|
||||
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 =
|
||||
|
@ -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!"
|
||||
|
@ -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()
|
||||
|
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user