ConditionalWhileResearching as suggested by @woo1127 (#11156)

This commit is contained in:
SomeTroglodyte 2024-02-20 22:25:16 +01:00 committed by GitHub
parent 8eadaa9d8e
commit 2c96c6f244
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 0 deletions

View File

@ -142,6 +142,7 @@ object Conditionals {
UniqueType.ConditionalIfStartingInEra -> checkOnGameInfo { gameParameters.startingEra == condition.params[0] } UniqueType.ConditionalIfStartingInEra -> checkOnGameInfo { gameParameters.startingEra == condition.params[0] }
UniqueType.ConditionalTech -> checkOnCiv { tech.isResearched(condition.params[0]) } UniqueType.ConditionalTech -> checkOnCiv { tech.isResearched(condition.params[0]) }
UniqueType.ConditionalNoTech -> checkOnCiv { !tech.isResearched(condition.params[0]) } UniqueType.ConditionalNoTech -> checkOnCiv { !tech.isResearched(condition.params[0]) }
UniqueType.ConditionalWhileResearching -> checkOnCiv { tech.currentTechnologyName() == condition.params[0] }
UniqueType.ConditionalAfterPolicyOrBelief -> UniqueType.ConditionalAfterPolicyOrBelief ->
checkOnCiv { policies.isAdopted(condition.params[0]) || religionManager.religion?.hasBelief(condition.params[0]) == true } checkOnCiv { policies.isAdopted(condition.params[0]) || religionManager.religion?.hasBelief(condition.params[0]) == true }

View File

@ -634,6 +634,8 @@ enum class UniqueType(
ConditionalFirstCivToResearch("if no other Civilization has researched this", UniqueTarget.Conditional), ConditionalFirstCivToResearch("if no other Civilization has researched this", UniqueTarget.Conditional),
ConditionalTech("after discovering [tech]", UniqueTarget.Conditional), ConditionalTech("after discovering [tech]", UniqueTarget.Conditional),
ConditionalNoTech("before discovering [tech]", UniqueTarget.Conditional), ConditionalNoTech("before discovering [tech]", UniqueTarget.Conditional),
ConditionalWhileResearching("while researching [tech]", UniqueTarget.Conditional,
docDescription = "This condition is fulfilled while the technology is actively being researched (it is the one research points are added to)"),
ConditionalFirstCivToAdopt("if no other Civilization has adopted this", UniqueTarget.Conditional), ConditionalFirstCivToAdopt("if no other Civilization has adopted this", UniqueTarget.Conditional),
ConditionalAfterPolicyOrBelief("after adopting [policy/belief]", UniqueTarget.Conditional), ConditionalAfterPolicyOrBelief("after adopting [policy/belief]", UniqueTarget.Conditional),

View File

@ -1937,6 +1937,12 @@ Due to performance considerations, this unique is cached, thus conditionals may
Applicable to: Conditional Applicable to: Conditional
??? example "<while researching [tech]>"
This condition is fulfilled while the technology is actively being researched (it is the one research points are added to)
Example: "<while researching [Agriculture]>"
Applicable to: Conditional
??? example "<if no other Civilization has adopted this>" ??? example "<if no other Civilization has adopted this>"
Applicable to: Conditional Applicable to: Conditional