From 9d0035a8a6eb3c7acc5c389a1f216ac991d850eb Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Wed, 8 Aug 2018 08:23:20 +0300 Subject: [PATCH] AI now considers war on multiple civs, starting with the closest --- android/assets/jsons/Translations.json | 2 ++ core/src/com/unciv/logic/automation/Automation.kt | 1 + 2 files changed, 3 insertions(+) diff --git a/android/assets/jsons/Translations.json b/android/assets/jsons/Translations.json index 37524692..7a0dfe7e 100644 --- a/android/assets/jsons/Translations.json +++ b/android/assets/jsons/Translations.json @@ -824,6 +824,8 @@ } "We have encountered [civName]!":{} + + "Cannot provide upkeep for [unitName] - unit has been disbanded!":{} // Save and load game diff --git a/core/src/com/unciv/logic/automation/Automation.kt b/core/src/com/unciv/logic/automation/Automation.kt index b8461533..a2a41a4d 100644 --- a/core/src/com/unciv/logic/automation/Automation.kt +++ b/core/src/com/unciv/logic/automation/Automation.kt @@ -81,6 +81,7 @@ class Automation { val enemyCivsByDistanceToOurs = civInfo.diplomacy.values.map { it.otherCiv() } .filterNot { it == civInfo || it.cities.isEmpty() || !civInfo.diplomacy[it.civName]!!.canDeclareWar() } .groupBy { getMinDistanceBetweenCities(civInfo,it) } + .toSortedMap() val ourCombatStrength = evaluteCombatStrength(civInfo) for (group in enemyCivsByDistanceToOurs){ if(group.key>7) break