diff --git a/core/src/com/unciv/logic/automation/unit/SpecificUnitAutomation.kt b/core/src/com/unciv/logic/automation/unit/SpecificUnitAutomation.kt index c9e2479dcc..2aa39716d1 100644 --- a/core/src/com/unciv/logic/automation/unit/SpecificUnitAutomation.kt +++ b/core/src/com/unciv/logic/automation/unit/SpecificUnitAutomation.kt @@ -242,8 +242,6 @@ object SpecificUnitAutomation { fun automateImprovementPlacer(unit: MapUnit) { var improvementBuildingUniques = unit.getMatchingUniques(UniqueType.ConstructImprovementConsumingUnit) - if (unit.religiousActionsUnitCanDo().all { unit.abilityUsesLeft[it] == unit.maxAbilityUses[it] }) - improvementBuildingUniques += unit.getMatchingUniques(UniqueType.CanConstructIfNoOtherActions) val improvementName = improvementBuildingUniques.first().params[0] val improvement = unit.civInfo.gameInfo.ruleSet.tileImprovements[improvementName] diff --git a/core/src/com/unciv/logic/automation/unit/UnitAutomation.kt b/core/src/com/unciv/logic/automation/unit/UnitAutomation.kt index c718792a53..08d4ff323e 100644 --- a/core/src/com/unciv/logic/automation/unit/UnitAutomation.kt +++ b/core/src/com/unciv/logic/automation/unit/UnitAutomation.kt @@ -3,7 +3,11 @@ package com.unciv.logic.automation.unit import com.unciv.Constants import com.unciv.logic.automation.Automation import com.unciv.logic.automation.civilization.NextTurnAutomation -import com.unciv.logic.battle.* +import com.unciv.logic.battle.Battle +import com.unciv.logic.battle.BattleDamage +import com.unciv.logic.battle.CityCombatant +import com.unciv.logic.battle.ICombatant +import com.unciv.logic.battle.MapUnitCombatant import com.unciv.logic.city.CityInfo import com.unciv.logic.civilization.ReligionState import com.unciv.logic.civilization.diplomacy.DiplomaticStatus @@ -178,13 +182,10 @@ object UnitAutomation { if (unit.hasUnique(UniqueType.PreventSpreadingReligion) || unit.canDoReligiousAction(Constants.removeHeresy)) return SpecificUnitAutomation.automateInquisitor(unit) - if (unit.hasUnique(UniqueType.ConstructImprovementConsumingUnit) - || (unit.hasUnique(UniqueType.CanConstructIfNoOtherActions) - && unit.religiousActionsUnitCanDo().all { unit.abilityUsesLeft[it] == unit.maxAbilityUses[it] })) + if (unit.hasUnique(UniqueType.ConstructImprovementConsumingUnit)) // catch great prophet for civs who can't found/enhance/spread religion return SpecificUnitAutomation.automateImprovementPlacer(unit) // includes great people plus moddable units - // ToDo: automation of great people skills (may speed up construction, provides a science boost, etc.) return // The AI doesn't know how to handle unknown civilian units diff --git a/core/src/com/unciv/logic/city/CityStats.kt b/core/src/com/unciv/logic/city/CityStats.kt index 5b3b957efd..9b9c79d9d2 100644 --- a/core/src/com/unciv/logic/city/CityStats.kt +++ b/core/src/com/unciv/logic/city/CityStats.kt @@ -116,9 +116,6 @@ class CityStats(val cityInfo: CityInfo) { val conversionUnique = cityInfo.civInfo.getMatchingUniques(UniqueType.ProductionToCivWideStatConversionBonus).firstOrNull { it.params[0] == stat.name } if (conversionUnique != null) { conversionRate *= conversionUnique.params[1].toPercent() - } else if (stat == Stat.Science && cityInfo.civInfo.hasUnique(UniqueType.ProductionToScienceConversionBonus)) { - // backwards compatibility - conversionRate *= 1.33f } return conversionRate } diff --git a/core/src/com/unciv/logic/city/IConstruction.kt b/core/src/com/unciv/logic/city/IConstruction.kt index 2af333ab14..9ae104f95f 100644 --- a/core/src/com/unciv/logic/city/IConstruction.kt +++ b/core/src/com/unciv/logic/city/IConstruction.kt @@ -248,10 +248,6 @@ open class PerpetualStatConversion(val stat: Stat) : override fun isBuildable(cityConstructions: CityConstructions): Boolean { val hasProductionUnique = cityConstructions.cityInfo.civInfo.getMatchingUniques(UniqueType.EnablesCivWideStatProduction).any { it.params[0] == stat.name } return when (stat) { - Stat.Science -> hasProductionUnique - || cityConstructions.cityInfo.civInfo.hasUnique(UniqueType.EnablesScienceProduction) // backwards compatibility - Stat.Gold -> hasProductionUnique - || cityConstructions.cityInfo.civInfo.hasUnique(UniqueType.EnablesGoldProduction) // backwards compatibility Stat.Culture -> hasProductionUnique Stat.Faith -> cityConstructions.cityInfo.civInfo.gameInfo.isReligionEnabled() && hasProductionUnique else -> false diff --git a/core/src/com/unciv/logic/map/TileInfo.kt b/core/src/com/unciv/logic/map/TileInfo.kt index 74c0e51149..f8ce8d1ca3 100644 --- a/core/src/com/unciv/logic/map/TileInfo.kt +++ b/core/src/com/unciv/logic/map/TileInfo.kt @@ -321,11 +321,6 @@ open class TileInfo : IsPartOfGameInfoSerialization { if (naturalWonder != null) { val wonderStats = getNaturalWonder().cloneStats() - // Spain doubles tile yield - if (city != null && city.civInfo.hasUnique(UniqueType.DoubleStatsFromNaturalWonders, stateForConditionals)) { - wonderStats.timesInPlace(2f) - } - if (getNaturalWonder().overrideStats) stats = wonderStats else @@ -340,12 +335,6 @@ open class TileInfo : IsPartOfGameInfoSerialization { val tileType = unique.params[1] if (!matchesTerrainFilter(tileType, observingCiv)) continue stats.add(unique.stats) - if (naturalWonder != null - && tileType == "Natural Wonder" - && city.civInfo.hasUnique(UniqueType.DoubleStatsFromNaturalWonders) - ) { - stats.add(unique.stats) - } } for (unique in localUniqueCache.get("StatsFromTilesWithout", diff --git a/core/src/com/unciv/models/ruleset/unique/UniqueType.kt b/core/src/com/unciv/models/ruleset/unique/UniqueType.kt index b1b8a433ab..6f120ba3d3 100644 --- a/core/src/com/unciv/models/ruleset/unique/UniqueType.kt +++ b/core/src/com/unciv/models/ruleset/unique/UniqueType.kt @@ -106,9 +106,6 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags: PercentProductionUnits("[relativeAmount]% Production when constructing [baseUnitFilter] units [cityFilter]", UniqueTarget.Global, UniqueTarget.FollowerBelief), PercentProductionWonders("[relativeAmount]% Production when constructing [buildingFilter] wonders [cityFilter]", UniqueTarget.Global, UniqueTarget.FollowerBelief), PercentProductionBuildingsInCapital("[relativeAmount]% Production towards any buildings that already exist in the Capital", UniqueTarget.Global, UniqueTarget.FollowerBelief), - // todo: maybe should be converted to "[+100]% Yield from every [Natural Wonder]"? - @Deprecated("As of 4.1.19", ReplaceWith("[+100]% Yield from every [Natural Wonder]")) - DoubleStatsFromNaturalWonders("Tile yields from Natural Wonders doubled", UniqueTarget.Global), //endregion Stat providing uniques @@ -180,11 +177,6 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags: BuyUnitsByProductionCost("May buy [baseUnitFilter] units with [stat] for [amount] times their normal Production cost", UniqueTarget.FollowerBelief, UniqueTarget.Global), BuyBuildingsByProductionCost("May buy [buildingFilter] buildings with [stat] for [amount] times their normal Production cost", UniqueTarget.FollowerBelief, UniqueTarget.Global), - - @Deprecated("As of 4.1.14", ReplaceWith("Enables conversion of city production to [Gold]")) - EnablesGoldProduction("Enables conversion of city production to gold", UniqueTarget.Global), - @Deprecated("s of 4.1.14", ReplaceWith("Enables conversion of city production to [Science]")) - EnablesScienceProduction("Enables conversion of city production to science", UniqueTarget.Global), EnablesCivWideStatProduction("Enables conversion of city production to [civWideStat]", UniqueTarget.Global), BuyItemsDiscount("[stat] cost of purchasing items in cities [relativeAmount]%", UniqueTarget.Global, UniqueTarget.FollowerBelief), @@ -219,8 +211,6 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags: @Deprecated("As of 4.2.4", ReplaceWith("Enemy [Land] units must spend [1] extra movement points when inside your territory ")) EnemyLandUnitsSpendExtraMovementDepreciated("Enemy land units must spend 1 extra movement point when inside your territory (obsolete upon Dynamite)", UniqueTarget.Global), - @Deprecated("s of 4.1.14", ReplaceWith("Production to [Science] conversion in cities changed by [33]%")) - ProductionToScienceConversionBonus("Production to science conversion in cities increased by 33%", UniqueTarget.Global), ProductionToCivWideStatConversionBonus("Production to [civWideStat] conversion in cities changed by [relativeAmount]%", UniqueTarget.Global), // Misc national uniques @@ -356,8 +346,6 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags: FoundCity("Founds a new city", UniqueTarget.Unit), ConstructImprovementConsumingUnit("Can construct [improvementName]", UniqueTarget.Unit), - @Deprecated("as of 4.1.7", ReplaceWith("Can construct [improvementName] ")) - CanConstructIfNoOtherActions("Can construct [improvementName] if it hasn't used other actions yet", UniqueTarget.Unit), BuildImprovements("Can build [improvementFilter/terrainFilter] improvements on tiles", UniqueTarget.Unit), CreateWaterImprovements("May create improvements on water resources", UniqueTarget.Unit), @@ -716,6 +704,17 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags: // endregion // region DEPRECATED AND REMOVED + + @Deprecated("as of 4.1.7", ReplaceWith("Can construct [improvementName] ")) + CanConstructIfNoOtherActions("Can construct [improvementName] if it hasn't used other actions yet", UniqueTarget.Unit), + @Deprecated("s of 4.1.14", ReplaceWith("Production to [Science] conversion in cities changed by [33]%")) + ProductionToScienceConversionBonus("Production to science conversion in cities increased by 33%", UniqueTarget.Global), + @Deprecated("As of 4.1.19", ReplaceWith("[+100]% Yield from every [Natural Wonder]")) + DoubleStatsFromNaturalWonders("Tile yields from Natural Wonders doubled", UniqueTarget.Global), + @Deprecated("As of 4.1.14", ReplaceWith("Enables conversion of city production to [Gold]")) + EnablesGoldProduction("Enables conversion of city production to gold", UniqueTarget.Global), + @Deprecated("s of 4.1.14", ReplaceWith("Enables conversion of city production to [Science]")) + EnablesScienceProduction("Enables conversion of city production to science", UniqueTarget.Global), @Deprecated("as of 4.0.3", ReplaceWith("Damage is ignored when determining unit Strength "), DeprecationLevel.ERROR) UnitsFightFullStrengthWhenDamaged("Units fight as though they were at full strength even when damaged", UniqueTarget.Global), @Deprecated("as of 4.0.3", ReplaceWith("[+amount]% Strength "), DeprecationLevel.ERROR) diff --git a/core/src/com/unciv/ui/worldscreen/unit/UnitActions.kt b/core/src/com/unciv/ui/worldscreen/unit/UnitActions.kt index f53ea31e18..5329244d53 100644 --- a/core/src/com/unciv/ui/worldscreen/unit/UnitActions.kt +++ b/core/src/com/unciv/ui/worldscreen/unit/UnitActions.kt @@ -702,9 +702,7 @@ object UnitActions { fun getImprovementConstructionActions(unit: MapUnit, tile: TileInfo): ArrayList { val finalActions = ArrayList() - var uniquesToCheck = unit.getMatchingUniques(UniqueType.ConstructImprovementConsumingUnit) - if (unit.religiousActionsUnitCanDo().all { unit.abilityUsesLeft[it] == unit.maxAbilityUses[it] }) - uniquesToCheck += unit.getMatchingUniques(UniqueType.CanConstructIfNoOtherActions) + val uniquesToCheck = unit.getMatchingUniques(UniqueType.ConstructImprovementConsumingUnit) val civResources = unit.civInfo.getCivResourcesByName() for (unique in uniquesToCheck) {