mirror of
https://github.com/yairm210/Unciv.git
synced 2025-03-13 11:30:31 +07:00
Resolved #3130 - "All policies adopted" shown in policy picker screen when relevant
This commit is contained in:
parent
1f4d5f5573
commit
1ceb3548dd
@ -811,6 +811,7 @@ Adopt policy =
|
||||
Adopt free policy =
|
||||
Unlocked at =
|
||||
Gain 2 free technologies =
|
||||
All policies adopted =
|
||||
|
||||
# Technologies
|
||||
|
||||
|
@ -248,11 +248,13 @@ open class TileInfo {
|
||||
for (unique in improvement.uniqueObjects) if (unique.placeholderText == "[] once [] is discovered"
|
||||
&& observingCiv.tech.isResearched(unique.params[1])) stats.add(Stats.parse(unique.params[0]))
|
||||
|
||||
if(city!=null) {
|
||||
if (city != null) {
|
||||
val cityWideUniques = city.cityConstructions.builtBuildingUniqueMap.getUniques("[] from [] tiles in this city")
|
||||
val civWideUniques = city.civInfo.getMatchingUniques("[] from every []")
|
||||
val improvementUniques = improvement.uniqueObjects.filter { it.placeholderText == "[] on [] tiles once [] is discovered"
|
||||
&& observingCiv.tech.isResearched(it.params[2]) }
|
||||
val improvementUniques = improvement.uniqueObjects.filter {
|
||||
it.placeholderText == "[] on [] tiles once [] is discovered"
|
||||
&& observingCiv.tech.isResearched(it.params[2])
|
||||
}
|
||||
for (unique in cityWideUniques + civWideUniques + improvementUniques) {
|
||||
if (improvement.name == unique.params[1]
|
||||
|| (unique.params[1] == "Great Improvement" && improvement.isGreatImprovement())
|
||||
@ -267,12 +269,14 @@ open class TileInfo {
|
||||
&& observingCiv.hasUnique("Tile yield from Great Improvements +100%"))
|
||||
stats.add(improvement) // again, for the double effect
|
||||
|
||||
for(unique in improvement.uniqueObjects)
|
||||
for (unique in improvement.uniqueObjects)
|
||||
if (unique.placeholderText == "[] for each adjacent []") {
|
||||
val adjacent = unique.params[1]
|
||||
val numberOfBonuses = neighbors.count { it.improvement == adjacent
|
||||
|| it.fitsUniqueFilter(adjacent)
|
||||
|| it.roadStatus.name == adjacent}
|
||||
val numberOfBonuses = neighbors.count {
|
||||
it.improvement == adjacent
|
||||
|| it.fitsUniqueFilter(adjacent)
|
||||
|| it.roadStatus.name == adjacent
|
||||
}
|
||||
stats.add(Stats.parse(unique.params[0]).times(numberOfBonuses.toFloat()))
|
||||
}
|
||||
|
||||
|
@ -25,6 +25,9 @@ class PolicyPickerScreen(val worldScreen: WorldScreen, civInfo: CivilizationInfo
|
||||
|
||||
rightSideButton.setText("{Adopt policy}\r\n(".tr() + policies.storedCulture + "/" + policies.getCultureNeededForNextPolicy() + ")")
|
||||
|
||||
if (viewingCiv.gameInfo.ruleSet.policyBranches.values.flatMap { it.policies }.all { it.name in policies.adoptedPolicies})
|
||||
rightSideButton.setText("All policies adopted".tr())
|
||||
|
||||
setDefaultCloseAction()
|
||||
if (policies.freePolicies > 0) {
|
||||
rightSideButton.setText("Adopt free policy".tr())
|
||||
|
Loading…
Reference in New Issue
Block a user