mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-30 07:21:34 -04: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 =
|
Adopt free policy =
|
||||||
Unlocked at =
|
Unlocked at =
|
||||||
Gain 2 free technologies =
|
Gain 2 free technologies =
|
||||||
|
All policies adopted =
|
||||||
|
|
||||||
# Technologies
|
# Technologies
|
||||||
|
|
||||||
|
@ -248,11 +248,13 @@ open class TileInfo {
|
|||||||
for (unique in improvement.uniqueObjects) if (unique.placeholderText == "[] once [] is discovered"
|
for (unique in improvement.uniqueObjects) if (unique.placeholderText == "[] once [] is discovered"
|
||||||
&& observingCiv.tech.isResearched(unique.params[1])) stats.add(Stats.parse(unique.params[0]))
|
&& 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 cityWideUniques = city.cityConstructions.builtBuildingUniqueMap.getUniques("[] from [] tiles in this city")
|
||||||
val civWideUniques = city.civInfo.getMatchingUniques("[] from every []")
|
val civWideUniques = city.civInfo.getMatchingUniques("[] from every []")
|
||||||
val improvementUniques = improvement.uniqueObjects.filter { it.placeholderText == "[] on [] tiles once [] is discovered"
|
val improvementUniques = improvement.uniqueObjects.filter {
|
||||||
&& observingCiv.tech.isResearched(it.params[2]) }
|
it.placeholderText == "[] on [] tiles once [] is discovered"
|
||||||
|
&& observingCiv.tech.isResearched(it.params[2])
|
||||||
|
}
|
||||||
for (unique in cityWideUniques + civWideUniques + improvementUniques) {
|
for (unique in cityWideUniques + civWideUniques + improvementUniques) {
|
||||||
if (improvement.name == unique.params[1]
|
if (improvement.name == unique.params[1]
|
||||||
|| (unique.params[1] == "Great Improvement" && improvement.isGreatImprovement())
|
|| (unique.params[1] == "Great Improvement" && improvement.isGreatImprovement())
|
||||||
@ -267,12 +269,14 @@ open class TileInfo {
|
|||||||
&& observingCiv.hasUnique("Tile yield from Great Improvements +100%"))
|
&& observingCiv.hasUnique("Tile yield from Great Improvements +100%"))
|
||||||
stats.add(improvement) // again, for the double effect
|
stats.add(improvement) // again, for the double effect
|
||||||
|
|
||||||
for(unique in improvement.uniqueObjects)
|
for (unique in improvement.uniqueObjects)
|
||||||
if (unique.placeholderText == "[] for each adjacent []") {
|
if (unique.placeholderText == "[] for each adjacent []") {
|
||||||
val adjacent = unique.params[1]
|
val adjacent = unique.params[1]
|
||||||
val numberOfBonuses = neighbors.count { it.improvement == adjacent
|
val numberOfBonuses = neighbors.count {
|
||||||
|| it.fitsUniqueFilter(adjacent)
|
it.improvement == adjacent
|
||||||
|| it.roadStatus.name == adjacent}
|
|| it.fitsUniqueFilter(adjacent)
|
||||||
|
|| it.roadStatus.name == adjacent
|
||||||
|
}
|
||||||
stats.add(Stats.parse(unique.params[0]).times(numberOfBonuses.toFloat()))
|
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() + ")")
|
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()
|
setDefaultCloseAction()
|
||||||
if (policies.freePolicies > 0) {
|
if (policies.freePolicies > 0) {
|
||||||
rightSideButton.setText("Adopt free policy".tr())
|
rightSideButton.setText("Adopt free policy".tr())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user