Module:Abilities/doc: Difference between revisions

LVL (talk | contribs)
Updated doc
LVL (talk | contribs)
Updated doc
 
(One intermediate revision by one other user not shown)
Line 7: Line 7:
== Examples ==
== Examples ==
=== get_ability_name ===
=== get_ability_name ===
To get the display name of a hero's ability (numbered 1 to 4):
To get the localized display name of a hero's ability (numbered 1 to 4):
<pre>{{#invoke:Abilities|get_ability_name|hero_atlas|1}}</pre>
<pre>{{#invoke:Abilities|get_ability_name|hero_atlas|1}}</pre>
Returns:
Returns:
<code>{{#invoke:Abilities|get_ability_name|hero_atlas|1}}</code>
<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>
Returns:
<code>{{#invoke:Abilities|get_ability_name|hero_atlas|1|lang=ru}}</code>


=== get_ability_prop ===
=== get_ability_prop ===
Line 17: Line 23:
Returns:
Returns:
<code>{{#invoke:Abilities|get_ability_prop|Afterburn|BurnDuration}}</code>
<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:
<pre>{{#invoke:Abilities|get_ability_prop|Lycan Curse|MaxRage.Scale.Value}}</pre>
Returns:
<code>{{#invoke:Abilities|get_ability_prop|Lycan Curse|MaxRage.Scale.Value}}</code>


=== get_ability_upgrade_prop ===
=== get_ability_upgrade_prop ===