Culture-focused civs don't declare war

Chosen free great person is victory-type-dependant
This commit is contained in:
Yair Morgenstern 2019-06-13 13:18:20 +03:00
parent ea5f649d87
commit 816196520e
2 changed files with 14 additions and 1 deletions

View File

@ -298,6 +298,9 @@ class NextTurnAutomation{
private fun declareWar(civInfo: CivilizationInfo) {
if (civInfo.isCityState()) return
if(civInfo.getNation().preferredVictoryType==VictoryType.Cultural)
return
if (civInfo.cities.isNotEmpty() && civInfo.diplomacy.isNotEmpty()) {
val ourMilitaryUnits = civInfo.getCivUnits().filter { !it.type.isCivilian() }.size
if (!civInfo.isAtWar() && civInfo.happiness > 0

View File

@ -3,6 +3,7 @@ package com.unciv.logic.civilization
import com.unciv.Constants
import com.unciv.models.gamebasics.GameBasics
import com.unciv.models.gamebasics.Policy
import com.unciv.models.gamebasics.VictoryType
class PolicyManager {
@ -76,7 +77,16 @@ class PolicyManager {
"Free Religion" -> freePolicies++
"Liberty Complete" -> {
if (civInfo.isPlayerCivilization()) civInfo.greatPeople.freeGreatPeople++
else civInfo.addGreatPerson(GameBasics.Units.keys.filter { it.startsWith("Great") }.random())
else {
val preferredVictoryType = civInfo.getNation().preferredVictoryType
val greatPerson = when(preferredVictoryType) {
VictoryType.Cultural -> "Great Artist"
VictoryType.Scientific -> "Great Scientist"
VictoryType.Domination,VictoryType.Neutral ->
GameBasics.Units.keys.filter { it.startsWith("Great") }.random()
}
civInfo.addGreatPerson(greatPerson)
}
}
}