Editing Module:HeroData/docGive feedback
Jump to navigation
Jump to search
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 2: | Line 2: | ||
* [[Module:HeroData/nav]] - For nav box purposes | * [[Module:HeroData/nav]] - For nav box purposes | ||
* [[Module:HeroData/release]] - For determining the release status of a hero | * [[Module:HeroData/release]] - For determining the release status of a hero | ||
* [[Module:HeroData/name]] - For determining translation key using hero name | |||
* [[Module:HeroDataArrays]] - For tables in stat pages | * [[Module:HeroDataArrays]] - For tables in stat pages | ||
| Line 67: | Line 68: | ||
This function will automatically search for the variable in the hero's top-level data, then the 'Weapon' block, then the 'AltFire' block. | This function will automatically search for the variable in the hero's top-level data, then the 'Weapon' block, then the 'AltFire' block. | ||
=== get_list_elem === | === get_list_elem === | ||
| Line 109: | Line 102: | ||
* '''hero_var''' - Key of the hero's variable that is inside either "Spirit Scaling" or "Level Scaling", see [[Data:HeroData.json]] | * '''hero_var''' - Key of the hero's variable that is inside either "Spirit Scaling" or "Level Scaling", see [[Data:HeroData.json]] | ||
* '''sig_figs_or_localize''' - OPTIONAL, # of sig figs to round to. | * '''sig_figs_or_localize''' - OPTIONAL, # of sig figs to round to. | ||
====Examples==== | ====Examples==== | ||
| Line 118: | Line 110: | ||
<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}} | ||
====Notes==== | ====Notes==== | ||
| Line 128: | Line 116: | ||
=== hero_has_stat === | === hero_has_stat === | ||
Checks if a hero possesses a specific stat in their Base data, Level Scaling (Boons), or Spirit Scaling. Used primarily for conditionally hiding rows in infoboxes. | Checks if a hero possesses a specific stat in their Base data, Level Scaling (Boons), or Spirit Scaling. Used primarily for conditionally hiding rows in infoboxes. | ||
====Parameters==== | ====Parameters==== | ||
| Line 140: | Line 126: | ||
=== get_hero_key === | === get_hero_key === | ||
Returns the key of the specified hero's english name | Returns the key of the specified hero's english name | ||
====Parameters==== | ====Parameters==== | ||
* '''hero_name''' - Name of the hero in english | * '''hero_name''' - Name of the hero in english | ||
====Example==== | ====Example==== | ||
<pre>{{#invoke:HeroData|get_hero_key|Abrams}}</pre> | <pre>{{#invoke:HeroData|get_hero_key|Abrams}}</pre> | ||
=== get_ability_key === | === get_ability_key === | ||
| Line 178: | Line 154: | ||
<pre>{{#invoke:HeroData|get_hero_tag|Abrams|1}}</pre> | <pre>{{#invoke:HeroData|get_hero_tag|Abrams|1}}</pre> | ||
=== | === write_infobox === | ||
Writes a [[Template:Infobox_hero]] template call for a given hero | |||
====Parameters==== | |||
* '''hero_name''' – Name of the hero, in english | |||
====Example==== | |||
From wikitext:<br> | |||
<pre>{{#invoke:HeroData|write_infobox|HERO_NAME}}</pre> | |||
Which outputs | |||
{{#invoke:HeroData|write_infobox|Abrams}} | |||
=== write_stat_infoboxes === | |||
Writes all 3 [[Template:Infobox_stat]] template calls (Weapon, Vitality, Spirit) for a given hero | |||
====Parameters==== | ====Parameters==== | ||
* ''' | * '''hero_name''' – Name of the hero, in english | ||
====Example==== | |||
From wikitext:<br> | |||
<pre>{{#invoke:HeroData|write_stat_infoboxes|HERO_NAME}}</pre> | |||
Which outputs | |||
{{#invoke:HeroData|write_stat_infoboxes|Abrams}} | |||
=== write_hero_comparison_table === | |||
Writes the [[Hero Comparison]] table for a specific Level and Spirit Power | |||
====Parameters==== | |||
* '''level''' - Number of [[Level]]s / Power Increases | |||
* '''spirit_power''' - Amount of Spirit power | |||
Both parameters are optional, as if both are 0 or not provided, the outputted table will be at base and will also include the level/SS scaling in each cell along with the base value, rather than the scaled value. | |||
====Example==== | ====Example==== | ||
<pre>{{#invoke:HeroData| | From wikitext:<br> | ||
{{#invoke:HeroData| | <pre>{{#invoke:HeroData|write_hero_comparison_table|LEVEL|SPIRITPOWER}}</pre> | ||
Which outputs | |||
{{#invoke:HeroData|write_hero_comparison_table|11|200}} | |||
=== write_role_playstyle_quote === | === write_role_playstyle_quote === | ||
| Line 230: | Line 239: | ||
== Internal Utility Functions == | == Internal Utility Functions == | ||
The following functions are | The following functions are primarily for internal use but may be useful for advanced users: | ||
=== get_json_item === | === get_json_item === | ||
| Line 238: | Line 247: | ||
* '''name''' - Name of the hero in english | * '''name''' - Name of the hero in english | ||
=== | === get_similar_items === | ||
Returns | Returns an array of hero tables that have a specified property | ||
====Parameters==== | ====Parameters==== | ||
* ''' | * '''property''' - Property key to search for | ||
== Scaling System == | == Scaling System == | ||