mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-20 17:32:57 +07:00
Culture-focused civs don't declare war
Chosen free great person is victory-type-dependant
This commit is contained in:
parent
ea5f649d87
commit
816196520e
@ -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
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user