Merge pull request #7513 from SimonCeder/automated-ruins

workers will replace city ruins
This commit is contained in:
SimonCeder 2022-07-25 22:23:27 +02:00 committed by GitHub
commit 026ba380cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 4 deletions

View File

@ -266,7 +266,7 @@
{
"name": "City ruins",
"terrainsCanBeBuiltOn": ["Land"],
"uniques": ["Unpillagable", "Unbuildable"],
"uniques": ["Unpillagable", "Unbuildable", "Will be replaced by automated workers"],
"civilopediaText": [{"text":"A bleak reminder of the destruction wreaked by War"}]
},
{

View File

@ -256,7 +256,7 @@
{
"name": "City ruins",
"terrainsCanBeBuiltOn": ["Land"],
"uniques": ["Unpillagable", "Unbuildable"],
"uniques": ["Unpillagable", "Unbuildable", "Will be replaced by automated workers"],
"civilopediaText": [{"text":"A bleak reminder of the destruction wreaked by War"}]
},
{

View File

@ -285,12 +285,13 @@ class WorkerAutomation(
val city = tile.getCity()
if (city == null || city.civInfo != civInfo)
return false
if (tile.improvement != null && !UncivGame.Current.settings.automatedWorkersReplaceImprovements) {
val junkImprovement = tile.getTileImprovement()?.hasUnique(UniqueType.AutomatedWorkersWillReplace)
if (tile.improvement != null && junkImprovement == false && !UncivGame.Current.settings.automatedWorkersReplaceImprovements) {
if (unit.civInfo.isPlayerCivilization())
return false
}
if (tile.improvement == null) {
if (tile.improvement == null || junkImprovement == true) {
if (tile.improvementInProgress != null && unit.canBuildImprovement(tile.getTileImprovementInProgress()!!, tile)) return true
val chosenImprovement = chooseImprovement(unit, tile)
if (chosenImprovement != null && tile.canBuildImprovement(chosenImprovement, civInfo) && unit.canBuildImprovement(chosenImprovement, tile)) return true

View File

@ -582,6 +582,7 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags:
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),
//endregion
///////////////////////////////////////// region CONDITIONALS /////////////////////////////////////////

View File

@ -1504,6 +1504,9 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl
??? example "Irremovable"
Applicable to: Improvement
??? example "Automated workers will replace"
Applicable to: Improvement
## Resource uniques
??? example "Deposits in [tileFilter] tiles always provide [amount] resources"
Example: "Deposits in [Farm] tiles always provide [3] resources"