mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-24 10:01:39 +07:00
Worker automation takes city focus and civ personality into account
This commit is contained in:
parent
ece8fe9a5c
commit
a9595549bc
@ -410,7 +410,10 @@ class WorkerAutomation(
|
||||
if (tile.getOwner() != unit.civ)
|
||||
stats.div(3f)
|
||||
|
||||
var value = Automation.rankStatsValue(stats, unit.civ)
|
||||
val city = tile.getWorkingCity() ?: tile.owningCity ?: tile.getTilesInDistance(3).firstOrNull { it.isCityCenter() }?.getCity()
|
||||
var value = if (city != null) Automation.rankStatsForCityWork(stats, city, false, localUniqueCache)
|
||||
else Automation.rankStatsValue(stats, unit.civ)
|
||||
|
||||
// Calculate the bonus from gaining the resources, this isn't included in the stats above
|
||||
if (tile.resource != null && tile.tileResource.resourceType != ResourceType.Bonus) {
|
||||
// A better resource ranking system might be required, we don't want the improvement
|
||||
|
Loading…
Reference in New Issue
Block a user