| Latest revision |
Your text |
| Line 1: |
Line 1: |
| == Overview == | | == Overview == |
| The '''Abilities''' module provides functions for retrieving data about hero abilities and their upgrades.
| | Abilities module will cover any scripting that relates to hero abilities. |
|
| |
|
| * The function <code>get_ability_name</code> references [[Data:AbilityCards.json]] to link a hero and ability slot to an ability's display name.
| |
| * The functions <code>get_ability_prop</code> and <code>get_ability_upgrade_prop</code> reference [[Data:AbilityData.json]] to get specific stats from an ability's base data or its upgrades.
| |
|
| |
|
| == Examples == | | == Modules == |
| === get_ability_name === | | === [[Module:Abilities/utils|Abilities/utils]] === |
| To get the localized display name of a hero's ability (numbered 1 to 4):
| | Common functions that are shared amongst any Abilities/ modules |
| <pre>{{#invoke:Abilities|get_ability_name|hero_atlas|1}}</pre>
| |
| Returns:
| |
| <code>{{#invoke:Abilities|get_ability_name|hero_atlas|1}}</code>
| |
|
| |
|
| Function can be passed with <code>lang</code> parameter to override the current language to a specific language code.
| |
|
| |
|
| <pre>{{#invoke:Abilities|get_ability_name|hero_atlas|1|lang=ru}}</pre>
| | === [[Module:Abilities/card|Abilities/card]] === |
| Returns:
| | Generates hero ability cards |
| <code>{{#invoke:Abilities|get_ability_name|hero_atlas|1|lang=ru}}</code>
| | ==== Usage ==== |
| | [[Template:Ability card v2]] |
|
| |
|
| === get_ability_prop ===
| |
| To get a property from the base stats of an ability. You can use the ability's key (e.g., "ability_afterburn") or its proper name (e.g., "Afterburn").
| |
| <pre>{{#invoke:Abilities|get_ability_prop|Afterburn|BurnDuration}}</pre>
| |
| Returns:
| |
| <code>{{#invoke:Abilities|get_ability_prop|Afterburn|BurnDuration}}</code>
| |
|
| |
|
| You can also retrieve nested properties by using dot notation to drill down into the data structure. For example, to get a value nested inside a <code>Scale</code> table:
| | === [[Module:Abilities/icon|Abilities/icon]] === |
| <pre>{{#invoke:Abilities|get_ability_prop|Lycan Curse|MaxRage.Scale.Value}}</pre>
| | Searches for an icon based on the (English) name of the ability |
| Returns:
| | ==== Usage ==== |
| <code>{{#invoke:Abilities|get_ability_prop|Lycan Curse|MaxRage.Scale.Value}}</code>
| | [[Template:AbilityIcon]] |
|
| |
|
| === get_ability_upgrade_prop ===
| |
| To get a property from a specific ''upgrade'' of an ability.
| |
| <pre>{{#invoke:Abilities|get_ability_upgrade_prop|Afterburn|3|DPS}}</pre>
| |
| This example gets the <code>DPS</code> value from the 3rd upgrade for the ability "Afterburn".
| |
|
| |
|
| Returns:
| | === [[Module:Abilities/details_table|Abilities/details table]] (WIP) === |
| <code>{{#invoke:Abilities|get_ability_upgrade_prop|Afterburn|3|DPS}}</code>
| | Generates details table to show raw ability data |
| | | ==== Usage ==== |
| Another example, getting the `DamageAmplificationPerStack` from the 2nd upgrade of "Marksman":
| | [[Template:Ability card v2/Details]] |
| <pre>{{#invoke:Abilities|get_ability_upgrade_prop|Marksman|2|DamageAmplificationPerStack}}</pre>
| |
| Returns:
| |
| <code>{{#invoke:Abilities|get_ability_upgrade_prop|Marksman|2|DamageAmplificationPerStack}}</code>
| |
| | |
| {{Module:Abilities/doc/submodules}}
| |