Replaced special "hidden after generating a Great Prophet" with a more multi-purpose conditional

This commit is contained in:
Yair Morgenstern 2024-01-25 22:49:34 +02:00
parent c8bc15c800
commit 8aab8f71e4
3 changed files with 9 additions and 1 deletions

View File

@ -64,7 +64,7 @@
{
"name": "an ancient prophecy",
"notification": "We have found an ancient prophecy in the ruins, greatly increasing our spiritual connection! (+[faithAmount] Faith)",
"uniques": ["Hidden when religion is disabled", "Gain enough Faith for [33]% of a Great Prophet", "Hidden after generating a Great Prophet",
"uniques": ["Hidden when religion is disabled", "Gain enough Faith for [33]% of a Great Prophet", "Unavailable <after generating a Great Prophet>",
"Only available <after founding a Pantheon>", "Only available <after [20] turns>"],
"color": "#CDDDF4"
}

View File

@ -260,12 +260,14 @@ class Unique(val text: String, val sourceObjectType: UniqueTarget? = null, val s
checkOnCiv { stats.happiness in condition.params[0].toInt() until condition.params[1].toInt() }
UniqueType.ConditionalBelowHappiness -> checkOnCiv { stats.happiness < condition.params[0].toInt() }
UniqueType.ConditionalGoldenAge -> checkOnCiv { goldenAges.isGoldenAge() }
UniqueType.ConditionalBeforeEra -> compareEra(condition.params[0]) { current, param -> current < param }
UniqueType.ConditionalStartingFromEra -> compareEra(condition.params[0]) { current, param -> current >= param }
UniqueType.ConditionalDuringEra -> compareEra(condition.params[0]) { current, param -> current == param }
UniqueType.ConditionalIfStartingInEra -> checkOnCiv { gameInfo.gameParameters.startingEra == condition.params[0] }
UniqueType.ConditionalTech -> checkOnCiv { tech.isResearched(condition.params[0]) }
UniqueType.ConditionalNoTech -> checkOnCiv { !tech.isResearched(condition.params[0]) }
UniqueType.ConditionalAfterPolicyOrBelief ->
checkOnCiv { policies.isAdopted(condition.params[0]) || religionManager.religion?.hasBelief(condition.params[0]) == true }
UniqueType.ConditionalBeforePolicyOrBelief ->
@ -282,6 +284,9 @@ class Unique(val text: String, val sourceObjectType: UniqueTarget? = null, val s
checkOnCiv { religionManager.religionState < ReligionState.EnhancedReligion }
UniqueType.ConditionalAfterEnhancingReligion ->
checkOnCiv { religionManager.religionState >= ReligionState.EnhancedReligion }
UniqueType.ConditionalAfterGeneratingGreatProphet ->
checkOnCiv { religionManager.greatProphetsEarned() > 0 }
UniqueType.ConditionalBuildingBuilt ->
checkOnCiv { cities.any { it.cityConstructions.containsBuildingOrEquivalent(condition.params[0]) } }
UniqueType.ConditionalBuildingBuiltByAnybody ->
@ -314,6 +319,7 @@ class Unique(val text: String, val sourceObjectType: UniqueTarget? = null, val s
UniqueType.ConditionalHasNotUsedOtherActions ->
state.unit == null || // So we get the action as a valid action in BaseUnit.hasUnique()
state.unit.abilityToTimesUsed.isEmpty()
UniqueType.ConditionalInTiles ->
relevantTile?.matchesFilter(condition.params[0], state.civInfo) == true
UniqueType.ConditionalInTilesNot ->

View File

@ -638,6 +638,7 @@ enum class UniqueType(
ConditionalAfterReligion("after founding a religion", UniqueTarget.Conditional),
ConditionalBeforeEnhancingReligion("before enhancing a religion", UniqueTarget.Conditional),
ConditionalAfterEnhancingReligion("after enhancing a religion", UniqueTarget.Conditional),
ConditionalAfterGeneratingGreatProphet("after generating a Great Prophet", UniqueTarget.Conditional),
ConditionalBuildingBuilt("if [buildingFilter] is constructed", UniqueTarget.Conditional),
ConditionalBuildingBuiltByAnybody("if [buildingFilter] is constructed by anybody", UniqueTarget.Conditional),
@ -794,6 +795,7 @@ enum class UniqueType(
UniqueTarget.Unit, UniqueTarget.Building, UniqueTarget.Ruins, UniqueTarget.Tutorial,
flags = UniqueFlag.setOfHiddenToUsers),
@Deprecated("as of 4.9.0", ReplaceWith("Unavailable <after generating a Great Prophet>"))
HiddenAfterGreatProphet("Hidden after generating a Great Prophet", UniqueTarget.Ruins),
HiddenWithoutVictoryType("Hidden when [victoryType] Victory is disabled", UniqueTarget.Building, UniqueTarget.Unit, flags = UniqueFlag.setOfHiddenToUsers),
HiddenFromCivilopedia("Will not be displayed in Civilopedia", *UniqueTarget.Displayable, flags = UniqueFlag.setOfHiddenToUsers),