mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-24 03:53:12 -04:00
Update WorkerAutomation.kt (#13828)
This commit is contained in:
parent
c01d72feb6
commit
866597ea73
@ -100,10 +100,6 @@ class WorkerAutomation(
|
|||||||
// Support Alpha Frontier-Style Workers that _also_ have the "May create improvements on water resources" unique
|
// Support Alpha Frontier-Style Workers that _also_ have the "May create improvements on water resources" unique
|
||||||
if (unit.cache.hasUniqueToCreateWaterImprovements && automateWorkBoats(unit)) return
|
if (unit.cache.hasUniqueToCreateWaterImprovements && automateWorkBoats(unit)) return
|
||||||
|
|
||||||
// Priotirize connecting grown cities without connection to capital over undeveloped cities (for gold income)
|
|
||||||
val grownCities: List<City> = citiesToConnect.filter { it.population.population > 6 }
|
|
||||||
if (roadBetweenCitiesAutomation.tryConnectingCities(unit, grownCities)) return
|
|
||||||
|
|
||||||
if (tryHeadTowardsUndevelopedCity(unit, localUniqueCache, currentTile)) return
|
if (tryHeadTowardsUndevelopedCity(unit, localUniqueCache, currentTile)) return
|
||||||
|
|
||||||
// Nothing to do, try again to connect cities
|
// Nothing to do, try again to connect cities
|
||||||
@ -298,13 +294,10 @@ class WorkerAutomation(
|
|||||||
|
|
||||||
if (tile.hasViewableResource(civInfo)) {
|
if (tile.hasViewableResource(civInfo)) {
|
||||||
priority += 1
|
priority += 1
|
||||||
if (tile.tileResource.resourceType == ResourceType.Luxury) priority += 3
|
if (tile.tileResource.resourceType == ResourceType.Luxury) priority += 5
|
||||||
//luxuries are more important than other types of resources
|
//luxuries are more important than other types of resources
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tile in roadBetweenCitiesAutomation.tilesOfRoadsMap)
|
|
||||||
priority += 3
|
|
||||||
|
|
||||||
tileRankings[tile] = TileImprovementRank(priority)
|
tileRankings[tile] = TileImprovementRank(priority)
|
||||||
return priority + unitSpecificPriority
|
return priority + unitSpecificPriority
|
||||||
}
|
}
|
||||||
@ -456,7 +449,7 @@ class WorkerAutomation(
|
|||||||
if (improvement.isRoad() && roadBetweenCitiesAutomation.bestRoadAvailable.improvement(ruleSet) == improvement
|
if (improvement.isRoad() && roadBetweenCitiesAutomation.bestRoadAvailable.improvement(ruleSet) == improvement
|
||||||
&& tile in roadBetweenCitiesAutomation.tilesOfRoadsMap) {
|
&& tile in roadBetweenCitiesAutomation.tilesOfRoadsMap) {
|
||||||
val roadPlan = roadBetweenCitiesAutomation.tilesOfRoadsMap[tile]!!
|
val roadPlan = roadBetweenCitiesAutomation.tilesOfRoadsMap[tile]!!
|
||||||
val value = (roadPlan.priority - 5) // We want some forest chopping and farm building first if the road doesn't have high priority
|
val value = (roadPlan.priority - 9) // We want some forest chopping and farm building first if the road doesn't have high priority
|
||||||
return value
|
return value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user