diff --git a/desktop/src/com/unciv/app/desktop/UniqueDocsWriter.kt b/desktop/src/com/unciv/app/desktop/UniqueDocsWriter.kt index 11715080dc..8545489d1b 100644 --- a/desktop/src/com/unciv/app/desktop/UniqueDocsWriter.kt +++ b/desktop/src/com/unciv/app/desktop/UniqueDocsWriter.kt @@ -57,13 +57,15 @@ class UniqueDocsWriter { lines += "# Uniques" lines += "Simple unique parameters are explained by mouseover. Complex parameters are explained in [Unique parameter types](../Unique-parameters)" + val conditionalLikeUniqueTargets = setOf(UniqueTarget.Conditional, UniqueTarget.TriggerCondition, UniqueTarget.UnitTriggerCondition) + for ((targetType, uniqueTypes) in targetTypesToUniques) { if (uniqueTypes.isEmpty()) continue lines += "## " + targetType.name + " uniques" for (uniqueType in uniqueTypes) { if (uniqueType.getDeprecationAnnotation() != null) continue - val uniqueText = if (targetType == UniqueTarget.Conditional || targetType == UniqueTarget.TriggerCondition) + val uniqueText = if (targetType in conditionalLikeUniqueTargets) "<${uniqueType.text}>" else uniqueType.text lines += "??? example \"$uniqueText\"" // collapsable material mkdocs block, see https://squidfunk.github.io/mkdocs-material/reference/admonitions/?h=%3F%3F%3F#collapsible-blocks diff --git a/docs/Modders/uniques.md b/docs/Modders/uniques.md index 1eec919c4b..afc88a87c0 100644 --- a/docs/Modders/uniques.md +++ b/docs/Modders/uniques.md @@ -77,11 +77,6 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl Applicable to: Triggerable -??? example "This Unit gains the [promotion] promotion" - Example: "This Unit gains the [Shock I] promotion" - - Applicable to: Triggerable, Unit - ??? example "[mapUnitFilter] units gain the [promotion] promotion" Example: "[Wounded] units gain the [Shock I] promotion" @@ -98,7 +93,29 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl Applicable to: Triggerable ??? example "Will not be displayed in Civilopedia" - Applicable to: Triggerable, Global, Nation, Era, Tech, Policy, FounderBelief, FollowerBelief, Building, Wonder, Unit, UnitType, Promotion, Terrain, Improvement, Resource, Ruins, Speed, Tutorial, CityState, ModOptions, Conditional, TriggerCondition + Applicable to: Triggerable, UnitTriggerable, Global, Nation, Era, Tech, Policy, FounderBelief, FollowerBelief, Building, Wonder, Unit, UnitType, Promotion, Terrain, Improvement, Resource, Ruins, Speed, Tutorial, CityState, ModOptions, Conditional, TriggerCondition, UnitTriggerCondition + +## UnitTriggerable uniques +??? example "Heal this unit by [amount] HP" + Example: "Heal this unit by [3] HP" + + Applicable to: UnitTriggerable + +??? example "This Unit gains [amount] XP" + Example: "This Unit gains [3] XP" + + Applicable to: UnitTriggerable, Ruins + +??? example "This Unit upgrades for free" + Applicable to: UnitTriggerable, Global + +??? example "This Unit gains the [promotion] promotion" + Example: "This Unit gains the [Shock I] promotion" + + Applicable to: UnitTriggerable + +??? example "upon conquering a city" + Applicable to: UnitTriggerable, TriggerCondition ## Global uniques ??? example "[stats]" @@ -813,9 +830,6 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl Applicable to: Global, Unit -??? example "This Unit upgrades for free" - Applicable to: Global, Unit - ## Nation uniques ??? example "Will not be chosen for new games" Applicable to: Nation @@ -1300,16 +1314,6 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl Applicable to: Unit -??? example "Heal this unit by [amount] HP" - Example: "Heal this unit by [3] HP" - - Applicable to: Unit - -??? example "This Unit gains [amount] XP" - Example: "This Unit gains [3] XP" - - Applicable to: Unit, Ruins - ## Promotion uniques ??? example "Doing so will consume this opportunity to choose a Promotion" Applicable to: Promotion @@ -1911,9 +1915,6 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl ??? example "<upon entering a Golden Age>" Applicable to: TriggerCondition -??? example "<upon conquering a city>" - Applicable to: TriggerCondition - ??? example "<upon founding a city>" Applicable to: TriggerCondition @@ -1944,10 +1945,22 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl ??? example "<upon enhancing a Religion>" Applicable to: TriggerCondition -??? example "<upon defeating a [unitFilter] unit>" - Example: "<upon defeating a [Unknown] unit>" +## UnitTriggerCondition uniques +??? example "<upon defeating a [mapUnitFilter] unit>" + Example: "<upon defeating a [Wounded] unit>" - Applicable to: TriggerCondition + Applicable to: UnitTriggerCondition + +??? example "<upon being defeated>" + Applicable to: UnitTriggerCondition + +??? example "<upon being promoted>" + Applicable to: UnitTriggerCondition + +??? example "<upon losing at least [amount] HP in a single attack>" + Example: "<upon losing at least [3] HP in a single attack>" + + Applicable to: UnitTriggerCondition *[action]: An action that a unit can perform. Currently, there are only two actions part of this: 'Spread Religion' and 'Remove Foreign religions from your own cities'