diff --git a/android/assets/jsons/Civ V - Gods & Kings/Policies.json b/android/assets/jsons/Civ V - Gods & Kings/Policies.json index fb7e07fcf6..00603cbcc4 100644 --- a/android/assets/jsons/Civ V - Gods & Kings/Policies.json +++ b/android/assets/jsons/Civ V - Gods & Kings/Policies.json @@ -72,11 +72,11 @@ "name": "Liberty", "era": "Ancient era", "priorities": { - "Neutral": 0, - "Cultural": 0, - "Diplomatic": 10, - "Domination": 10, - "Scientific": 10 + "Neutral": 10, + "Cultural": 10, + "Diplomatic": 20, + "Domination": 20, + "Scientific": 20 }, "uniques": ["[+1 Culture] [in all cities]"], "policies": [ diff --git a/android/assets/jsons/Civ V - Vanilla/Policies.json b/android/assets/jsons/Civ V - Vanilla/Policies.json index 3d8091149d..4e62b12e56 100644 --- a/android/assets/jsons/Civ V - Vanilla/Policies.json +++ b/android/assets/jsons/Civ V - Vanilla/Policies.json @@ -72,11 +72,11 @@ "name": "Liberty", "era": "Ancient era", "priorities": { - "Neutral": 0, - "Cultural": 0, - "Diplomatic": 10, - "Domination": 10, - "Scientific": 0 + "Neutral": 10, + "Cultural": 10, + "Diplomatic": 20, + "Domination": 20, + "Scientific": 20 }, "uniques": ["[+1 Culture] [in all cities]"], "policies": [ diff --git a/core/src/com/unciv/logic/automation/civilization/NextTurnAutomation.kt b/core/src/com/unciv/logic/automation/civilization/NextTurnAutomation.kt index da2da49cab..5bfd4c8f50 100644 --- a/core/src/com/unciv/logic/automation/civilization/NextTurnAutomation.kt +++ b/core/src/com/unciv/logic/automation/civilization/NextTurnAutomation.kt @@ -581,13 +581,9 @@ object NextTurnAutomation { civInfo.policies.branchCompletionMap.filterKeys { key -> key in candidates } - // The highest number of adopted child policies within a single candidate - val maxCompletion: Int = - candidateCompletionMap.maxOf { entry -> entry.value } - // The candidate closest to completion, hence the target branch - val targetBranch = candidateCompletionMap.filterValues { value -> - value == maxCompletion - }.keys.random() + + // Choose the branch with the LEAST REMAINING policies, not the MOST ADOPTED ones + val targetBranch = candidateCompletionMap.minBy { it.key.policies.size - it.value }.key val policyToAdopt: Policy = if (civInfo.policies.isAdoptable(targetBranch)) targetBranch diff --git a/core/src/com/unciv/logic/civilization/managers/PolicyManager.kt b/core/src/com/unciv/logic/civilization/managers/PolicyManager.kt index 26e0f4523e..caee82dcb5 100644 --- a/core/src/com/unciv/logic/civilization/managers/PolicyManager.kt +++ b/core/src/com/unciv/logic/civilization/managers/PolicyManager.kt @@ -28,8 +28,6 @@ class PolicyManager : IsPartOfGameInfoSerialization { var freePolicies = 0 var storedCulture = 0 - // TODO: 'adoptedPolicies' seems to be an internal API. - // Why is it HashSet instead of HashSet? internal val adoptedPolicies = HashSet() var numberOfAdoptedPolicies = 0 var shouldOpenPolicyPicker = false