Module:Abilities/doc: Difference between revisions

From The Deadlock Wiki
Jump to navigation Jump to search
No edit summary
LVL (talk | contribs)
Updated doc
 
Line 23: 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 ===

Latest revision as of 20:24, 3 April 2026

Overview

[edit source]

The Abilities module provides functions for retrieving data about hero abilities and their upgrades.

  • The function get_ability_name references Data:AbilityCards.json to link a hero and ability slot to an ability's display name.
  • The functions get_ability_prop and get_ability_upgrade_prop reference Data:AbilityData.json to get specific stats from an ability's base data or its upgrades.

Examples

[edit source]

get_ability_name

[edit source]

To get the localized display name of a hero's ability (numbered 1 to 4):

{{#invoke:Abilities|get_ability_name|hero_atlas|1}}

Returns: Siphon Life

Function can be passed with lang parameter to override the current language to a specific language code.

{{#invoke:Abilities|get_ability_name|hero_atlas|1|lang=ru}}

Returns: Переливание жизни

get_ability_prop

[edit source]

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").

{{#invoke:Abilities|get_ability_prop|Afterburn|BurnDuration}}

Returns: 3

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 Scale table:

{{#invoke:Abilities|get_ability_prop|Lycan Curse|MaxRage.Scale.Value}}

Returns: 9.4

get_ability_upgrade_prop

[edit source]

To get a property from a specific upgrade of an ability.

{{#invoke:Abilities|get_ability_upgrade_prop|Afterburn|3|DPS}}

This example gets the DPS value from the 3rd upgrade for the ability "Afterburn".

Returns:

Another example, getting the `DamageAmplificationPerStack` from the 2nd upgrade of "Marksman":

{{#invoke:Abilities|get_ability_upgrade_prop|Marksman|2|DamageAmplificationPerStack}}

Returns: Ability Not Found

Submodules

[edit source]

Abilities - Simple functions. Eg. getting ability name

Abilities/utils - Common internal functions that are shared amongst any Abilities/ modules

Abilities/card - Generates hero ability cards

Abilities/icon - Functions for retrieving ability and attribute icon data

Abilities/details table (WIP) - Generates details table to show raw ability data