Added unit conditional support to pillage yield uniques

Added doc note in cached uniques so modders can know ahead of time
See #11060
This commit is contained in:
Yair Morgenstern
2024-02-01 23:02:31 +02:00
parent a8446be6ad
commit 875da6cd48
3 changed files with 24 additions and 1 deletions

View File

@ -1,5 +1,6 @@
package com.unciv.app.desktop
import com.unciv.logic.map.mapunit.MapUnitCache
import com.unciv.models.ruleset.unique.UniqueParameterType
import com.unciv.models.ruleset.unique.UniqueTarget
import com.unciv.models.ruleset.unique.UniqueType
@ -66,6 +67,7 @@ class UniqueDocsWriter {
if (targetType.documentationString.isNotEmpty())
lines += "!!! note \"\"\n\n ${targetType.documentationString}\n"
for (uniqueType in uniqueTypes) {
if (uniqueType.getDeprecationAnnotation() != null) continue
@ -82,6 +84,9 @@ class UniqueDocsWriter {
val paramExamples = uniqueType.parameterTypeMap.map { it.first().docExample }.toTypedArray()
lines += "\tExample: \"${uniqueText.fillPlaceholders(*paramExamples)}\"\n"
}
if (uniqueType in MapUnitCache.UnitMovementUniques) {
lines += "Due to performance considerations, this unique is cached, thus conditionals may not work."
}
lines += "\tApplicable to: " + uniqueType.allTargets().sorted().joinToString()
lines += ""
}