From 6bcaed79471d67f9189a53250cb4d476b801f014 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Sun, 12 Feb 2023 19:34:40 +0200 Subject: [PATCH] Resolved #8647 - fixed Guruship belief --- .../jsons/Civ V - Gods & Kings/Beliefs.json | 2 +- .../unciv/models/ruleset/tech/Technology.kt | 21 +++++++++---------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/android/assets/jsons/Civ V - Gods & Kings/Beliefs.json b/android/assets/jsons/Civ V - Gods & Kings/Beliefs.json index 3d05eaa3d4..a11624d1dc 100644 --- a/android/assets/jsons/Civ V - Gods & Kings/Beliefs.json +++ b/android/assets/jsons/Civ V - Gods & Kings/Beliefs.json @@ -148,7 +148,7 @@ { "name": "Guruship", "type": "Follower", - "uniques": ["[+2 Production] "] + "uniques": ["[+2 Production] [in cities following this religion] "] }, { "name": "Holy Warriors", diff --git a/core/src/com/unciv/models/ruleset/tech/Technology.kt b/core/src/com/unciv/models/ruleset/tech/Technology.kt index e4dd8ee45f..1e15aa0411 100644 --- a/core/src/com/unciv/models/ruleset/tech/Technology.kt +++ b/core/src/com/unciv/models/ruleset/tech/Technology.kt @@ -13,7 +13,6 @@ import com.unciv.models.ruleset.unit.BaseUnit import com.unciv.models.translations.tr import com.unciv.ui.civilopedia.FormattedLine import com.unciv.ui.utils.Fonts -import java.util.* class Technology: RulesetObject() { @@ -38,16 +37,16 @@ class Technology: RulesetObject() { for (unique in uniques) lineList += unique.tr() for (improvement in ruleset.tileImprovements.values) { - for (unique in improvement.uniqueObjects) { - if (unique.isOfType(UniqueType.Stats)) { - val requiredTech = unique.conditionals.firstOrNull { it.isOfType(UniqueType.ConditionalTech) }?.params?.get(0) - if (requiredTech != name) continue - lineList += "[${unique.params[0]}] from every [${improvement.name}]" - } else if (unique.isOfType(UniqueType.ImprovementStatsOnTile)) { - val requiredTech = unique.conditionals.firstOrNull { it.isOfType(UniqueType.ConditionalTech) }?.params?.get(0) - if (requiredTech != name) continue - lineList += "[${unique.params[0]}] from every [${improvement.name}] on [${unique.params[1]}] tiles" - } + for (unique in improvement.getMatchingUniques(UniqueType.Stats)) { + val requiredTech = unique.conditionals.firstOrNull { it.isOfType(UniqueType.ConditionalTech) }?.params?.get(0) + if (requiredTech != name) continue + lineList += "[${unique.params[0]}] from every [${improvement.name}]" + } + + for (unique in improvement.getMatchingUniques(UniqueType.ImprovementStatsOnTile)) { + val requiredTech = unique.conditionals.firstOrNull { it.isOfType(UniqueType.ConditionalTech) }?.params?.get(0) + if (requiredTech != name) continue + lineList += "[${unique.params[0]}] from every [${improvement.name}] on [${unique.params[1]}] tiles" } }