diff --git a/core/src/com/unciv/logic/battle/BattleDamage.kt b/core/src/com/unciv/logic/battle/BattleDamage.kt index e37316e75c..6cb40bcac6 100644 --- a/core/src/com/unciv/logic/battle/BattleDamage.kt +++ b/core/src/com/unciv/logic/battle/BattleDamage.kt @@ -137,7 +137,7 @@ object BattleDamage { } } - for (unique in attacker.getCivInfo().getMatchingUniques("+[]% attack strength to all [] units for [] turns")) { + for (unique in attacker.getCivInfo().getMatchingUniques("[]% attack strength to all [] units for [] turns")) { if (attacker.matchesCategory(unique.params[1])) { modifiers.add("Temporary Bonus", unique.params[0].toInt()) } @@ -231,14 +231,6 @@ object BattleDamage { if (tile.matchesFilter(filter, unit.getCivInfo())) modifiers.add(filter, unique.params[0].toInt()) } - - // Deprecated since 3.15 - for (unique in unit.getCivInfo().getMatchingUniques("+[]% combat bonus for units fighting in []")) { - 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 []")) { diff --git a/core/src/com/unciv/logic/city/CityStats.kt b/core/src/com/unciv/logic/city/CityStats.kt index 7e2d764983..375045cbda 100644 --- a/core/src/com/unciv/logic/city/CityStats.kt +++ b/core/src/com/unciv/logic/city/CityStats.kt @@ -541,11 +541,6 @@ class CityStats { for (unique in cityInfo.civInfo.getMatchingUniques("-[]% food consumption by specialists")) foodEatenBySpecialists *= 1f - unique.params[0].toFloat() / 100f - // Deprecated since 3.15 - if (cityInfo.civInfo.hasUnique("-50% food consumption by specialists")) - foodEatenBySpecialists *= 0.5f - // - foodEaten -= 2f * cityInfo.population.getNumberOfSpecialists() - foodEatenBySpecialists } } diff --git a/core/src/com/unciv/logic/civilization/CivInfoStats.kt b/core/src/com/unciv/logic/civilization/CivInfoStats.kt index b4bb21a06d..7b2d34a41b 100644 --- a/core/src/com/unciv/logic/civilization/CivInfoStats.kt +++ b/core/src/com/unciv/logic/civilization/CivInfoStats.kt @@ -47,10 +47,6 @@ class CivInfoStats(val civInfo: CivilizationInfo) { for (unique in civInfo.getMatchingUniques("-[]% unit upkeep costs")) { cost *= 1f - unique.params[0].toFloat() / 100f } - - // Deprecated since 3.15 - if (civInfo.hasUnique("-33% unit upkeep costs")) cost *= 0.67f - // return cost.toInt() } @@ -114,14 +110,6 @@ class CivInfoStats(val civInfo: CivilizationInfo) { ) ) } - // Deprecated since 3.15.1 - if (otherCiv.isCityState() && otherCiv.getDiplomacyManager(civInfo.civName).relationshipLevel() >= RelationshipLevel.Ally) { - val sciencePercentage = civInfo - .getMatchingUniques("Allied City-States provide Science equal to []% of what they produce for themselves") - .sumBy { it.params[0].toInt() } - statMap.add("City-States", Stats().apply { science = otherCiv.statsForNextTurn.science * (sciencePercentage / 100f) }) - } - // } statMap["Transportation upkeep"] = Stats().apply { gold = -getTransportationUpkeep().toFloat() } diff --git a/core/src/com/unciv/logic/civilization/CivilizationInfo.kt b/core/src/com/unciv/logic/civilization/CivilizationInfo.kt index bece99dc40..945ccbbcec 100644 --- a/core/src/com/unciv/logic/civilization/CivilizationInfo.kt +++ b/core/src/com/unciv/logic/civilization/CivilizationInfo.kt @@ -231,11 +231,6 @@ class CivilizationInfo { resourceModifier *= 1f + getMatchingUniques("Quantity of strategic resources produced by the empire +[]%") .map { it.params[0].toFloat() / 100f }.sum() - // Deprecated since 3.15 - if (hasUnique("Quantity of strategic resources produced by the empire increased by 100%")) { - resourceModifier *= 2f - } - // } return resourceModifier.toInt() } diff --git a/core/src/com/unciv/logic/map/MapUnit.kt b/core/src/com/unciv/logic/map/MapUnit.kt index c1d398c3ff..32accfe84d 100644 --- a/core/src/com/unciv/logic/map/MapUnit.kt +++ b/core/src/com/unciv/logic/map/MapUnit.kt @@ -217,11 +217,7 @@ class MapUnit { visibilityRange += getMatchingUniques("[] Visibility Range").sumBy { it.params[0].toInt() } if (hasUnique("Limited Visibility")) visibilityRange -= 1 - - // Deprecated since 3.15.6 - visibilityRange += getUniques().count { it.text == "+1 Visibility Range" } - if (hasUnique("+2 Visibility Range")) visibilityRange += 2 // This shouldn't be stackable - // + // Deprecated since 3.15.1 if (civInfo.hasUnique("+1 Sight for all land military units") && type.isMilitary() && type.isLandUnit()) visibilityRange += 1 @@ -356,11 +352,6 @@ class MapUnit { if (matchesFilter(unique.params[0])) goldCostOfUpgrade *= (1 - unique.params[1].toFloat() / 100f) } - // Deprecated since 3.14.17 - if (civInfo.hasUnique("Gold cost of upgrading military units reduced by 33%")) { - goldCostOfUpgrade *= 0.67f - } - // if (goldCostOfUpgrade < 0) return 0 // For instance, Landsknecht costs less than Spearman, so upgrading would cost negative gold return goldCostOfUpgrade.toInt() @@ -391,13 +382,7 @@ class MapUnit { } private fun adjacentHealingBonus(): Int { - var healingBonus = 0 - healingBonus += getMatchingUniques("All adjacent units heal [] HP when healing").sumBy { it.params[0].toInt() } - // Deprecated since 3.15.6 - if (hasUnique("This unit and all others in adjacent tiles heal 5 additional HP per turn")) healingBonus += 5 - if (hasUnique("This unit and all others in adjacent tiles heal 5 additional HP. This unit heals 5 additional HP outside of friendly territory.")) healingBonus += 5 - // - return healingBonus + return getMatchingUniques("All adjacent units heal [] HP when healing").sumBy { it.params[0].toInt() } } fun canGarrison() = type.isMilitary() && type.isLandUnit() @@ -527,9 +512,6 @@ class MapUnit { var amountToHealBy = rankTileForHealing(getTile()) if (amountToHealBy == 0 && !(hasUnique("May heal outside of friendly territory") && !getTile().isFriendlyTerritory(civInfo))) return - // Deprecated since 3.15.6 - if (hasUnique("+10 HP when healing")) amountToHealBy += 10 - // amountToHealBy += getMatchingUniques("[] HP when healing").sumBy { it.params[0].toInt() } val maxAdjacentHealingBonus = currentTile.getTilesInDistance(1) @@ -562,12 +544,6 @@ class MapUnit { val mayHeal = healing > 0 || (tileInfo.isWater && hasUnique("May heal outside of friendly territory")) if (!mayHeal) return healing - // Deprecated since 3.15.6 - if (hasUnique("This unit and all others in adjacent tiles heal 5 additional HP. This unit heals 5 additional HP outside of friendly territory.") - && !isFriendlyTerritory - )// Additional healing from medic is only applied when the unit is able to heal - healing += 5 - // for (unique in getMatchingUniques("[] HP when healing in [] tiles")) { if (tileInfo.matchesFilter(unique.params[1], civInfo)) { @@ -596,11 +572,6 @@ class MapUnit { getTile().improvementInProgress != null && canBuildImprovement(getTile().getTileImprovementInProgress()!!) ) workOnImprovement() - // unique "Can construct roads" deprecated since 3.15.4 - if (currentMovement > 0 && hasUnique("Can construct roads") - && currentTile.improvementInProgress == "Road" - ) workOnImprovement() - // if (currentMovement == getMaxMovement().toFloat() && isFortified()) { val currentTurnsFortified = getFortificationTurns() if (currentTurnsFortified < 2) @@ -914,9 +885,6 @@ class MapUnit { var damageFactor = 1f for (unique in getMatchingUniques("Damage taken from interception reduced by []%")) damageFactor *= 1f - unique.params[0].toFloat() / 100f - // Deprecated since 3.15.6 - damageFactor *= 0.5f.pow(getUniques().count{it.text == "Reduces damage taken from interception by 50%"}) - // End deprecation return damageFactor } diff --git a/core/src/com/unciv/models/ruleset/Unique.kt b/core/src/com/unciv/models/ruleset/Unique.kt index 496e5f75ce..c5d425b8a0 100644 --- a/core/src/com/unciv/models/ruleset/Unique.kt +++ b/core/src/com/unciv/models/ruleset/Unique.kt @@ -93,9 +93,6 @@ object UniqueTriggerActivation { "[] Free Technologies" -> if (!civInfo.isSpectator()) civInfo.tech.freeTechs += unique.params[0].toInt() "Quantity of strategic resources produced by the empire increased by 100%" -> civInfo.updateDetailedCivResources() - // Deprecated since 3.15 - "+20% attack bonus to all Military Units for 30 turns" -> civInfo.temporaryUniques.add(Pair(unique, 30)) - // "+[]% attack strength to all [] Units for [] turns" -> civInfo.temporaryUniques.add(Pair(unique, unique.params[2].toInt())) "Reveals the entire map" -> civInfo.exploredTiles.addAll(civInfo.gameInfo.tileMap.values.asSequence().map { it.position }) diff --git a/core/src/com/unciv/ui/worldscreen/unit/UnitActions.kt b/core/src/com/unciv/ui/worldscreen/unit/UnitActions.kt index f8924865ea..9368767d62 100644 --- a/core/src/com/unciv/ui/worldscreen/unit/UnitActions.kt +++ b/core/src/com/unciv/ui/worldscreen/unit/UnitActions.kt @@ -10,7 +10,6 @@ import com.unciv.logic.civilization.PlayerType import com.unciv.logic.civilization.diplomacy.DiplomacyFlags import com.unciv.logic.civilization.diplomacy.DiplomaticModifiers import com.unciv.logic.map.MapUnit -import com.unciv.logic.map.RoadStatus import com.unciv.logic.map.TileInfo import com.unciv.models.UncivSound import com.unciv.models.UnitAction @@ -58,9 +57,6 @@ object UnitActions { addSetupAction(unit, actionList) addFoundCityAction(unit, actionList, tile) addWorkerActions(unit, actionList, tile, worldScreen, unitTable) - // Deprecated since 3.15.4 - addConstructRoadsAction(unit, tile, actionList) - // addCreateWaterImprovements(unit, actionList) addGreatPersonActions(unit, actionList, tile) addFoundReligionAction(unit, actionList, tile) @@ -129,22 +125,7 @@ object UnitActions { unit.destroy() }.takeIf { unit.currentMovement > 0 }) } - - // This entire function is deprecated since 3.15.4, as the 'can construct roads' unique is deprecated - private fun addConstructRoadsAction(unit: MapUnit, tile: TileInfo, actionList: ArrayList) { - val improvement = RoadStatus.Road.improvement(unit.civInfo.gameInfo.ruleSet) ?: return - if (unit.hasUnique("Can construct roads") - && tile.roadStatus == RoadStatus.None - && tile.improvementInProgress != "Road" - && tile.isLand - && (improvement.techRequired == null || unit.civInfo.tech.isResearched(improvement.techRequired!!))) - actionList += UnitAction(UnitActionType.ConstructRoad, - action = { - tile.improvementInProgress = "Road" - tile.turnsToImprovement = improvement.getTurnsToBuild(unit.civInfo) - }.takeIf { unit.currentMovement > 0 }) - } - // + private fun addFoundCityAction(unit: MapUnit, actionList: ArrayList, tile: TileInfo) { val getFoundCityAction = getFoundCityAction(unit, tile)