diff --git a/core/src/com/unciv/models/ruleset/Policy.kt b/core/src/com/unciv/models/ruleset/Policy.kt index d6746624ce..1f26c59dfe 100644 --- a/core/src/com/unciv/models/ruleset/Policy.kt +++ b/core/src/com/unciv/models/ruleset/Policy.kt @@ -94,7 +94,7 @@ open class Policy : RulesetObject() { fun isEnabledByPolicy(rulesetObject: IRulesetObject) = rulesetObject.getMatchingUniques(UniqueType.OnlyAvailableWhen, StateForConditionals.IgnoreConditionals).any { it.conditionals.any { - it.type == UniqueType.ConditionalAfterPolicy && it.params[0] == name + it.type == UniqueType.ConditionalAfterPolicyOrBelief && it.params[0] == name } } val enabledBuildings = ruleset.buildings.values.filter { isEnabledByPolicy(it) } @@ -111,7 +111,7 @@ open class Policy : RulesetObject() { fun isDisabledByPolicy(rulesetObject: IRulesetObject) = rulesetObject.getMatchingUniques(UniqueType.OnlyAvailableWhen, StateForConditionals.IgnoreConditionals).any { it.conditionals.any { - it.type == UniqueType.ConditionalBeforePolicy && it.params[0] == name + it.type == UniqueType.ConditionalBeforePolicyOrBelief && it.params[0] == name } } diff --git a/core/src/com/unciv/models/ruleset/unique/Unique.kt b/core/src/com/unciv/models/ruleset/unique/Unique.kt index 4b230b4b99..7a583b57b8 100644 --- a/core/src/com/unciv/models/ruleset/unique/Unique.kt +++ b/core/src/com/unciv/models/ruleset/unique/Unique.kt @@ -190,10 +190,12 @@ class Unique(val text: String, val sourceObjectType: UniqueTarget? = null, val s state.civInfo != null && state.civInfo.tech.isResearched(condition.params[0]) UniqueType.ConditionalNoTech -> state.civInfo != null && !state.civInfo.tech.isResearched(condition.params[0]) - UniqueType.ConditionalAfterPolicy -> - state.civInfo != null && state.civInfo.policies.isAdopted(condition.params[0]) - UniqueType.ConditionalBeforePolicy -> + UniqueType.ConditionalAfterPolicyOrBelief -> + state.civInfo != null && (state.civInfo.policies.isAdopted(condition.params[0]) + || state.civInfo.religionManager.religion?.hasBelief(condition.params[0]) == true) + UniqueType.ConditionalBeforePolicyOrBelief -> state.civInfo != null && !state.civInfo.policies.isAdopted(condition.params[0]) + && state.civInfo.religionManager.religion?.hasBelief(condition.params[0]) != true UniqueType.ConditionalBeforePantheon -> state.civInfo != null && state.civInfo.religionManager.religionState == ReligionState.None UniqueType.ConditionalAfterPantheon -> diff --git a/core/src/com/unciv/models/ruleset/unique/UniqueParameterType.kt b/core/src/com/unciv/models/ruleset/unique/UniqueParameterType.kt index c2972eb7ce..388eb45f6f 100644 --- a/core/src/com/unciv/models/ruleset/unique/UniqueParameterType.kt +++ b/core/src/com/unciv/models/ruleset/unique/UniqueParameterType.kt @@ -461,7 +461,7 @@ enum class UniqueParameterType( } }, - /** [UniqueType.ConditionalAfterPolicy] and others, no central implementation */ + /** [UniqueType.ConditionalAfterPolicyOrBelief] and others, no central implementation */ Policy("policy", "Oligarchy", "The name of any policy") { override fun getErrorSeverity( parameterText: String, diff --git a/core/src/com/unciv/models/ruleset/unique/UniqueType.kt b/core/src/com/unciv/models/ruleset/unique/UniqueType.kt index a15749eca6..24b28388d8 100644 --- a/core/src/com/unciv/models/ruleset/unique/UniqueType.kt +++ b/core/src/com/unciv/models/ruleset/unique/UniqueType.kt @@ -654,8 +654,8 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags: ConditionalTech("after discovering [tech]", UniqueTarget.Conditional), ConditionalNoTech("before discovering [tech]", UniqueTarget.Conditional), - ConditionalAfterPolicy("after adopting [policy]", UniqueTarget.Conditional), - ConditionalBeforePolicy("before adopting [policy]", UniqueTarget.Conditional), + ConditionalAfterPolicyOrBelief("after adopting [policy/belief]", UniqueTarget.Conditional), + ConditionalBeforePolicyOrBelief("before adopting [policy/belief]", UniqueTarget.Conditional), ConditionalBeforePantheon("before founding a Pantheon", UniqueTarget.Conditional), ConditionalAfterPantheon("after founding a Pantheon", UniqueTarget.Conditional),