Module:AbilityTable/Lists/doc: Difference between revisions

Vergir (talk | contribs)
m better doc
Line 3: Line 3:
If an ability should appear in a table but doesn't, it means none of its data properties match the list's property keys. The recommended fix is to find a matching property in [[Data:AbilityData.json]] and add it to the list. Only use a raw ability name as a fallback if no suitable property exists.
If an ability should appear in a table but doesn't, it means none of its data properties match the list's property keys. The recommended fix is to find a matching property in [[Data:AbilityData.json]] and add it to the list. Only use a raw ability name as a fallback if no suitable property exists.


Before editing, read the comment above the list you want to change it describes what kind of abilities belong there.
Before editing, read the comment above the list you want to change, it describes what kind of abilities belong there.


'''Finding the right property''': Open [[Data:AbilityData.json]] and search for the ability. Look through its properties for one that represents the relevant mechanic for example, a silence ability might have <code>SilenceDuration</code>. A good property is one shared by many abilities with the same mechanic, not something unique to one ability.
'''Finding the right property''': Open [[Data:AbilityData.json]] and search for the ability. Look through its properties for one that represents the relevant mechanic, for example, a silence ability might have <code>SilenceDuration</code>. A good property is one shared by many abilities with the same mechanic, not something unique to one ability.


After adding the property or ability name, test the table to make sure no unwanted extra abilities appeared. If they did, the property is too broad consider using a raw ability name instead, or adding the extras to <code>exclude_abilities</code>.
After adding the property or ability name, test the table to make sure no unwanted extra abilities appeared. If they did, the property is too broad, consider using a raw ability name instead, or adding the extras to <code>exclude_abilities</code>.


If your new ability has special column values, you may also want to update [[Module:AbilityTable/ComplexRenderers]]. And if it needs a descriptive note, add it in [[Module:AbilityTable/Notes]].
If your new ability has special column values, you may also want to update [[Module:AbilityTable/ComplexRenderers]]. And if it needs a descriptive note, add it in [[Module:AbilityTable/Notes]].
Line 13: Line 13:
=== Example: adding a missing ability to the healreduce list ===
=== Example: adding a missing ability to the healreduce list ===


Say {{AbilityIcon|Affliction}} is missing from the heal reduction table. First, check the comment above <code>["healreduce"]</code> in the module it says "Abilities that reduce healing on their targets", so Affliction belongs there.
Say {{AbilityIcon|Affliction}} is missing from the heal reduction table. First, check the comment above <code>["healreduce"]</code> in the module, it says "Abilities that reduce healing on their targets", so Affliction belongs there.


Open [[Data:AbilityData.json]] and search for <code>affliction</code>. Looking through its properties, you find <code>"DisableHealing": 1</code> that looks like exactly what we need.
Open [[Data:AbilityData.json]] and search for <code>affliction</code>. Looking through its properties, you find <code>"DisableHealing": 1</code>, that looks like exactly what we need.


Check if <code>DisableHealing</code> is already in the <code>["healreduce"]</code> list. It isn't, so add it:
Check if <code>DisableHealing</code> is already in the <code>["healreduce"]</code> list. It isn't, so add it:
Line 25: Line 25:
</pre>
</pre>


Save and test the table with <code><nowiki>{{AbilityTable|healreduce}}</nowiki></code>. Affliction now appears and no unexpected abilities were added, so the property was a good fit.
Save and test the table with <code><nowiki>{{AbilityTable|healreduce}}</nowiki></code>. Affliction now appears, and no unexpected abilities were added, so the property was a good fit.


== How to exclude an ability from a list ==
== How to exclude an ability from a list ==