diff --git a/android/assets/jsons/Civ V - Gods & Kings/TileImprovements.json b/android/assets/jsons/Civ V - Gods & Kings/TileImprovements.json index 65f1275088e76..92aa35876853d 100644 --- a/android/assets/jsons/Civ V - Gods & Kings/TileImprovements.json +++ b/android/assets/jsons/Civ V - Gods & Kings/TileImprovements.json @@ -194,25 +194,30 @@ "name": "Academy", "terrainsCanBeBuiltOn": ["Land"], "science": 8, - "uniques": ["Great Improvement", "[+2 Science] ", "[+2 Science] ", "Removes removable features when built", "Pillaging this improvement yields approximately [+20 Gold]"] + "uniques": ["Great Improvement", "[+2 Science] ", + "[+2 Science] ", "Removes removable features when built", + "Will not be replaced by automated units", "Pillaging this improvement yields approximately [+20 Gold]"] }, { "name": "Landmark", "terrainsCanBeBuiltOn": ["Land"], "culture": 6, - "uniques": ["Great Improvement", "Removes removable features when built", "Pillaging this improvement yields approximately [+20 Gold]"] + "uniques": ["Great Improvement", "Removes removable features when built", + "Will not be replaced by automated units", "Pillaging this improvement yields approximately [+20 Gold]"] }, { "name": "Manufactory", "terrainsCanBeBuiltOn": ["Land"], "production": 4, - "uniques": ["Great Improvement", "[+1 Production] ", "Removes removable features when built", "Pillaging this improvement yields approximately [+20 Gold]"] + "uniques": ["Great Improvement", "[+1 Production] ", "Will not be replaced by automated units", + "Removes removable features when built", "Pillaging this improvement yields approximately [+20 Gold]"] }, { "name": "Customs house", "terrainsCanBeBuiltOn": ["Land"], "gold": 4, - "uniques": ["Great Improvement", "[+1 Gold] ", "Removes removable features when built", "Pillaging this improvement yields approximately [+20 Gold]"] + "uniques": ["Great Improvement", "[+1 Gold] ", "Removes removable features when built", + "Will not be replaced by automated units", "Pillaging this improvement yields approximately [+20 Gold]"] }, { "name": "Holy site", @@ -230,6 +235,7 @@ "Can be built just outside your borders", "Constructing it will take over the tiles around it and assign them to your closest city", "Removes removable features when built", + "Will not be replaced by automated units" ] }, @@ -278,7 +284,7 @@ { "name": "City ruins", "terrainsCanBeBuiltOn": ["Land"], - "uniques": ["Unpillagable", "Unbuildable", "Will be replaced by automated workers"], + "uniques": ["Unpillagable", "Unbuildable", "Will be replaced by automated units"], "civilopediaText": [{"text":"A bleak reminder of the destruction wreaked by War"}] }, { diff --git a/android/assets/jsons/Civ V - Vanilla/TileImprovements.json b/android/assets/jsons/Civ V - Vanilla/TileImprovements.json index ac1cac3b07a00..db7614e4cc028 100644 --- a/android/assets/jsons/Civ V - Vanilla/TileImprovements.json +++ b/android/assets/jsons/Civ V - Vanilla/TileImprovements.json @@ -193,31 +193,36 @@ "name": "Academy", "terrainsCanBeBuiltOn": ["Land"], "science": 8, - "uniques": ["Great Improvement", "[+2 Science] ", "Removes removable features when built", "Pillaging this improvement yields approximately [+20 Gold]"] + "uniques": ["Great Improvement", "[+2 Science] ", "Will not be replaced by automated units", + "Removes removable features when built", "Pillaging this improvement yields approximately [+20 Gold]"] }, { "name": "Landmark", "terrainsCanBeBuiltOn": ["Land"], "culture": 6, - "uniques": ["Great Improvement", "Removes removable features when built", "Pillaging this improvement yields approximately [+20 Gold]"] + "uniques": ["Great Improvement", "Removes removable features when built", + "Will not be replaced by automated units", "Pillaging this improvement yields approximately [+20 Gold]"] }, { "name": "Manufactory", "terrainsCanBeBuiltOn": ["Land"], "production": 4, - "uniques": ["Great Improvement", "[+1 Production] ", "Removes removable features when built", "Pillaging this improvement yields approximately [+20 Gold]"] + "uniques": ["Great Improvement", "[+1 Production] ", "Removes removable features when built", + "Will not be replaced by automated units", "Pillaging this improvement yields approximately [+20 Gold]"] }, { "name": "Customs house", "terrainsCanBeBuiltOn": ["Land"], "gold": 4, - "uniques": ["Great Improvement", "[+1 Gold] ", "Removes removable features when built", "Pillaging this improvement yields approximately [+20 Gold]"] + "uniques": ["Great Improvement", "[+1 Gold] ", "Removes removable features when built", + "Will not be replaced by automated units", "Pillaging this improvement yields approximately [+20 Gold]"] }, { "name": "Holy site", "terrainsCanBeBuiltOn": ["Land"], "faith": 6, - "uniques": ["Great Improvement", "Removes removable features when built", "Pillaging this improvement yields approximately [+20 Gold]"] + "uniques": ["Great Improvement", "Removes removable features when built", + "Will not be replaced by automated units", "Pillaging this improvement yields approximately [+20 Gold]"] }, { "name": "Citadel", @@ -229,6 +234,7 @@ "Can be built just outside your borders", "Constructing it will take over the tiles around it and assign them to your closest city", "Removes removable features when built", + "Will not be replaced by automated units" ] }, @@ -267,7 +273,7 @@ { "name": "City ruins", "terrainsCanBeBuiltOn": ["Land"], - "uniques": ["Unpillagable", "Unbuildable", "Will be replaced by automated workers"], + "uniques": ["Unpillagable", "Unbuildable", "Will be replaced by automated units"], "civilopediaText": [{"text":"A bleak reminder of the destruction wreaked by War"}] }, { diff --git a/core/src/com/unciv/logic/automation/Automation.kt b/core/src/com/unciv/logic/automation/Automation.kt index abb85b7668f7f..9eb27f4751cf5 100644 --- a/core/src/com/unciv/logic/automation/Automation.kt +++ b/core/src/com/unciv/logic/automation/Automation.kt @@ -369,7 +369,9 @@ object Automation { fun getTileForConstructionImprovement(city: City, improvement: TileImprovement): Tile? { val localUniqueCache = LocalUniqueCache() return city.getTiles().filter { - it.improvementFunctions.canBuildImprovement(improvement, city.civ) + it.getTileImprovement()?.hasUnique(UniqueType.AutomatedUnitsWillNotReplace, + StateForConditionals(city.civ, city, tile = it)) == false + && it.improvementFunctions.canBuildImprovement(improvement, city.civ) }.maxByOrNull { rankTileForCityWork(it, city, localUniqueCache) } diff --git a/core/src/com/unciv/models/ruleset/unique/UniqueType.kt b/core/src/com/unciv/models/ruleset/unique/UniqueType.kt index 48d005317b9f6..8afd661150e82 100644 --- a/core/src/com/unciv/models/ruleset/unique/UniqueType.kt +++ b/core/src/com/unciv/models/ruleset/unique/UniqueType.kt @@ -628,7 +628,7 @@ enum class UniqueType( PillageYieldRandom("Pillaging this improvement yields approximately [stats]", UniqueTarget.Improvement), PillageYieldFixed("Pillaging this improvement yields [stats]", UniqueTarget.Improvement), Irremovable("Irremovable", UniqueTarget.Improvement), - AutomatedWorkersWillReplace("Will be replaced by automated workers", UniqueTarget.Improvement), + AutomatedUnitsWillNotReplace("Will not be replaced by automated units", UniqueTarget.Improvement), //endregion /////////////////////////////////// region 07 PERSONALITY UNIQUES //////////////////////////////////////// diff --git a/docs/Modders/uniques.md b/docs/Modders/uniques.md index d4c3f48502fe2..0b81c808d9e0f 100644 --- a/docs/Modders/uniques.md +++ b/docs/Modders/uniques.md @@ -1797,6 +1797,9 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl ??? example "Will be replaced by automated workers" Applicable to: Improvement +??? example "Will not be replaced by automated workers" + Applicable to: Improvement + ## Resource uniques ??? example "Deposits in [tileFilter] tiles always provide [amount] resources" Example: "Deposits in [Farm] tiles always provide [3] resources" diff --git a/tests/src/com/unciv/testing/BasicTests.kt b/tests/src/com/unciv/testing/BasicTests.kt index a5b4e2e19ce04..8d8c33a029b27 100644 --- a/tests/src/com/unciv/testing/BasicTests.kt +++ b/tests/src/com/unciv/testing/BasicTests.kt @@ -8,7 +8,6 @@ import com.unciv.models.metadata.BaseRuleset import com.unciv.models.metadata.GameSettings import com.unciv.models.ruleset.Ruleset import com.unciv.models.ruleset.RulesetCache -import com.unciv.models.ruleset.RulesetStatsObject import com.unciv.models.ruleset.unique.Unique import com.unciv.models.ruleset.unique.UniqueParameterType import com.unciv.models.ruleset.unique.UniqueType @@ -176,24 +175,6 @@ class BasicTests { Assert.assertTrue("This test succeeds only if all uniques of promotions are presented in UniqueType.values()", allOK) } - @Test - fun allTerrainRelatedUniquesHaveTheirUniqueTypes() { - val objects : MutableCollection = mutableListOf() - objects.addAll(ruleset.tileImprovements.values) - objects.addAll(ruleset.tileResources.values) - objects.addAll(ruleset.terrains.values) - var allOK = true - for (obj in objects) { - for (unique in obj.uniques) { - if (!UniqueType.values().any { it.placeholderText == unique.getPlaceholderText() }) { - debug("%s: %s", obj.name, unique) - allOK = false - } - } - } - Assert.assertTrue("This test succeeds only if all uniques are presented in UniqueType.values()", allOK) - } - @Test fun allPolicyRelatedUniquesHaveTheirUniqueTypes() { val policies = ruleset.policies.values