mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-30 15:30:43 -04:00
Find Natural Wonder Quest implemented (#3211)
* Find Natural Wonder Quest implemented * List to sequence to list
This commit is contained in:
parent
fa59d4888a
commit
1dd82f6f58
@ -23,7 +23,7 @@
|
|||||||
{
|
{
|
||||||
"name": "Acquire Great Person",
|
"name": "Acquire Great Person",
|
||||||
"description": "Great People can change the course of a Civilization! You will be rewarded for acquiring a new [greatPerson]."
|
"description": "Great People can change the course of a Civilization! You will be rewarded for acquiring a new [greatPerson]."
|
||||||
}/*,
|
},/*
|
||||||
{
|
{
|
||||||
"name": "Conquer City State",
|
"name": "Conquer City State",
|
||||||
"description": "You will be rewarded for conquering the city state of [cityState]!",
|
"description": "You will be rewarded for conquering the city state of [cityState]!",
|
||||||
@ -33,11 +33,11 @@
|
|||||||
"name": "Find Player",
|
"name": "Find Player",
|
||||||
"description": "You have yet to discover where [civName] set up their cities. You will be rewarded for finding their territories.",
|
"description": "You have yet to discover where [civName] set up their cities. You will be rewarded for finding their territories.",
|
||||||
"influence": 35
|
"influence": 35
|
||||||
},
|
},*/
|
||||||
{
|
{
|
||||||
"name": "Find Natural Wonder",
|
"name": "Find Natural Wonder",
|
||||||
"description": "Send your best explorers on a quest to discover Natural Wonders. Nobody knows the location of [naturalWonder] yet."
|
"description": "Send your best explorers on a quest to discover Natural Wonders. Nobody knows the location of [naturalWonder] yet."
|
||||||
}*/
|
}
|
||||||
/* G&K */
|
/* G&K */
|
||||||
/*
|
/*
|
||||||
{
|
{
|
||||||
|
@ -251,6 +251,7 @@ class QuestManager {
|
|||||||
QuestName.ConnectResource.value -> data1 = getResourceForQuest(assignee)!!.name
|
QuestName.ConnectResource.value -> data1 = getResourceForQuest(assignee)!!.name
|
||||||
QuestName.ConstructWonder.value -> data1 = getWonderToBuildForQuest(assignee)!!.name
|
QuestName.ConstructWonder.value -> data1 = getWonderToBuildForQuest(assignee)!!.name
|
||||||
QuestName.GreatPerson.value -> data1 = getGreatPersonForQuest(assignee)!!.name
|
QuestName.GreatPerson.value -> data1 = getGreatPersonForQuest(assignee)!!.name
|
||||||
|
QuestName.FindNaturalWonder.value -> data1 = getNaturalWonderToFindForQuest(assignee)!!
|
||||||
}
|
}
|
||||||
|
|
||||||
val newQuest = AssignedQuest(
|
val newQuest = AssignedQuest(
|
||||||
@ -289,6 +290,7 @@ class QuestManager {
|
|||||||
QuestName.ConnectResource.value -> civInfo.hasEverBeenFriendWith(challenger) && getResourceForQuest(challenger) != null
|
QuestName.ConnectResource.value -> civInfo.hasEverBeenFriendWith(challenger) && getResourceForQuest(challenger) != null
|
||||||
QuestName.ConstructWonder.value -> civInfo.hasEverBeenFriendWith(challenger) && getWonderToBuildForQuest(challenger) != null
|
QuestName.ConstructWonder.value -> civInfo.hasEverBeenFriendWith(challenger) && getWonderToBuildForQuest(challenger) != null
|
||||||
QuestName.GreatPerson.value -> civInfo.hasEverBeenFriendWith(challenger) && getGreatPersonForQuest(challenger) != null
|
QuestName.GreatPerson.value -> civInfo.hasEverBeenFriendWith(challenger) && getGreatPersonForQuest(challenger) != null
|
||||||
|
QuestName.FindNaturalWonder.value -> civInfo.hasEverBeenFriendWith(challenger) && getNaturalWonderToFindForQuest(challenger) != null
|
||||||
else -> true
|
else -> true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -301,6 +303,7 @@ class QuestManager {
|
|||||||
QuestName.ConnectResource.value -> assignee.detailedCivResources.map { it.resource }.contains(civInfo.gameInfo.ruleSet.tileResources[assignedQuest.data1])
|
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.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 }
|
QuestName.GreatPerson.value -> assignee.getCivGreatPeople().any { it.baseUnit.getReplacedUnit(civInfo.gameInfo.ruleSet).name == assignedQuest.data1 }
|
||||||
|
QuestName.FindNaturalWonder.value -> assignee.naturalWonders.contains(assignedQuest.data1)
|
||||||
else -> false
|
else -> false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -371,6 +374,18 @@ class QuestManager {
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a random [NaturalWonder] not yet discovered by [challenger].
|
||||||
|
*/
|
||||||
|
private fun getNaturalWonderToFindForQuest(challenger: CivilizationInfo): String? {
|
||||||
|
val naturalWondersToFind = civInfo.gameInfo.tileMap.naturalWonders.subtract(challenger.naturalWonders)
|
||||||
|
|
||||||
|
if (naturalWondersToFind.isNotEmpty())
|
||||||
|
return naturalWondersToFind.random()
|
||||||
|
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a Great Person [BaseUnit] that is not owned by both the [challenger] and the [civInfo]
|
* Returns a Great Person [BaseUnit] that is not owned by both the [challenger] and the [civInfo]
|
||||||
*/
|
*/
|
||||||
|
@ -18,6 +18,7 @@ class TileMap {
|
|||||||
@Transient var bottomY = 0
|
@Transient var bottomY = 0
|
||||||
@delegate:Transient val maxLatitude: Float by lazy { if (values.isEmpty()) 0f else values.map { abs(it.latitude) }.max()!! }
|
@delegate:Transient val maxLatitude: Float by lazy { if (values.isEmpty()) 0f else values.map { abs(it.latitude) }.max()!! }
|
||||||
@delegate:Transient val maxLongitude: Float by lazy { if (values.isEmpty()) 0f else values.map { abs(it.longitude) }.max()!! }
|
@delegate:Transient val maxLongitude: Float by lazy { if (values.isEmpty()) 0f else values.map { abs(it.longitude) }.max()!! }
|
||||||
|
@delegate:Transient val naturalWonders: List<String> by lazy { tileList.asSequence().filter { it.isNaturalWonder() }.map { it.naturalWonder!! }.distinct().toList() }
|
||||||
|
|
||||||
var mapParameters = MapParameters()
|
var mapParameters = MapParameters()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user