mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-09 23:39:40 +07:00
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:
@ -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 += ""
|
||||
}
|
||||
|
Reference in New Issue
Block a user