mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-24 20:31:51 -04:00
Merge pull request #7513 from SimonCeder/automated-ruins
workers will replace city ruins
This commit is contained in:
commit
026ba380cc
@ -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"}]
|
||||
},
|
||||
{
|
||||
|
@ -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"}]
|
||||
},
|
||||
{
|
||||
|
@ -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
|
||||
|
@ -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 /////////////////////////////////////////
|
||||
|
@ -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"
|
||||
|
Loading…
x
Reference in New Issue
Block a user