mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-19 16:57:38 +07:00
"before adopting / after adopting" uniques accept belief as well as policy - #3242
This commit is contained in:
parent
e44af219eb
commit
edccbf6273
@ -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
|
||||
} }
|
||||
|
||||
|
||||
|
@ -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 ->
|
||||
|
@ -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,
|
||||
|
@ -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),
|
||||
|
Loading…
Reference in New Issue
Block a user