From 9559894a8670f68b086304d6fda518dc8981bc90 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Mon, 8 Jul 2019 18:37:24 +0300 Subject: [PATCH] Military units no longer try to accompany great generals - great geenerals should follow the army units, not the other way round! Culture building priority is dependant on whether the city is producing culture at all Gold is now less highly valued by the AI when picking tiles to work --- core/src/com/unciv/logic/automation/Automation.kt | 2 +- core/src/com/unciv/logic/automation/ConstructionAutomation.kt | 4 +++- core/src/com/unciv/logic/automation/UnitAutomation.kt | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/core/src/com/unciv/logic/automation/Automation.kt b/core/src/com/unciv/logic/automation/Automation.kt index 1dbe0ded79..05e700d5cc 100644 --- a/core/src/com/unciv/logic/automation/Automation.kt +++ b/core/src/com/unciv/logic/automation/Automation.kt @@ -35,7 +35,7 @@ class Automation { else rank += (2.4f + (stats.food - 2) / 2) // 1.2 point for each food up to 2, from there on half a point if (civInfo.gold < 0 && civInfo.statsForNextTurn.gold <= 0) rank += stats.gold - else rank += stats.gold / 2 + else rank += stats.gold / 3 // 3 gold is much worse than 2 production rank += stats.production rank += stats.science diff --git a/core/src/com/unciv/logic/automation/ConstructionAutomation.kt b/core/src/com/unciv/logic/automation/ConstructionAutomation.kt index 3495f433b7..ac1719a866 100644 --- a/core/src/com/unciv/logic/automation/ConstructionAutomation.kt +++ b/core/src/com/unciv/logic/automation/ConstructionAutomation.kt @@ -120,7 +120,9 @@ class ConstructionAutomation(val cityConstructions: CityConstructions){ private fun addCultureBuildingChoice() { val cultureBuilding = buildableNotWonders.filter { it.isStatRelated(Stat.Culture) }.minBy { it.cost } if (cultureBuilding != null) { - var modifier = 0.8f + var modifier = 0.5f + if(cityInfo.cityStats.currentCityStats.culture==0f) // It won't grow if we don't help it + modifier=0.8f if (preferredVictoryType == VictoryType.Cultural) modifier = 1.6f addChoice(relativeCostEffectiveness, cultureBuilding.name, modifier) } diff --git a/core/src/com/unciv/logic/automation/UnitAutomation.kt b/core/src/com/unciv/logic/automation/UnitAutomation.kt index d20a2ce68a..6468bdea97 100644 --- a/core/src/com/unciv/logic/automation/UnitAutomation.kt +++ b/core/src/com/unciv/logic/automation/UnitAutomation.kt @@ -231,7 +231,7 @@ class UnitAutomation{ private fun tryAccompanySettlerOrGreatPerson(unit: MapUnit): Boolean { val settlerOrGreatPersonToAccompany = unit.civInfo.getCivUnits() .firstOrNull { val tile = it.currentTile - (it.name== Constants.settler || it.name.startsWith("Great") && it.type.isCivilian()) + (it.name== Constants.settler || it.name in GreatPersonManager().statToGreatPersonMapping.values) && tile.militaryUnit==null && unit.canMoveTo(tile) && unit.movementAlgs().canReach(tile) } if(settlerOrGreatPersonToAccompany==null) return false unit.movementAlgs().headTowards(settlerOrGreatPersonToAccompany.currentTile)