Minor Unique documentation improvements (#13559)

* UniqueDocsWriter outputs UniqueFlag HiddenToUsers and NoConditionals

* UniqueDocsWriter: Make other hints get their own line after mkdocs is done with them

* Be honest about OneTimeGlobalAlert
This commit is contained in:
SomeTroglodyte 2025-07-02 10:07:00 +02:00 committed by GitHub
parent 368f6d14c4
commit 911584dc49
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 4 deletions

View File

@ -863,7 +863,8 @@ enum class UniqueType(
// Or just reword it without the 'up to', so it reads "Reveal [amount/'all'] [tileFilter] tiles within [amount] tiles"
OneTimeRevealSpecificMapTiles("Reveal up to [positiveAmount/'all'] [tileFilter] within a [positiveAmount] tile radius", UniqueTarget.Triggerable),
OneTimeRevealCrudeMap("From a randomly chosen tile [positiveAmount] tiles away from the ruins, reveal tiles up to [positiveAmount] tiles away with [positiveAmount]% chance", UniqueTarget.Ruins),
OneTimeGlobalAlert("Triggers the following global alert: [comment]", UniqueTarget.Triggerable), // used in Policy
OneTimeGlobalAlert("Triggers the following global alert: [comment]", UniqueTarget.Triggerable,
docDescription = "Only works on Policies at the moment.", flags = UniqueFlag.setOfNoConditionals),
OneTimeGlobalSpiesWhenEnteringEra("Every major Civilization gains a spy once a civilization enters this era", UniqueTarget.Era),
OneTimeSpiesLevelUp("Promotes all spies [positiveAmount] time(s)", UniqueTarget.Triggerable), // used in Policies, Buildings
OneTimeGainSpy("Gain an extra spy", UniqueTarget.Triggerable), // used in Wonders

View File

@ -131,12 +131,16 @@ class UniqueDocsWriter {
lines += "\tExample: \"${uniqueText.fillPlaceholders(*paramExamples)}\"\n"
}
if (uniqueType.flags.contains(UniqueFlag.AcceptsSpeedModifier))
lines += "\tThis unique's effect can be modified with <${UniqueType.ModifiedByGameSpeed.text}>"
lines += "\tThis unique's effect can be modified with <${UniqueType.ModifiedByGameSpeed.text}>\n"
if (uniqueType.flags.contains(UniqueFlag.AcceptsGameProgressModifier))
lines += "\tThis unique's effect can be modified with <${UniqueType.ModifiedByGameProgress.text}>"
lines += "\tThis unique's effect can be modified with <${UniqueType.ModifiedByGameProgress.text}>\n"
if (uniqueType in MapUnitCache.UnitMovementUniques) {
lines += "\tDue to performance considerations, this unique is cached, thus conditionals that may change within a turn may not work."
lines += "\tDue to performance considerations, this unique is cached, thus conditionals that may change within a turn may not work.\n"
}
if (uniqueType.flags.contains(UniqueFlag.NoConditionals))
lines += "\tThis unique does not support conditionals.\n"
if (uniqueType.flags.contains(UniqueFlag.HiddenToUsers))
lines += "\tThis unique is automatically hidden from users.\n"
lines += "\tApplicable to: " + uniqueType.allTargets().sorted().joinToString()
lines += ""
}