Module:HeroData/doc: Difference between revisions

Jump to navigation Jump to search
No edit summary
LVL (talk | contribs)
Added missing functions and expanded localizable values
Line 108: Line 108:
<pre>{{#invoke:HeroData|get_hero_scalar|hero_atlas|Level|BulletDamage|2}}</pre>
<pre>{{#invoke:HeroData|get_hero_scalar|hero_atlas|Level|BulletDamage|2}}</pre>
{{#invoke:HeroData|get_hero_scalar|hero_atlas|Level|BulletDamage|2}}
{{#invoke:HeroData|get_hero_scalar|hero_atlas|Level|BulletDamage|2}}
=== get_hero_key ===
Returns the key of the specified hero's english name
====Parameters====
* '''hero_name''' - Name of the hero in english
====Example====
<pre>{{#invoke:HeroData|get_hero_key|Abrams}}</pre>
=== get_ability_key ===
Gets the ability key from a hero's bound ability slot
====Parameters====
* '''hero_key''' - Key of the hero
* '''slot_number''' - Slot number (1-based index)
====Example====
<pre>{{#invoke:HeroData|get_ability_key|hero_atlas|1}}</pre>
=== get_hero_tag ===
Retrieve a hero's description tags with [[Module:Lang]], to be used in [[Template:HeroRosterCard]] and [[Template:Infobox hero]]
====Parameters====
* '''name''' - Name of the hero in english. This is normally referenced from the template parameters
* '''number''' - Which tag to call (1, 2 or 3)
====Example====
<pre>{{#invoke:HeroData|get_hero_tag|Abrams|1}}</pre>


=== write_infobox ===
=== write_infobox ===
Line 152: Line 181:
{{#invoke:HeroData|write_hero_comparison_table|11|200}}
{{#invoke:HeroData|write_hero_comparison_table|11|200}}


=== get_hero_tag ===
=== write_role_playstyle_quote ===
Retrieve a hero's description tags with [[Module:Lang]], to be used in [[Template:HeroRosterCard]] and [[Template:Infobox hero]]
Writes a formatted role and playstyle quotation for a hero
 
====Parameters====
* '''hero_key''' - Key of the hero
 
====Example====
<pre>{{#invoke:HeroData|write_role_playstyle_quote|hero_atlas}}</pre>
 
=== write_default_items ===
Writes the recommended items list for a hero


====Parameters====
====Parameters====
* '''name''' - Name of the hero in english. This is normally referenced from the template parameters
* '''hero_key''' - Key of the hero (unlocalized)
* '''number''' - Which tag to call (1, 2 or 3)
 
====Example====
<pre>{{#invoke:HeroData|write_default_items|hero_atlas}}</pre>


== Localizable values ==
== Localizable values ==
Localizable values as of writing this:
Localizable values as of writing this:
* Hero names (via hero keys)
* Lore
* Lore
* Playstyle
* Playstyle
Line 168: Line 209:
* elements in WeaponTypes
* elements in WeaponTypes
* elements in RecommendedItems
* elements in RecommendedItems
* All stat labels and postfixes
* Ability descriptions and names
* Hero tags (1, 2, 3)
== Internal Utility Functions ==
The following functions are primarily for internal use but may be useful for advanced users:
=== get_json_item ===
Returns the table of a specific hero by name
====Parameters====
* '''name''' - Name of the hero in english
=== get_similar_items ===
Returns an array of hero tables that have a specified property
====Parameters====
* '''property''' - Property key to search for
== Scaling System ==
The module supports two types of scaling:
* '''Spirit Scaling''' - Affects stats based on Spirit Power
* '''Level Scaling''' - Affects stats based on Power Increases/Levels/Boons