Editing Module:Abilities/doc

Warning: You are not logged in. Once you make an edit, a temporary account will be created for you. Learn more. Log in or create an account to continue receiving notifications after this account expires, and to access other features.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
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 handles any simple functions that don't require a submodule.


* 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 function <code>get_ability_name</code> and most of the submodules reference [[Data:AbilityCards.json]].
* 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.
 
The function <code>get_ability_prop</code> references [[Data:AbilityData.json]].


== Examples ==
== Examples ==
=== get_ability_name ===
To get the 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:
<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:
Returns:
<code>{{#invoke:Abilities|get_ability_name|hero_atlas|1|lang=ru}}</code>


=== get_ability_prop ===
<code>{{#invoke:Abilities|get_ability_name|hero_atlas|1}}</code>
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:
To get a property of an ability (WIP):
<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 ===
<pre>{{#invoke:Abilities|get_ability_prop|Siphon Life|AbilityCooldown}}</pre>
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:
Returns:
<code>{{#invoke:Abilities|get_ability_upgrade_prop|Afterburn|3|DPS}}</code>


Another example, getting the `DamageAmplificationPerStack` from the 2nd upgrade of "Marksman":
<code>{{#invoke:Abilities|get_ability_prop|Siphon Life|AbilityCooldown}}</code>
<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}}
{{Module:Abilities/doc/submodules}}
Please note that all contributions to The Deadlock Wiki are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see Deadlock:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)
Preview page with this template