Actually generated unique type documentation

This commit is contained in:
Yair Morgenstern
2023-07-02 01:36:28 +03:00
parent d0643efe6b
commit bb22b1de72
4 changed files with 50 additions and 7 deletions

View File

@ -11,7 +11,7 @@ import com.unciv.models.translations.getPlaceholderText
enum class UniqueTarget(val documentationString:String = "", val inheritsFrom: UniqueTarget? = null) { enum class UniqueTarget(val documentationString:String = "", val inheritsFrom: UniqueTarget? = null) {
/** Only includes uniques that have immediate effects, caused by UniqueTriggerActivation */ /** Only includes uniques that have immediate effects, caused by UniqueTriggerActivation */
Triggerable("Uniques that have immediate, one-time effects." + Triggerable("Uniques that have immediate, one-time effects. " +
"These can be added to techs to trigger when researched, to policies to trigger when adpoted, " + "These can be added to techs to trigger when researched, to policies to trigger when adpoted, " +
"to eras to trigger when reached, to buildings to trigger when built. " + "to eras to trigger when reached, to buildings to trigger when built. " +
"Alternatively, you can add a TriggerCondition to them to make them into Global uniques that activate upon a specific event." + "Alternatively, you can add a TriggerCondition to them to make them into Global uniques that activate upon a specific event." +
@ -22,8 +22,6 @@ enum class UniqueTarget(val documentationString:String = "", val inheritsFrom: U
"They can be added to units to grant them the ability to trigger this effect as an action, " + "They can be added to units to grant them the ability to trigger this effect as an action, " +
"which can be modified with UnitActionModifier and UnitTriggerCondition conditionals.", Triggerable), "which can be modified with UnitActionModifier and UnitTriggerCondition conditionals.", Triggerable),
/** Buildings, units, nations, policies, religions, techs etc.
* Basically anything caught by CivInfo.getMatchingUniques. */
Global("Uniques that apply globally. " + Global("Uniques that apply globally. " +
"Civs gain the abilities of these uniques from nation uniques, reached eras, researched techs, adopted policies, " + "Civs gain the abilities of these uniques from nation uniques, reached eras, researched techs, adopted policies, " +
"built buildings, religion 'founder' uniques, owned resources, and ruleset-wide global uniques.", Triggerable), "built buildings, religion 'founder' uniques, owned resources, and ruleset-wide global uniques.", Triggerable),
@ -37,10 +35,10 @@ enum class UniqueTarget(val documentationString:String = "", val inheritsFrom: U
FollowerBelief("Uniques that apply to each city where the religion is the majority religion"), FollowerBelief("Uniques that apply to each city where the religion is the majority religion"),
// City-specific // City-specific
/** This is used as the base when checking buildings */
Building("Uniques that can only be added to buildings", Global), Building("Uniques that can only be added to buildings", Global),
Wonder(inheritsFrom = Building), Wonder(inheritsFrom = Building),
// Unit-specific
Unit("Uniques that can be added to units, unit types, or promotions", inheritsFrom = UnitTriggerable), Unit("Uniques that can be added to units, unit types, or promotions", inheritsFrom = UnitTriggerable),
UnitType(inheritsFrom = Unit), UnitType(inheritsFrom = Unit),
Promotion(inheritsFrom = Unit), Promotion(inheritsFrom = Unit),

View File

@ -65,7 +65,7 @@ class UniqueDocsWriter {
lines += "## " + targetType.name + " uniques" lines += "## " + targetType.name + " uniques"
if (targetType.documentationString.isNotEmpty()) if (targetType.documentationString.isNotEmpty())
lines += "!!! note \"\"\n\n ${targetType.documentationString}" lines += "!!! note \"\"\n\n ${targetType.documentationString}\n"
for (uniqueType in uniqueTypes) { for (uniqueType in uniqueTypes) {
if (uniqueType.getDeprecationAnnotation() != null) continue if (uniqueType.getDeprecationAnnotation() != null) continue

View File

@ -1,6 +1,10 @@
# Uniques # Uniques
Simple unique parameters are explained by mouseover. Complex parameters are explained in [Unique parameter types](../Unique-parameters) Simple unique parameters are explained by mouseover. Complex parameters are explained in [Unique parameter types](../Unique-parameters)
## Triggerable uniques ## Triggerable uniques
!!! note ""
Uniques that have immediate, one-time effects. These can be added to techs to trigger when researched, to policies to trigger when adpoted, to eras to trigger when reached, to buildings to trigger when built. Alternatively, you can add a TriggerCondition to them to make them into Global uniques that activate upon a specific event.They can also be added to units to grant them the ability to trigger this effect as an action, which can be modified with UnitActionModifier and UnitTriggerCondition conditionals.
??? example "Free [unit] appears" ??? example "Free [unit] appears"
Example: "Free [Musketman] appears" Example: "Free [Musketman] appears"
@ -128,6 +132,10 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl
Applicable to: Triggerable Applicable to: Triggerable
## UnitTriggerable uniques ## UnitTriggerable uniques
!!! note ""
Uniques that have immediate, one-time effects on a unit.They can be added to units to grant them the ability to trigger this effect as an action, which can be modified with UnitActionModifier and UnitTriggerCondition conditionals.
??? example "Heal this unit by [amount] HP" ??? example "Heal this unit by [amount] HP"
Example: "Heal this unit by [3] HP" Example: "Heal this unit by [3] HP"
@ -150,6 +158,10 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl
Applicable to: UnitTriggerable Applicable to: UnitTriggerable
## Global uniques ## Global uniques
!!! note ""
Uniques that apply globally. Civs gain the abilities of these uniques from nation uniques, reached eras, researched techs, adopted policies, built buildings, religion 'founder' uniques, owned resources, and ruleset-wide global uniques.
??? example "[stats]" ??? example "[stats]"
Example: "[+1 Gold, +2 Production]" Example: "[+1 Gold, +2 Production]"
@ -899,6 +911,10 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl
Applicable to: Tech, Building Applicable to: Tech, Building
## FounderBelief uniques ## FounderBelief uniques
!!! note ""
Uniques that apply to the founder of this religion
??? example "[stats] for each global city following this religion" ??? example "[stats] for each global city following this religion"
Example: "[+1 Gold, +2 Production] for each global city following this religion" Example: "[+1 Gold, +2 Production] for each global city following this religion"
@ -910,6 +926,10 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl
Applicable to: FounderBelief Applicable to: FounderBelief
## FollowerBelief uniques ## FollowerBelief uniques
!!! note ""
Uniques that apply to each city where the religion is the majority religion
??? example "[relativeAmount]% [stat] from every follower, up to [relativeAmount]%" ??? example "[relativeAmount]% [stat] from every follower, up to [relativeAmount]%"
Example: "[+20]% [Culture] from every follower, up to [+20]%" Example: "[+20]% [Culture] from every follower, up to [+20]%"
@ -921,6 +941,10 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl
Applicable to: FollowerBelief Applicable to: FollowerBelief
## Building uniques ## Building uniques
!!! note ""
Uniques that can only be added to buildings
??? example "Consumes [amount] [resource]" ??? example "Consumes [amount] [resource]"
Example: "Consumes [3] [Iron]" Example: "Consumes [3] [Iron]"
@ -1068,6 +1092,10 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl
Applicable to: Building, Unit Applicable to: Building, Unit
## Unit uniques ## Unit uniques
!!! note ""
Uniques that can be added to units, unit types, or promotions
??? example "Founds a new city" ??? example "Founds a new city"
Applicable to: Unit Applicable to: Unit
@ -1688,6 +1716,10 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl
Applicable to: CityState Applicable to: CityState
## Conditional uniques ## Conditional uniques
!!! note ""
Modifiers that can be added to other uniques to limit when they will be active
??? example "<for [amount] turns>" ??? example "<for [amount] turns>"
Example: "<for [3] turns>" Example: "<for [3] turns>"
@ -1955,6 +1987,10 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl
Applicable to: Conditional Applicable to: Conditional
## TriggerCondition uniques ## TriggerCondition uniques
!!! note ""
Special conditionals that can be added to Triggerable uniques, to make them activate upon specific actions.
??? example "<upon discovering [tech]>" ??? example "<upon discovering [tech]>"
Example: "<upon discovering [Agriculture]>" Example: "<upon discovering [Agriculture]>"
@ -2013,6 +2049,10 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl
Applicable to: TriggerCondition Applicable to: TriggerCondition
## UnitTriggerCondition uniques ## UnitTriggerCondition uniques
!!! note ""
Special conditionals that can be added to UnitTriggerable uniques, to make them activate upon specific actions.
??? example "<upon defeating a [mapUnitFilter] unit>" ??? example "<upon defeating a [mapUnitFilter] unit>"
Example: "<upon defeating a [Wounded] unit>" Example: "<upon defeating a [Wounded] unit>"
@ -2035,6 +2075,10 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl
Applicable to: UnitTriggerCondition Applicable to: UnitTriggerCondition
## UnitActionModifier uniques ## UnitActionModifier uniques
!!! note ""
Modifiers that can be added to unit action uniques as conditionals
??? example "<by consuming this unit>" ??? example "<by consuming this unit>"
Applicable to: UnitActionModifier Applicable to: UnitActionModifier

View File

@ -1,4 +1,5 @@
# Welcome to the Unciv wiki! # # Welcome to the Unciv wiki!
![image](https://raw.githubusercontent.com/yairm210/Unciv/master/extraImages/GithubPreviewImage.jpg) ![image](https://raw.githubusercontent.com/yairm210/Unciv/master/extraImages/GithubPreviewImage.jpg)
[Unciv](https://github.com/yairm210/Unciv) is an open source, mod-friendly Android and Desktop remake of Civ V, made with LibGDX. Build your civilization, research technologies, expand your cities and defeat your foes! [Unciv](https://github.com/yairm210/Unciv) is an open source, mod-friendly Android and Desktop remake of Civ V, made with LibGDX. Build your civilization, research technologies, expand your cities and defeat your foes!
@ -14,4 +15,4 @@ If you're a translator, head over to [Translating!](Other/Translating.md)
If you're a modder, [start here](Modders/Mods.md). If you're a modder, [start here](Modders/Mods.md).
If not, you can still help by spreading the word - vote for Unciv where you can, mention it on Reddit or Twitter etc, and help us with new ideas of how to get the word out! If not, you can still help by spreading the word - vote for Unciv where you can, mention it on Reddit or Twitter etc, and help us with new ideas of how to get the word out!