Correct check for the city connection quest (#6875)

This commit is contained in:
Jack Rainy 2022-05-19 23:52:55 +03:00 committed by GitHub
parent eb1c874e24
commit a272e8e7ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -366,7 +366,7 @@ class QuestManager {
return when (quest.name) {
QuestName.ClearBarbarianCamp.value -> getBarbarianEncampmentForQuest() != null
QuestName.Route.value -> !challenger.cities.none()
&& !civInfo.isCapitalConnectedToCity(challenger.getCapital())
&& !challenger.isCapitalConnectedToCity(civInfo.getCapital())
// Need to have a city within 7 tiles on the same continent
&& challenger.cities.any { it.getCenterTile().aerialDistanceTo(civInfo.getCapital().getCenterTile()) <= 7
&& it.getCenterTile().getContinent() == civInfo.getCapital().getCenterTile().getContinent() }
@ -393,7 +393,7 @@ class QuestManager {
private fun isComplete(assignedQuest: AssignedQuest): Boolean {
val assignee = civInfo.gameInfo.getCivilization(assignedQuest.assignee)
return when (assignedQuest.questName) {
QuestName.Route.value -> civInfo.isCapitalConnectedToCity(assignee.getCapital())
QuestName.Route.value -> assignee.isCapitalConnectedToCity(civInfo.getCapital())
QuestName.ConnectResource.value -> assignee.detailedCivResources.map { it.resource }.contains(civInfo.gameInfo.ruleSet.tileResources[assignedQuest.data1])
QuestName.ConstructWonder.value -> assignee.cities.any { it.cityConstructions.isBuilt(assignedQuest.data1) }
QuestName.GreatPerson.value -> assignee.getCivGreatPeople().any { it.baseUnit.getReplacedUnit(civInfo.gameInfo.ruleSet).name == assignedQuest.data1 }