mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-24 03:53:12 -04:00
Update (#13795)
This commit is contained in:
parent
2fe9bd2f6d
commit
a90cbadc35
@ -112,8 +112,7 @@ object CityLocationTileRanker {
|
|||||||
// Settling on luxuries generally speeds up our game, and settling on strategics as well, as the AI cheats and can see them.
|
// Settling on luxuries generally speeds up our game, and settling on strategics as well, as the AI cheats and can see them.
|
||||||
|
|
||||||
var tiles = 0
|
var tiles = 0
|
||||||
val cityWorkRange = civ.gameInfo.ruleset.modOptions.constants.cityWorkRange
|
for (i in 0..2) {
|
||||||
for (i in 0..cityWorkRange) {
|
|
||||||
//Ideally, we shouldn't really count the center tile, as it's converted into 1 production 2 food anyways with special cases treated above, but doing so can lead to AI moving settler back and forth until forever
|
//Ideally, we shouldn't really count the center tile, as it's converted into 1 production 2 food anyways with special cases treated above, but doing so can lead to AI moving settler back and forth until forever
|
||||||
for (nearbyTile in newCityTile.getTilesAtDistance(i)) {
|
for (nearbyTile in newCityTile.getTilesAtDistance(i)) {
|
||||||
tiles++
|
tiles++
|
||||||
@ -159,7 +158,7 @@ object CityLocationTileRanker {
|
|||||||
if (rankTile.getCity() != null) return -1f
|
if (rankTile.getCity() != null) return -1f
|
||||||
var locationSpecificTileValue = 0f
|
var locationSpecificTileValue = 0f
|
||||||
// Don't settle near but not on the coast
|
// Don't settle near but not on the coast
|
||||||
if (rankTile.isCoastalTile() && !onCoast) locationSpecificTileValue -= 2
|
if (rankTile.isWater && !onCoast) locationSpecificTileValue -= 1
|
||||||
// Check if there are any new unique luxury resources
|
// Check if there are any new unique luxury resources
|
||||||
if (rankTile.hasViewableResource(civ) && rankTile.tileResource.resourceType == ResourceType.Luxury
|
if (rankTile.hasViewableResource(civ) && rankTile.tileResource.resourceType == ResourceType.Luxury
|
||||||
&& !(civ.hasResource(rankTile.resource!!) || newUniqueLuxuryResources.contains(rankTile.resource))) {
|
&& !(civ.hasResource(rankTile.resource!!) || newUniqueLuxuryResources.contains(rankTile.resource))) {
|
||||||
@ -175,14 +174,14 @@ object CityLocationTileRanker {
|
|||||||
|
|
||||||
if (rankTile.hasViewableResource(civ)) {
|
if (rankTile.hasViewableResource(civ)) {
|
||||||
rankTileValue += when (rankTile.tileResource.resourceType) {
|
rankTileValue += when (rankTile.tileResource.resourceType) {
|
||||||
ResourceType.Bonus -> 2f
|
ResourceType.Bonus -> 1f
|
||||||
ResourceType.Strategic -> 1.2f * rankTile.resourceAmount
|
ResourceType.Strategic -> 2f
|
||||||
ResourceType.Luxury -> 10f * rankTile.resourceAmount //very important for humans who might want to conquer the AI
|
ResourceType.Luxury -> 10f //very important for humans who might want to conquer the AI
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (rankTile.terrainHasUnique(UniqueType.FreshWater)) rankTileValue += 0.5f
|
if (rankTile.terrainHasUnique(UniqueType.FreshWater)) rankTileValue += 0.5f
|
||||||
//Taking into account freshwater farm food, maybe less important in baseruleset mods
|
//Taking into account freshwater farm food, maybe less important in baseruleset mods
|
||||||
if (rankTile.terrainFeatures.isNotEmpty() && rankTile.lastTerrain.hasUnique(UniqueType.ProductionBonusWhenRemoved)) rankTileValue += 0.5f
|
if (rankTile.terrainFeatures.isNotEmpty() && rankTile.lastTerrain.hasUnique(UniqueType.ProductionBonusWhenRemoved)) rankTileValue += 0.7f
|
||||||
//Taking into account yields from forest chopping
|
//Taking into account yields from forest chopping
|
||||||
|
|
||||||
if (rankTile.isNaturalWonder()) rankTileValue += 10
|
if (rankTile.isNaturalWonder()) rankTileValue += 10
|
||||||
|
@ -114,7 +114,7 @@ object SpecificUnitAutomation {
|
|||||||
|
|
||||||
// It's possible that we'll see a tile "over the sea" that's better than the tiles close by, but that's not a reason to abandon the close tiles!
|
// It's possible that we'll see a tile "over the sea" that's better than the tiles close by, but that's not a reason to abandon the close tiles!
|
||||||
// Also this lead to some routing problems, see https://github.com/yairm210/Unciv/issues/3653
|
// Also this lead to some routing problems, see https://github.com/yairm210/Unciv/issues/3653
|
||||||
val bestTilesInfo = CityLocationTileRanker.getBestTilesToFoundCity(unit, rangeToSearch, 30f)
|
val bestTilesInfo = CityLocationTileRanker.getBestTilesToFoundCity(unit, rangeToSearch, 20f)
|
||||||
var bestCityLocation: Tile? = null
|
var bestCityLocation: Tile? = null
|
||||||
|
|
||||||
if (unit.civ.gameInfo.turns == 0 && unit.civ.cities.isEmpty() && bestTilesInfo.tileRankMap.containsKey(unit.getTile())) { // Special case, we want AI to settle in place on turn 1.
|
if (unit.civ.gameInfo.turns == 0 && unit.civ.cities.isEmpty() && bestTilesInfo.tileRankMap.containsKey(unit.getTile())) { // Special case, we want AI to settle in place on turn 1.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user