From 3801a81bf4e1918563942c854670928733b93d47 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Fri, 21 May 2021 13:49:33 +0300 Subject: [PATCH] AI much less motivated to attack city-states --- core/src/com/unciv/logic/automation/NextTurnAutomation.kt | 2 ++ core/src/com/unciv/logic/trade/TradeEvaluation.kt | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/com/unciv/logic/automation/NextTurnAutomation.kt b/core/src/com/unciv/logic/automation/NextTurnAutomation.kt index b08c302c06..a8514d766e 100644 --- a/core/src/com/unciv/logic/automation/NextTurnAutomation.kt +++ b/core/src/com/unciv/logic/automation/NextTurnAutomation.kt @@ -410,6 +410,8 @@ object NextTurnAutomation { if (theirCity.getTiles().none { it.neighbors.any { it.getOwner() == theirCity.civInfo && it.getCity() != theirCity } }) modifierMap["Isolated city"] = 15 + if (otherCiv.isCityState()) modifierMap["City-state"] = -20 + return modifierMap.values.sum() } diff --git a/core/src/com/unciv/logic/trade/TradeEvaluation.kt b/core/src/com/unciv/logic/trade/TradeEvaluation.kt index 74bf973a54..0e14e69674 100644 --- a/core/src/com/unciv/logic/trade/TradeEvaluation.kt +++ b/core/src/com/unciv/logic/trade/TradeEvaluation.kt @@ -239,7 +239,7 @@ class TradeEvaluation { fun evaluatePeaceCostForThem(ourCivilization: CivilizationInfo, otherCivilization: CivilizationInfo): Int { val ourCombatStrength = Automation.evaluteCombatStrength(ourCivilization) val theirCombatStrength = Automation.evaluteCombatStrength(otherCivilization) - if (ourCombatStrength*1.5f > theirCombatStrength && theirCombatStrength * 1.5f > ourCombatStrength) + if (ourCombatStrength*1.5f >= theirCombatStrength && theirCombatStrength * 1.5f >= ourCombatStrength) return 0 // we're roughly equal, there's no huge power imbalance if (ourCombatStrength == 0) return -1000 if (theirCombatStrength == 0) return 1000 // Chumps got no cities or units