Unique deprecation work

This commit is contained in:
yairm210 2021-11-22 20:24:43 +02:00
parent 14c4f2d570
commit 63c5ed2156
4 changed files with 85 additions and 186 deletions

View File

@ -43,13 +43,17 @@ object BattleDamage {
)
for (unique in combatant.unit.getMatchingUniques(
UniqueType.Strength, conditionalState, true)) {
UniqueType.Strength, conditionalState, true
)) {
modifiers.add(getModifierStringFromUnique(unique), unique.params[0].toInt())
}
for (unique in combatant.unit.getMatchingUniques(UniqueType.StrengthNearCapital,
checkCivInfoUniques = true)) {
for (unique in combatant.unit.getMatchingUniques(
UniqueType.StrengthNearCapital,
checkCivInfoUniques = true
)) {
if (civInfo.cities.isEmpty()) break
val distance = combatant.getTile().aerialDistanceTo(civInfo.getCapital().getCenterTile())
val distance =
combatant.getTile().aerialDistanceTo(civInfo.getCapital().getCenterTile())
// https://steamcommunity.com/sharedfiles/filedetails/?id=326411722#464287
val effect = unique.params[0].toInt() - 3 * distance
if (effect <= 0) continue
@ -76,7 +80,10 @@ object BattleDamage {
//https://www.carlsguides.com/strategy/civilization5/war/combatbonuses.php
val civHappiness = if (civInfo.isCityState() && civInfo.getAllyCiv() != null)
// If we are a city state with an ally we are vulnerable to their unhappiness.
min(civInfo.gameInfo.getCivilization(civInfo.getAllyCiv()!!).getHappiness(), civInfo.getHappiness())
min(
civInfo.gameInfo.getCivilization(civInfo.getAllyCiv()!!).getHappiness(),
civInfo.getHappiness()
)
else civInfo.getHappiness()
if (civHappiness < 0)
modifiers["Unhappiness"] = max(
@ -84,14 +91,6 @@ object BattleDamage {
-90
) // otherwise it could exceed -100% and start healing enemy units...
// Deprecated since 3.17.5
for (unique in civInfo.getMatchingUniques(UniqueType.DamageForUnits)) {
if (combatant.matchesCategory(unique.params[0])) {
modifiers.add(unique.params[0], unique.params[1].toInt())
}
}
//
val adjacentUnits = combatant.getTile().neighbors.flatMap { it.getUnits() }
for (unique in civInfo.getMatchingUniques("[]% Strength for [] units which have another [] unit in an adjacent tile")) {
@ -104,7 +103,9 @@ object BattleDamage {
for (unique in adjacentUnits.filter { it.civInfo.isAtWarWith(combatant.getCivInfo()) }
.flatMap { it.getMatchingUniques("[]% Strength for enemy [] units in adjacent [] tiles") })
if (combatant.matchesCategory(unique.params[1]) && combatant.getTile().matchesFilter(unique.params[2]))
if (combatant.matchesCategory(unique.params[1]) && combatant.getTile()
.matchesFilter(unique.params[2])
)
modifiers.add("Adjacent enemy units", unique.params[0].toInt())
val civResources = civInfo.getCivResourcesByName()
@ -131,16 +132,10 @@ object BattleDamage {
modifiers["Stacked with [${unique.params[1]}]"] = stackedUnitsBonus
}
// Deprecated since 3.17.5
if (civInfo.goldenAges.isGoldenAge() && civInfo.hasUnique(UniqueType.StrengthGoldenAge))
modifiers["Golden Age"] = 10
//
if (enemy.getCivInfo()
.isCityState() && civInfo.hasUnique("+30% Strength when fighting City-State units and cities")
if (enemy.getCivInfo().isCityState()
&& civInfo.hasUnique("+30% Strength when fighting City-State units and cities")
)
modifiers["vs [City-States]"] = 30
}
if (enemy.getCivInfo().isBarbarian()) {
@ -160,11 +155,6 @@ object BattleDamage {
if (attacker is MapUnitCombatant) {
modifiers.add(getTileSpecificModifiers(attacker, defender.getTile()))
// Deprecated since 3.17.4
for (unique in attacker.unit.getMatchingUniques(UniqueType.StrengthAttacking)) {
modifiers.add("Attacker Bonus", unique.params[0].toInt())
}
//
if (attacker.unit.isEmbarked() && !attacker.unit.hasUnique("Eliminates combat penalty for attacking from the sea"))
modifiers["Landing"] = -50
@ -204,12 +194,6 @@ object BattleDamage {
}
}
// Deprecated since 3.17.5
if (defender is CityCombatant &&
attacker.getCivInfo().hasUnique(UniqueType.StrengthVsCities)
)
modifiers["Statue of Zeus"] = 15
//
} else if (attacker is CityCombatant) {
if (attacker.city.getCenterTile().militaryUnit != null) {
val garrisonBonus = attacker.city.getMatchingUniques("+[]% attacking strength for cities with garrisoned units")
@ -249,23 +233,6 @@ object BattleDamage {
)
modifiers["Tile"] = (tileDefenceBonus * 100).toInt()
// Deprecated since 3.17.4
for (unique in defender.unit.getMatchingUniques(UniqueType.StrengthDefendingUnitFilter)) {
if (attacker.matchesCategory(unique.params[1]))
modifiers.add("defence vs [${unique.params[1]}] ", unique.params[0].toInt())
}
for (unique in defender.unit.getMatchingUniques(UniqueType.StrengthDefending)) {
modifiers.add("Defender Bonus", unique.params[0].toInt())
}
//
// Deprecated since 3.17.5
for (unique in defender.unit.getMatchingUniques(UniqueType.StrengthDefenseTiles)) {
if (tile.matchesFilter(unique.params[1]))
modifiers.add("[${unique.params[1]}] defence", unique.params[0].toInt())
}
//
if (defender.unit.isFortified())
modifiers["Fortification"] = 20 * defender.unit.getFortificationTurns()
@ -282,14 +249,6 @@ object BattleDamage {
private fun getTileSpecificModifiers(unit: MapUnitCombatant, tile: TileInfo): Counter<String> {
val modifiers = Counter<String>()
// Deprecated since 3.17.5
for (unique in unit.unit.getMatchingUniques(UniqueType.StrengthIn)) {
val filter = unique.params[1]
if (tile.matchesFilter(filter, unit.getCivInfo()))
modifiers.add(filter, unique.params[0].toInt())
}
//
for (unique in unit.getCivInfo().getMatchingUniques("+[]% Strength if within [] tiles of a []")) {
if (tile.getTilesInDistance(unique.params[1].toInt())
.any { it.matchesFilter(unique.params[2]) }
@ -297,14 +256,6 @@ object BattleDamage {
modifiers[unique.params[2]] = unique.params[0].toInt()
}
// Deprecated since 3.17.5
for (unique in unit.getCivInfo().getMatchingUniques(UniqueType.StrengthUnitsTiles)) {
if (unit.matchesCategory(unique.params[1]) && tile.matchesFilter(unique.params[2], unit.getCivInfo())) {
modifiers.add(unique.params[2], unique.params[0].toInt())
}
}
//
return modifiers
}

View File

@ -259,7 +259,7 @@ class CityStats(val cityInfo: CityInfo) {
// Deprecated since 3.17.0
// For instance "+[50]% [Production]
for (unique in uniques.filter { it.placeholderText == "+[]% [] in all cities"})
for (unique in uniques.filter { it.type == UniqueType.StatPercentBonusCitiesDeprecated2})
stats.add(Stat.valueOf(unique.params[1]), unique.params[0].toFloat())
//
@ -293,45 +293,15 @@ class CityStats(val cityInfo: CityInfo) {
stats.production += unique.params[0].toInt()
}
// Deprecated since 3.17.10
if (currentConstruction is Building && !currentConstruction.isAnyWonder())
for (unique in uniqueMap.getUniques(UniqueType.PercentProductionStatBuildings)) {
val stat = Stat.valueOf(unique.params[1])
if (currentConstruction.isStatRelated(stat))
stats.production += unique.params[0].toInt()
}
for (unique in uniqueMap.getUniques(UniqueType.PercentProductionConstructions)) {
if (constructionMatchesFilter(currentConstruction, unique.params[1]))
stats.production += unique.params[0].toInt()
}
// Used for specific buildings (e.g. +100% Production when constructing a Factory)
for (unique in uniqueMap.getUniques(UniqueType.PercentProductionBuildingName)) {
if (constructionMatchesFilter(currentConstruction, unique.params[1]))
stats.production += unique.params[0].toInt()
}
// "+[amount]% Production when constructing [constructionFilter] [cityFilter]"
for (unique in uniqueMap.getUniques(UniqueType.PercentProductionConstructionsCities)) {
if (constructionMatchesFilter(currentConstruction, unique.params[1]) && cityInfo.matchesFilter(unique.params[2]))
stats.production += unique.params[0].toInt()
}
// "+[amount]% Production when constructing [unitFilter] units [cityFilter]"
for (unique in uniqueMap.getUniques(UniqueType.PercentProductionUnitsDeprecated)) {
if (constructionMatchesFilter(currentConstruction, unique.params[1]) && cityInfo.matchesFilter(unique.params[2]))
stats.production += unique.params[0].toInt()
}
//
// Deprecated since 3.17.1
if (cityInfo.civInfo.getHappiness() >= 0) {
// todo convert to uniquetype
for (unique in uniques.filter { it.placeholderText == "[]% [] while the empire is happy"})
for (unique in uniques.filter { it.type == UniqueType.StatPercentBonusCitiesDeprecatedWhileEmpireHappy})
stats.add(Stat.valueOf(unique.params[1]), unique.params[0].toFloat())
}
//
for (unique in uniques.filter { it.placeholderText == "[]% [] from every follower, up to []%" })
for (unique in uniques.filter { it.type == UniqueType.StatPercentFromReligionFollowers })
stats.add(
Stat.valueOf(unique.params[1]),
min(
@ -581,7 +551,6 @@ class CityStats(val cityInfo: CityInfo) {
}
//
/* Okay, food calculation is complicated.
First we see how much food we generate. Then we apply production bonuses to it.
Up till here, business as usual.

View File

@ -10,13 +10,12 @@ import com.unciv.logic.city.RejectionReason
import com.unciv.logic.civilization.CivilizationInfo
import com.unciv.logic.civilization.LocationAction
import com.unciv.logic.civilization.NotificationIcon
import com.unciv.models.MultiHashMap
import com.unciv.models.UnitActionType
import com.unciv.models.ruleset.Ruleset
import com.unciv.models.ruleset.tile.TerrainType
import com.unciv.models.ruleset.unique.Unique
import com.unciv.models.ruleset.tile.TileImprovement
import com.unciv.models.ruleset.unique.StateForConditionals
import com.unciv.models.ruleset.unique.Unique
import com.unciv.models.ruleset.unique.UniqueMapTyped
import com.unciv.models.ruleset.unique.UniqueType
import com.unciv.models.ruleset.unit.BaseUnit
@ -315,17 +314,6 @@ class MapUnit {
movement += getMatchingUniques(UniqueType.Movement, checkCivInfoUniques = true)
.sumOf { it.params[0].toInt() }
// Deprecated since 3.17.5
for (unique in getMatchingUniques(UniqueType.MovementUnits, checkCivInfoUniques = true))
if (matchesFilter(unique.params[1]))
movement += unique.params[0].toInt()
if (civInfo.goldenAges.isGoldenAge() &&
civInfo.hasUnique(UniqueType.MovementGoldenAge)
)
movement += 1
//
if (movement < 1) movement = 1
@ -349,17 +337,6 @@ class MapUnit {
visibilityRange += getMatchingUniques(UniqueType.Sight, checkCivInfoUniques = true)
.sumOf { it.params[0].toInt() }
// Deprecated since 3.17.5
for (unique in getMatchingUniques(UniqueType.SightUnits))
if (matchesFilter(unique.params[1]))
visibilityRange += unique.params[0].toInt()
visibilityRange += getMatchingUniques(UniqueType.VisibilityRange).sumOf { it.params[0].toInt() }
if (hasUnique(UniqueType.LimitedVisibility)) visibilityRange -= 1
//
// Maybe add the uniques of the tile a unit is standing on to the tempUniques of the unit?
for (unique in getTile().getAllTerrains().flatMap { it.uniqueObjects })
if (unique.placeholderText == "[] Sight for [] units" && matchesFilter(unique.params[1]))
@ -1115,12 +1092,6 @@ class MapUnit {
fun getPressureAddedFromSpread(): Int {
var pressureAdded = baseUnit.religiousStrength.toFloat()
// Deprecated since 3.17.5
for (unique in civInfo.getMatchingUniques(UniqueType.SpreadReligionStrengthUnits))
if (matchesFilter(unique.params[0]))
pressureAdded *= unique.params[0].toPercent()
//
for (unique in getMatchingUniques(UniqueType.SpreadReligionStrength, checkCivInfoUniques = true))
pressureAdded *= unique.params[0].toPercent()

View File

@ -68,11 +68,11 @@ enum class UniqueType(val text:String, vararg targets: UniqueTarget, val flags:
Stats("[stats]", UniqueTarget.Global, UniqueTarget.FollowerBelief, UniqueTarget.Improvement),
StatsPerCity("[stats] [cityFilter]", UniqueTarget.Global),
@Deprecated("As of 3.16.16 - removed as of 3.17.11", ReplaceWith("[stats] <if this city has at least [amount] specialists>"), DeprecationLevel.ERROR)
@Deprecated("As of 3.16.16 - removed 3.17.11", ReplaceWith("[stats] <if this city has at least [amount] specialists>"), DeprecationLevel.ERROR)
StatBonusForNumberOfSpecialists("[stats] if this city has at least [amount] specialists", UniqueTarget.Global),
StatsFromSpecialist("[stats] from every specialist [cityFilter]", UniqueTarget.Global),
@Deprecated("As of 3.16.16 - removed as of 3.17.11", ReplaceWith("[stats] from every specialist [in all cities]"), DeprecationLevel.ERROR)
@Deprecated("As of 3.16.16 - removed 3.17.11", ReplaceWith("[stats] from every specialist [in all cities]"), DeprecationLevel.ERROR)
StatsFromSpecialistDeprecated("[stats] from every specialist", UniqueTarget.Global),
StatsPerPopulation("[stats] per [amount] population [cityFilter]", UniqueTarget.Global),
@ -89,31 +89,39 @@ enum class UniqueType(val text:String, vararg targets: UniqueTarget, val flags:
StatPercentBonus("[amount]% [stat]", UniqueTarget.Global),
BonusStatsFromCityStates("[amount]% [stat] from City-States", UniqueTarget.Global),
StatPercentBonusCities("[amount]% [stat] [cityFilter]", UniqueTarget.Global),
@Deprecated("As of 3.17.10", ReplaceWith("[+amount]% [stat] [cityFilter]"), DeprecationLevel.WARNING)
StatPercentBonusCitiesDeprecated("+[amount]% [stat] [cityFilter]", UniqueTarget.Global),
@Deprecated("As of 3.17.10", ReplaceWith("[+amount]% [stat] [in all cities]"), DeprecationLevel.WARNING)
StatPercentBonusCitiesDeprecated2("+[amount]% [stat] in all cities", UniqueTarget.Global),
// type added 3.18.5
@Deprecated("As of 3.17.1", ReplaceWith("[amount]% [stat] [in all cities] <while the empire is happy>"), DeprecationLevel.WARNING)
StatPercentBonusCitiesDeprecatedWhileEmpireHappy("[amount]% [stat] while the empire is happy", UniqueTarget.Global),
StatPercentFromReligionFollowers("[amount]% [stat] from every follower, up to [amount]%", UniqueTarget.FollowerBelief, UniqueTarget.Global),
PercentProductionWonders("[amount]% Production when constructing [buildingFilter] wonders [cityFilter]", UniqueTarget.Global, UniqueTarget.Resource, UniqueTarget.FollowerBelief),
PercentProductionBuildings("[amount]% Production when constructing [buildingFilter] buildings [cityFilter]", UniqueTarget.Global),
PercentProductionUnits("[amount]% Production when constructing [baseUnitFilter] units [cityFilter]", UniqueTarget.Global),
@Deprecated("As of 3.17.10", ReplaceWith("[amount]% Production when constructing [buildingFilter] buildings [cityFilter]"), DeprecationLevel.WARNING)
@Deprecated("As of 3.17.10 - removed 3.18.5", ReplaceWith("[amount]% Production when constructing [buildingFilter] buildings [cityFilter]"), DeprecationLevel.ERROR)
PercentProductionStatBuildings("+[amount]% Production when constructing [stat] buildings", UniqueTarget.Global),
@Deprecated("As of 3.17.10", ReplaceWith("[amount]% Production when constructing [buildingFilter] buildings [cityFilter]"), DeprecationLevel.WARNING)
@Deprecated("As of 3.17.10 - removed 3.18.5", ReplaceWith("[amount]% Production when constructing [buildingFilter] buildings [cityFilter]"), DeprecationLevel.ERROR)
PercentProductionConstructions("+[amount]% Production when constructing [constructionFilter]", UniqueTarget.Global),
@Deprecated("As of 3.17.10", ReplaceWith("[amount]% Production when constructing [buildingFilter] buildings [cityFilter]"), DeprecationLevel.WARNING)
@Deprecated("As of 3.17.10 - removed 3.18.5", ReplaceWith("[amount]% Production when constructing [buildingFilter] buildings [cityFilter]"), DeprecationLevel.ERROR)
PercentProductionBuildingName("+[amount]% Production when constructing a [buildingName]", UniqueTarget.Global),
@Deprecated("As of 3.17.10", ReplaceWith("[amount]% Production when constructing [buildingFilter] buildings [cityFilter]"), DeprecationLevel.WARNING)
@Deprecated("As of 3.17.10 - removed 3.18.5", ReplaceWith("[amount]% Production when constructing [buildingFilter] buildings [cityFilter]"), DeprecationLevel.ERROR)
PercentProductionConstructionsCities("+[amount]% Production when constructing [constructionFilter] [cityFilter]", UniqueTarget.Global),
@Deprecated("As of 3.17.10", ReplaceWith("[+amount]% Production when constructing [baseUnitFilter] units [cityFilter]"), DeprecationLevel.WARNING)
@Deprecated("As of 3.17.10 - removed 3.18.5", ReplaceWith("[+amount]% Production when constructing [baseUnitFilter] units [cityFilter]"), DeprecationLevel.ERROR)
PercentProductionUnitsDeprecated("+[amount]% Production when constructing [baseUnitFilter] units [cityFilter]", UniqueTarget.Global),
RemoveAnnexUnhappiness("Remove extra unhappiness from annexed cities", UniqueTarget.Building),
UnhappinessFromPopulationPercentageChange("[amount]% unhappiness from population [cityFilter]", UniqueTarget.Global),
@Deprecated("As of 3.16.11 - removed as of 3.17.11", ReplaceWith("[amount]% unhappiness from population [cityFilter]"), DeprecationLevel.ERROR)
@Deprecated("As of 3.16.11 - removed 3.17.11", ReplaceWith("[amount]% unhappiness from population [cityFilter]"), DeprecationLevel.ERROR)
UnhappinessFromPopulationPercentageChangeOld1("Unhappiness from population decreased by [amount]%", UniqueTarget.Global),
@Deprecated("As of 3.16.11 - removed as of 3.17.11", ReplaceWith("[amount]% unhappiness from population [cityFilter]"), DeprecationLevel.ERROR)
@Deprecated("As of 3.16.11 - removed 3.17.11", ReplaceWith("[amount]% unhappiness from population [cityFilter]"), DeprecationLevel.ERROR)
UnhappinessFromPopulationPercentageChangeOld2("Unhappiness from population decreased by [amount]% [cityFilter]", UniqueTarget.Global),
@ -138,18 +146,18 @@ enum class UniqueType(val text:String, vararg targets: UniqueTarget, val flags:
FreeUnits("[amount] units cost no maintenance", UniqueTarget.Global),
UnitMaintenanceDiscount("[amount]% maintenance costs for [mapUnitFilter] units", UniqueTarget.Global),
@Deprecated("As of 3.16.16 - removed as of 3.17.11", ReplaceWith("[amount]% maintenance costs for [mapUnitFilter] units"), DeprecationLevel.ERROR)
@Deprecated("As of 3.16.16 - removed 3.17.11", ReplaceWith("[amount]% maintenance costs for [mapUnitFilter] units"), DeprecationLevel.ERROR)
DecreasedUnitMaintenanceCostsByFilter("-[amount]% [mapUnitFilter] unit maintenance costs", UniqueTarget.Global),
@Deprecated("As of 3.16.16 - removed as of 3.17.11", ReplaceWith("[amount]% maintenance costs for [mapUnitFilter] units"), DeprecationLevel.ERROR)
@Deprecated("As of 3.16.16 - removed 3.17.11", ReplaceWith("[amount]% maintenance costs for [mapUnitFilter] units"), DeprecationLevel.ERROR)
DecreasedUnitMaintenanceCostsGlobally("-[amount]% unit upkeep costs", UniqueTarget.Global),
ConsumesResources("Consumes [amount] [resource]", UniqueTarget.Improvement, UniqueTarget.Building, UniqueTarget.Unit),
ProvidesResources("Provides [amount] [resource]", UniqueTarget.Improvement, UniqueTarget.Building),
GrowthPercentBonus("[amount]% growth [cityFilter]", UniqueTarget.Global, UniqueTarget.FollowerBelief),
@Deprecated("As of 3.16.14 - removed as of 3.17.11", ReplaceWith("[amount]% growth [cityFilter]"), DeprecationLevel.ERROR)
@Deprecated("As of 3.16.14 - removed 3.17.11", ReplaceWith("[amount]% growth [cityFilter]"), DeprecationLevel.ERROR)
GrowthPercentBonusPositive("+[amount]% growth [cityFilter]", UniqueTarget.Global),
@Deprecated("As of 3.16.14 - removed as of 3.17.11", ReplaceWith("[amount]% growth [cityFilter] <when not at war>"), DeprecationLevel.ERROR)
@Deprecated("As of 3.16.14 - removed 3.17.11", ReplaceWith("[amount]% growth [cityFilter] <when not at war>"), DeprecationLevel.ERROR)
GrowthPercentBonusWhenNotAtWar("+[amount]% growth [cityFilter] when not at war", UniqueTarget.Global),
GainFreeBuildings("Gain a free [buildingName] [cityFilter]", UniqueTarget.Global),
@ -222,33 +230,33 @@ enum class UniqueType(val text:String, vararg targets: UniqueTarget, val flags:
Strength("[amount]% Strength", UniqueTarget.Unit, UniqueTarget.Global),
StrengthNearCapital("[amount]% Strength decreasing with distance from the capital", UniqueTarget.Unit),
@Deprecated("As of 3.17.3 - removed as of 3.17.13", ReplaceWith("[amount]% Strength"), DeprecationLevel.ERROR)
@Deprecated("As of 3.17.3 - removed 3.17.13", ReplaceWith("[amount]% Strength"), DeprecationLevel.ERROR)
StrengthPlus("+[amount]% Strength", UniqueTarget.Unit),
@Deprecated("As of 3.17.3 - removed as of 3.17.13", ReplaceWith("[amount]% Strength"), DeprecationLevel.ERROR)
@Deprecated("As of 3.17.3 - removed 3.17.13", ReplaceWith("[amount]% Strength"), DeprecationLevel.ERROR)
StrengthMin("-[amount]% Strength", UniqueTarget.Unit),
@Deprecated("As of 3.17.3 - removed as of 3.17.13", ReplaceWith("[amount]% Strength <vs [mapUnitFilter] units>/<vs cities>"), DeprecationLevel.ERROR)
@Deprecated("As of 3.17.3 - removed 3.17.13", ReplaceWith("[amount]% Strength <vs [mapUnitFilter] units>/<vs cities>"), DeprecationLevel.ERROR)
StrengthPlusVs("+[amount]% Strength vs [combatantFilter]", UniqueTarget.Unit),
@Deprecated("As of 3.17.3 - removed as of 3.17.13", ReplaceWith("[amount]% Strength <vs [mapUnitFilter] units>/<vs cities>"), DeprecationLevel.ERROR)
@Deprecated("As of 3.17.3 - removed 3.17.13", ReplaceWith("[amount]% Strength <vs [mapUnitFilter] units>/<vs cities>"), DeprecationLevel.ERROR)
StrengthMinVs("-[amount]% Strength vs [combatantFilter]", UniqueTarget.Unit),
@Deprecated("As of 3.17.3 - removed as of 3.17.13", ReplaceWith("[amount]% Strength"), DeprecationLevel.ERROR)
@Deprecated("As of 3.17.3 - removed 3.17.13", ReplaceWith("[amount]% Strength"), DeprecationLevel.ERROR)
CombatBonus("+[amount]% Combat Strength", UniqueTarget.Unit),
@Deprecated("As of 3.17.5", ReplaceWith("[amount]% Strength <when attacking>"), DeprecationLevel.WARNING)
@Deprecated("As of 3.17.5 - removed 3.18.5", ReplaceWith("[amount]% Strength <when attacking>"), DeprecationLevel.ERROR)
StrengthAttacking("+[amount]% Strength when attacking", UniqueTarget.Unit),
@Deprecated("As of 3.17.5", ReplaceWith("[amount]% Strength <shen defending>"), DeprecationLevel.WARNING)
@Deprecated("As of 3.17.5 - removed 3.18.5", ReplaceWith("[amount]% Strength <shen defending>"), DeprecationLevel.ERROR)
StrengthDefending("+[amount]% Strength when defending", UniqueTarget.Unit),
@Deprecated("As of 3.17.5", ReplaceWith("[amount]% Strength <when defending> <vs [mapUnitFilter] units>"), DeprecationLevel.WARNING)
@Deprecated("As of 3.17.5 - removed 3.18.5", ReplaceWith("[amount]% Strength <when defending> <vs [mapUnitFilter] units>"), DeprecationLevel.ERROR)
StrengthDefendingUnitFilter("[amount]% Strength when defending vs [mapUnitFilter] units", UniqueTarget.Unit),
@Deprecated("As of 3.17.5", ReplaceWith("[amount]% Strength <for [mapUnitFilter] units>"), DeprecationLevel.WARNING)
@Deprecated("As of 3.17.5 - removed 3.18.5", ReplaceWith("[amount]% Strength <for [mapUnitFilter] units>"), DeprecationLevel.ERROR)
DamageForUnits("[mapUnitFilter] units deal +[amount]% damage", UniqueTarget.Global),
@Deprecated("As of 3.17.5", ReplaceWith("[+10]% Strength <for [All] units> <during a Golden Age>"), DeprecationLevel.WARNING)
@Deprecated("As of 3.17.5 - removed 3.18.5", ReplaceWith("[+10]% Strength <for [All] units> <during a Golden Age>"), DeprecationLevel.ERROR)
StrengthGoldenAge("+10% Strength for all units during Golden Age", UniqueTarget.Global),
@Deprecated("As of 3.17.5", ReplaceWith("[amount]% Strength <when fighting in [tileFilter] tiles> <when defending>"), DeprecationLevel.WARNING)
@Deprecated("As of 3.17.5 - removed 3.18.5", ReplaceWith("[amount]% Strength <when fighting in [tileFilter] tiles> <when defending>"), DeprecationLevel.ERROR)
StrengthDefenseTiles("+[amount]% defence in [tileFilter] tiles", UniqueTarget.Unit),
@Deprecated("As of 3.17.5", ReplaceWith("[amount]% Strength <when fighting in [tileFilter] tiles>"), DeprecationLevel.WARNING)
@Deprecated("As of 3.17.5 - removed 3.18.5", ReplaceWith("[amount]% Strength <when fighting in [tileFilter] tiles>"), DeprecationLevel.ERROR)
StrengthIn("+[amount]% Strength in [tileFilter]", UniqueTarget.Unit),
@Deprecated("As of 3.17.5", ReplaceWith("[amount]% Strength <for [mapUnitFilter] units> <when fighting in [tileFilter] tiles>"))
@Deprecated("As of 3.17.5 - removed 3.18.5", ReplaceWith("[amount]% Strength <for [mapUnitFilter] units> <when fighting in [tileFilter] tiles>"), DeprecationLevel.ERROR)
StrengthUnitsTiles("[amount]% Strength for [mapUnitFilter] units in [tileFilter]", UniqueTarget.Global),
@Deprecated("As of 3.17.5", ReplaceWith("[+15]% Strength <for [All] units> <vs cities> <when attacking>"))
@Deprecated("As of 3.17.5 - removed 3.18.5", ReplaceWith("[+15]% Strength <for [All] units> <vs cities> <when attacking>"), DeprecationLevel.ERROR)
StrengthVsCities("+15% Combat Strength for all units when attacking Cities", UniqueTarget.Global),
@ -261,23 +269,23 @@ enum class UniqueType(val text:String, vararg targets: UniqueTarget, val flags:
CannotAttack("Cannot attack", UniqueTarget.Unit),
MustSetUp("Must set up to ranged attack", UniqueTarget.Unit),
@Deprecated("As of 3.16.11 - removed as of 3.17.11", ReplaceWith("[+1] Movement <for [Embarked] units>"), DeprecationLevel.ERROR)
@Deprecated("As of 3.16.11 - removed 3.17.11", ReplaceWith("[+1] Movement <for [Embarked] units>"), DeprecationLevel.ERROR)
EmbarkedUnitMovement1("Increases embarked movement +1", UniqueTarget.Global),
@Deprecated("As of 3.16.11 - removed as of 3.17.11", ReplaceWith("[+1] Movement <for [Embarked] units>"), DeprecationLevel.ERROR)
@Deprecated("As of 3.16.11 - removed 3.17.11", ReplaceWith("[+1] Movement <for [Embarked] units>"), DeprecationLevel.ERROR)
EmbarkedUnitMovement2("+1 Movement for all embarked units", UniqueTarget.Global),
@Deprecated("As of 3.17.5", ReplaceWith("[amount] Movement <for [mapUnitFilter] units>"), DeprecationLevel.WARNING)
@Deprecated("As of 3.17.5 - removed 3.18.5", ReplaceWith("[amount] Movement <for [mapUnitFilter] units>"), DeprecationLevel.ERROR)
MovementUnits("+[amount] Movement for all [mapUnitFilter] units", UniqueTarget.Global),
@Deprecated("As of 3.17.5", ReplaceWith("[amount] Movement <for [All] units> <during a Golden Age>"), DeprecationLevel.WARNING)
@Deprecated("As of 3.17.5 - removed 3.18.5", ReplaceWith("[amount] Movement <for [All] units> <during a Golden Age>"), DeprecationLevel.ERROR)
MovementGoldenAge("+1 Movement for all units during Golden Age", UniqueTarget.Global),
@Deprecated("As of 3.17.5", ReplaceWith("[amount] Sight <for [mapUnitFilter] units>"), DeprecationLevel.WARNING)
@Deprecated("As of 3.17.5 - removed 3.18.5", ReplaceWith("[amount] Sight <for [mapUnitFilter] units>"), DeprecationLevel.ERROR)
SightUnits("[amount] Sight for all [mapUnitFilter] units", UniqueTarget.Global),
@Deprecated("As of 3.17.5", ReplaceWith("[amount] Sight"), DeprecationLevel.WARNING)
@Deprecated("As of 3.17.5 - removed 3.18.5", ReplaceWith("[amount] Sight"), DeprecationLevel.ERROR)
VisibilityRange("[amount] Visibility Range", UniqueTarget.Unit),
@Deprecated("As of 3.17.5", ReplaceWith("[-1] Sight"), DeprecationLevel.WARNING)
@Deprecated("As of 3.17.5 - removed 3.18.5", ReplaceWith("[-1] Sight"), DeprecationLevel.ERROR)
LimitedVisibility("Limited Visibility", UniqueTarget.Unit),
@Deprecated("As of 3.17.5", ReplaceWith("[amount]% Spread Religion Strength <for [mapUnitFilter] units>"), DeprecationLevel.WARNING)
@Deprecated("As of 3.17.5 - removed 3.18.5", ReplaceWith("[amount]% Spread Religion Strength <for [mapUnitFilter] units>"), DeprecationLevel.ERROR)
SpreadReligionStrengthUnits("[amount]% Spread Religion Strength for [mapUnitFilter] units", UniqueTarget.Global),
BlastRadius("Blast radius [amount]", UniqueTarget.Unit),
@ -288,11 +296,11 @@ enum class UniqueType(val text:String, vararg targets: UniqueTarget, val flags:
// The following block gets cached in MapUnit for faster getMovementCostBetweenAdjacentTiles
DoubleMovementOnTerrain("Double movement in [terrainFilter]", UniqueTarget.Unit),
@Deprecated("As of 3.17.1 - removed as of 3.17.13", ReplaceWith("Double movement in [terrainFilter]"), DeprecationLevel.ERROR)
@Deprecated("As of 3.17.1 - removed 3.17.13", ReplaceWith("Double movement in [terrainFilter]"), DeprecationLevel.ERROR)
DoubleMovementCoast("Double movement in coast", UniqueTarget.Unit),
@Deprecated("As of 3.17.1 - removed as of 3.17.13", ReplaceWith("Double movement in [terrainFilter]"), DeprecationLevel.ERROR)
@Deprecated("As of 3.17.1 - removed 3.17.13", ReplaceWith("Double movement in [terrainFilter]"), DeprecationLevel.ERROR)
DoubleMovementForestJungle("Double movement rate through Forest and Jungle", UniqueTarget.Unit),
@Deprecated("As of 3.17.1 - removed as of 3.17.13", ReplaceWith("Double movement in [terrainFilter]"), DeprecationLevel.ERROR)
@Deprecated("As of 3.17.1 - removed 3.17.13", ReplaceWith("Double movement in [terrainFilter]"), DeprecationLevel.ERROR)
DoubleMovementSnowTundraHill("Double movement in Snow, Tundra and Hills", UniqueTarget.Unit),
AllTilesCost1Move("All tiles cost 1 movement", UniqueTarget.Unit),
CanPassImpassable("Can pass through impassable tiles", UniqueTarget.Unit),