Deprecated old uniques

This commit is contained in:
Yair Morgenstern 2022-02-01 10:03:36 +02:00
parent 78e8dba2b5
commit c3d185cce8
9 changed files with 17 additions and 55 deletions

View File

@ -633,11 +633,6 @@ class CityStats(val cityInfo: CityInfo) {
foodEaten = cityInfo.population.population.toFloat() * 2
var foodEatenBySpecialists = 2f * cityInfo.population.getNumberOfSpecialists()
// Deprecated since 3.16.11
for (unique in cityInfo.civInfo.getMatchingUniques(UniqueType.FoodConsumptionBySpecialistsDeprecated))
foodEatenBySpecialists *= 1f - unique.params[0].toFloat() / 100f
//
for (unique in cityInfo.getMatchingUniques(UniqueType.FoodConsumptionBySpecialists))
if (cityInfo.matchesFilter(unique.params[1]))
foodEatenBySpecialists *= unique.params[0].toPercent()

View File

@ -193,13 +193,6 @@ class CivInfoStats(val civInfo: CivilizationInfo) {
)
}
// Deprecated since 3.16.15
if (civInfo.hasUnique(UniqueType.ExcessHappinessToCultureDeprecated)) {
val happiness = civInfo.getHappiness()
if (happiness > 0) statMap.add("Policies", Stats(culture = happiness / 2f))
}
//
if (civInfo.getHappiness() > 0) {
val excessHappinessConversion = Stats()
for (unique in civInfo.getMatchingUniques(UniqueType.ExcessHappinessToGlobalStat)) {

View File

@ -105,9 +105,6 @@ class MapUnit {
@Transient
var cannotEnterOceanTiles = false
@Transient
var cannotEnterOceanTilesUntilAstronomy = false
@Transient
var canEnterForeignTerrain: Boolean = false
@ -333,9 +330,6 @@ class MapUnit {
//todo: consider parameterizing [terrainFilter] in some of the following:
canEnterIceTiles = hasUnique(UniqueType.CanEnterIceTiles)
cannotEnterOceanTiles = hasUnique(UniqueType.CannotEnterOcean, StateForConditionals(civInfo=civInfo, unit=this))
// Deprecated as of 3.18.6
cannotEnterOceanTilesUntilAstronomy = hasUnique(UniqueType.CannotEnterOceanUntilAstronomy)
//
hasUniqueToBuildImprovements = hasUnique(UniqueType.BuildImprovements)
canEnterForeignTerrain = hasUnique(UniqueType.CanEnterForeignTiles)

View File

@ -457,11 +457,6 @@ open class TileInfo {
improvement.uniqueObjects.any {
it.placeholderText == "Obsolete with []" && civInfo.tech.isResearched(it.params[0])
} -> return false
// Deprecated since 3.18.5
improvement.getMatchingUniques(UniqueType.RequiresTechToBuildOnTile).any {
matchesTerrainFilter(it.params[0], civInfo) && !civInfo.tech.isResearched(it.params[1])
} -> false
//
improvement.getMatchingUniques(UniqueType.CannotBuildOnTile, StateForConditionals(civInfo=civInfo)).any {
matchesTerrainFilter(it.params[0], civInfo)
} -> false

View File

@ -610,9 +610,6 @@ class UnitMovementAlgorithms(val unit:MapUnit) {
}
if (tile.isOcean && !unit.civInfo.tech.wayfinding) { // Apparently all Polynesian naval units can enter oceans
if (unit.cannotEnterOceanTiles) return false
if (unit.cannotEnterOceanTilesUntilAstronomy
&& !unit.civInfo.tech.isResearched("Astronomy"))
return false
}
if (tile.naturalWonder != null) return false

View File

@ -475,12 +475,6 @@ class Building : RulesetStatsObject(), INonPerpetualConstruction {
for (unique in uniqueObjects) {
when (unique.placeholderText) { // TODO: Lots of typification…
// Deprecated since 3.16.11, replace with "Not displayed [...] construction without []"
UniqueType.NotDisplayedUnlessOtherBuildingBuilt.placeholderText ->
if (!cityConstructions.containsBuildingOrEquivalent(unique.params[0]))
rejectionReasons.add(RejectionReason.ShouldNotBeDisplayed)
//
UniqueType.NotDisplayedWithout.placeholderText ->
if (unique.params[0] in ruleSet.tileResources && !civInfo.hasResource(unique.params[0])
|| unique.params[0] in ruleSet.buildings && !cityConstructions.containsBuildingOrEquivalent(unique.params[0])

View File

@ -150,11 +150,6 @@ class Technology: RulesetObject() {
ruleset.tileImprovements.values
.asSequence()
.filter { improvement ->
// Deprecated since 3.18.6
improvement.getMatchingUniques(UniqueType.RequiresTechToBuildOnTile).any {
it.params[1] == name
} ||
//
improvement.uniqueObjects.any {
unique -> unique.conditionals.any {
(it.isOfType(UniqueType.ConditionalTech) || it.isOfType(UniqueType.ConditionalNoTech))

View File

@ -172,12 +172,8 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags:
UnhappinessFromPopulationPercentageChange("[amount]% unhappiness from population [cityFilter]", UniqueTarget.Global, UniqueTarget.FollowerBelief),
UnhappinessFromSpecialistsPercentageChange("[amount]% unhappiness from specialists [cityFilter]", UniqueTarget.Global, UniqueTarget.FollowerBelief),
FoodConsumptionBySpecialists("[amount]% Food consumption by specialists [cityFilter]", UniqueTarget.Global, UniqueTarget.FollowerBelief),
@Deprecated("As of 3.18.2", ReplaceWith("[-amount]% Food consumption by specialists [cityFilter]"), DeprecationLevel.WARNING)
FoodConsumptionBySpecialistsDeprecated("-[amount]% food consumption by specialists [cityFilter]", UniqueTarget.Global),
ExcessHappinessToGlobalStat("[amount]% of excess happiness converted to [stat]", UniqueTarget.Global),
@Deprecated("As of 3.18.2", ReplaceWith("[50]% of excess happiness converted to [Culture]"), DeprecationLevel.WARNING)
ExcessHappinessToCultureDeprecated("50% of excess happiness added to culture towards policies", UniqueTarget.Global),
BorderGrowthPercentage("[amount]% Culture cost of natural border growth [cityFilter]", UniqueTarget.Global, UniqueTarget.FollowerBelief),
@Deprecated("As of 3.19.2", ReplaceWith("[amount]% Culture cost of natural border growth [cityFilter]"))
@ -309,10 +305,6 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags:
MaxNumberBuildable("Limited to [amount] per Civilization", UniqueTarget.Building, UniqueTarget.Unit),
HiddenBeforeAmountPolicies("Hidden until [amount] social policy branches have been completed", UniqueTarget.Building, UniqueTarget.Unit),
NotDisplayedWithout("Not displayed as an available construction without [buildingName/tech/resource/policy]", UniqueTarget.Building, UniqueTarget.Unit),
//UniqueType added in 3.18.4
@Deprecated("As of 3.16.11", ReplaceWith("Not displayed as an available construction without [buildingName]"), DeprecationLevel.WARNING)
NotDisplayedUnlessOtherBuildingBuilt("Not displayed as an available construction unless [buildingName] is built", UniqueTarget.Building),
ConvertFoodToProductionWhenConstructed("Excess Food converted to Production when under construction", UniqueTarget.Building, UniqueTarget.Unit),
RequiresPopulation("Requires at least [amount] population", UniqueTarget.Building, UniqueTarget.Unit),
@ -429,8 +421,6 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags:
RoughTerrainPenalty("Rough terrain penalty", UniqueTarget.Unit),
CanEnterIceTiles("Can enter ice tiles", UniqueTarget.Unit),
CannotEnterOcean("Cannot enter ocean tiles", UniqueTarget.Unit),
@Deprecated("As of 3.18.6", ReplaceWith("Cannot enter ocean tiles <before discovering [Astronomy]>"))
CannotEnterOceanUntilAstronomy("Cannot enter ocean tiles until Astronomy", UniqueTarget.Unit),
CanEnterForeignTiles("May enter foreign tiles without open borders", UniqueTarget.Unit),
CanEnterForeignTilesButLosesReligiousStrength("May enter foreign tiles without open borders, but loses [amount] religious strength each turn it ends there", UniqueTarget.Unit),
@ -525,8 +515,6 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags:
CanBuildOutsideBorders("Can be built outside your borders", UniqueTarget.Improvement),
CanBuildJustOutsideBorders("Can be built just outside your borders", UniqueTarget.Improvement),
@Deprecated("As of 3.18.5", ReplaceWith("Cannot be built on [tileFilter] tiles <before discovering [tech]>"))
RequiresTechToBuildOnTile("Cannot be built on [tileFilter] tiles until [tech] is discovered", UniqueTarget.Improvement),
CannotBuildOnTile("Cannot be built on [tileFilter] tiles", UniqueTarget.Improvement),
NoFeatureRemovalNeeded("Does not need removal of [tileFilter]", UniqueTarget.Improvement),
@ -652,6 +640,16 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags:
// endregion
// region DEPRECATED AND REMOVED
@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)
NotDisplayedUnlessOtherBuildingBuilt("Not displayed as an available construction unless [buildingName] is built", UniqueTarget.Building),
@Deprecated("As of 3.18.2", ReplaceWith("[-amount]% Food consumption by specialists [cityFilter]"), DeprecationLevel.ERROR)
FoodConsumptionBySpecialistsDeprecated("-[amount]% food consumption by specialists [cityFilter]", UniqueTarget.Global),
@Deprecated("As of 3.18.6", ReplaceWith("Cannot enter ocean tiles <before discovering [Astronomy]>"), DeprecationLevel.ERROR)
CannotEnterOceanUntilAstronomy("Cannot enter ocean tiles until Astronomy", UniqueTarget.Unit),
@Deprecated("As of 3.18.5", ReplaceWith("Cannot be built on [tileFilter] tiles <before discovering [tech]>"), DeprecationLevel.ERROR)
RequiresTechToBuildOnTile("Cannot be built on [tileFilter] tiles until [tech] is discovered", UniqueTarget.Improvement),
@Deprecated("As of 3.17.9, removed as of 3.19.3", ReplaceWith ("May buy [baseUnitFilter] units for [amount] [stat] [cityFilter] at an increasing price ([amount]) <starting from the [era]>"), DeprecationLevel.ERROR)
BuyUnitsIncreasingCostEra("May buy [baseUnitFilter] units for [amount] [stat] [cityFilter] starting from the [era] at an increasing price ([amount])", UniqueTarget.Global),

View File

@ -347,8 +347,8 @@ Example: "Retain [20]% of the happiness from a luxury after the last copy has be
Applicable to: Global
#### [+amount] Happiness from each type of luxury resource
Example: "[+amount] Happiness from each type of luxury resource"
#### [amount] Happiness from each type of luxury resource
Example: "[20] Happiness from each type of luxury resource"
Applicable to: Global
@ -1441,8 +1441,6 @@ Applicable to: Conditional
- "Happiness from Luxury Resources gifted by City-States increased by [amount]%" - Deprecated As of 3.18.17, replace with "[+amount]% Happiness from luxury resources gifted by City-States"
- "[amount]% of food is carried over after population increases" - Deprecated As of 3.19.2, replace with "[amount]% Food is carried over after population increases [cityFilter]"
- "[amount]% of food is carried over [cityFilter] after population increases" - Deprecated As of 3.19.2, replace with "[amount]% Food is carried over after population increases [cityFilter]"
- "-[amount]% food consumption by specialists [cityFilter]" - Deprecated As of 3.18.2, replace with "[-amount]% Food consumption by specialists [cityFilter]"
- "50% of excess happiness added to culture towards policies" - Deprecated As of 3.18.2, replace with "[50]% of excess happiness converted to [Culture]"
- "[amount]% Culture cost of natural border growth [cityFilter]" - Deprecated As of 3.19.2, replace with "[amount]% Culture cost of natural border growth [cityFilter]"
- "-[amount]% Culture cost of acquiring tiles [cityFilter]" - Deprecated As of 3.19.1, replace with "[-amount]% Culture cost of natural border growth [cityFilter]"
- "[amount]% cost of natural border growth" - Deprecated As of 3.19.1, replace with "[amount]% Culture cost of natural border growth [cityFilter]"
@ -1465,8 +1463,11 @@ Applicable to: Conditional
- "[amount]% Natural religion spread [cityFilter] with [tech/policy]" - Deprecated As of 3.19.3, replace with "[amount]% Natural religion spread [cityFilter] <after discovering [tech]> OR [amount]% natural religion spread [cityFilter] <after adopting [policy]>"
- "[amount] HP when healing in [tileFilter] tiles" - Deprecated As of 3.19.4, replace with "[amount] HP when healing <in [tileFilter] tiles>"
- "Melee units pay no movement cost to pillage" - Deprecated As of 3.18.17, replace with "No movement cost to pillage <for [Melee] units>"
- "Heal adjacent units for an additional 15 HP per turn" - Deprecated As of 3.19.3, replace with "All adjacent units heal [+15] HP when healing"
- "[mapUnitFilter] units gain [amount]% more Experience from combat" - Deprecated As of 3.18.12, replace with "[amount]% XP gained from combat <for [mapUnitFilter] units>"
- "[amount]% maintenance costs for [mapUnitFilter] units" - Deprecated As of 3.18.14, replace with "[amount]% maintenance costs <for [mapUnitFilter] units>"
- "50% of excess happiness added to culture towards policies" - Deprecated As of 3.18.2, replace with "[50]% of excess happiness converted to [Culture]"
- "-[amount]% food consumption by specialists [cityFilter]" - Deprecated As of 3.18.2, replace with "[-amount]% Food consumption by specialists [cityFilter]"
- "May buy [baseUnitFilter] units for [amount] [stat] [cityFilter] starting from the [era] at an increasing price ([amount])" - Deprecated As of 3.17.9, removed as of 3.19.3, replace with "May buy [baseUnitFilter] units for [amount] [stat] [cityFilter] at an increasing price ([amount]) <starting from the [era]>"
- "Provides a free [buildingName] [cityFilter]" - Deprecated As of 3.17.7 - removed 3.18.19, replace with "Gain a free [buildingName] [cityFilter]"
- "+[amount]% [stat] [cityFilter]" - Deprecated As of 3.17.10 - removed 3.18.18, replace with "[+amount]% [stat] [cityFilter]"
@ -1489,8 +1490,8 @@ Applicable to: Conditional
- "+[amount]% Production when constructing [constructionFilter] [cityFilter]" - Deprecated As of 3.17.10 - removed 3.18.5, replace with "[amount]% Production when constructing [buildingFilter] buildings [cityFilter]"
- "Not displayed as an available construction unless [buildingName] is built" - Deprecated As of 3.16.11, replace with "Not displayed as an available construction without [buildingName]"
- "[stats] once [tech] is discovered" - Deprecated As of 3.17.10 - removed 3.18.19, replace with "[stats] <after discovering [tech]>"
- "Cannot enter ocean tiles until Astronomy" - Deprecated As of 3.18.6, replace with "Cannot enter ocean tiles <before discovering [Astronomy]>"
- "[amount]% Bonus XP gain" - Deprecated As of 3.18.12, replace with "[amount]% XP gained from combat"
- "Cannot enter ocean tiles until Astronomy" - Deprecated As of 3.18.6, replace with "Cannot enter ocean tiles <before discovering [Astronomy]>"
- "+[amount]% Strength when attacking" - Deprecated As of 3.17.5 - removed 3.18.5, replace with "[+amount]% Strength <when attacking>"
- "+[amount]% Strength when defending" - Deprecated As of 3.17.5 - removed 3.18.5, replace with "[+amount]% Strength <when defending>"
- "[amount]% Strength when defending vs [mapUnitFilter] units" - Deprecated As of 3.17.5 - removed 3.18.5, replace with "[amount]% Strength <when defending> <vs [mapUnitFilter] units>"
@ -1498,7 +1499,7 @@ Applicable to: Conditional
- "+[amount]% Strength in [tileFilter]" - Deprecated As of 3.17.5 - removed 3.18.5, replace with "[amount]% Strength <when fighting in [tileFilter] tiles>"
- "[amount] Visibility Range" - Deprecated As of 3.17.5 - removed 3.18.5, replace with "[amount] Sight"
- "Limited Visibility" - Deprecated As of 3.17.5 - removed 3.18.5, replace with "[-1] Sight"
- "Cannot be built on [tileFilter] tiles until [tech] is discovered" - Deprecated As of 3.18.5, replace with "Cannot be built on [tileFilter] tiles <before discovering [tech]>"
- "Deal [amount] damage to adjacent enemy units" - Deprecated As of 3.18.17, replace with "Adjacent enemy units ending their turn take [amount] damage"
- "Cannot be built on [tileFilter] tiles until [tech] is discovered" - Deprecated As of 3.18.5, replace with "Cannot be built on [tileFilter] tiles <before discovering [tech]>"
- "[stats] on [tileFilter] tiles once [tech] is discovered" - Deprecated As of 3.17.10 - removed 3.18.19, replace with "[stats] from [tileFilter] tiles <after discovering [tech]>"
- "Deal 30 damage to adjacent enemy units" - Deprecated As of 3.17.10 - removed 3.18.19, replace with "Adjacent enemy units ending their turn take [30] damage"