Module:HeroData/doc
This is the documentation page for Module:HeroData
Overview
This module provides functions to create hero infoboxes, statboxes, or retrieve hero information using the data uploaded to Data:HeroData.json.
Both will automatically be translated depending on the language selected. If called on
See Template:Lang for more
Functions
get_hero_var
Retrieve a hero variable's value, such as Abram's MaxHealth
Parameters
- hero_name - Name of the hero in english, or key of the hero
- hero_var - Key of the hero's variable, see Data:HeroData.json
- sig_figs_or_localize - OPTIONAL, # of sig figs to round to if retrieving a float, or "true" if its a string that should be localized. See Localizable values section.
Note: Recommended to use hero key where possible, i.e. hero_atlas as its O(1) instead of hero name (Abrams) which is O(N).
Examples
From wikitext:
Using hero name in english
{{#invoke:HeroData|get_hero_var|Abrams|MaxHealth}}
570
Using hero key
{{#invoke:HeroData|get_hero_var|hero_atlas|MaxHealth}}
570
{{#invoke:HeroData|get_hero_var|Abrams|FalloffStartRange}}
20.0000108
Round to 2 sig figs
{{#invoke:HeroData|get_hero_var|Abrams|FalloffStartRange|2}}
20
{{#invoke:HeroData|get_hero_var|Abrams|WeaponName}}
citadel_weapon_hero_atlas_set
Localize
{{#invoke:HeroData|get_hero_var|Abrams|WeaponName|true}}
Case Closed
Notes
Only usable on variables that are integers, strings, or floats (meaning not dictionaries/hashes or arrays/lists).
If using sig_figs parameter, ensure the value is a float.
If using localize parameter, ensure the value is a string. See Data:HeroData.json, you will notice that hero_astro's "Lore" variable has the value "hero_astro_lore". This key is then sent to Module:Lang which checks for it in Data:Lang_en.json (or a different language).
get_list_elem
Retrieve a specified element from a list
Parameters
- hero_name - Name of the hero, in english
- hero_var - Key of the hero's variable, see Data:HeroData.json
- number - Index to retrieve from the list. 1 for 1st element, 2 for 2nd element, etc.
- localize - OPTIONAL - "true" if its a string that should be localized. See Localizable values section.
Example
From wikitext:
{{#invoke:HeroData|get_list_elem|Abrams|WeaponTypes|2}}
Attribute_EWeaponAttribute_CloseRange
{{#invoke:HeroData|get_list_elem|Abrams|WeaponTypes|2|true}}
Close Range
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:
{{#invoke:HeroData|write_infobox|HERO_NAME}}
Which outputs Hero Abrams Not Found
write_stat_infoboxes
Writes all 3 Template:Infobox_stat template calls (Weapon, Vitality, Spirit) for a given hero
Parameters
- hero_name – Name of the hero, in english
Example
From wikitext:
{{#invoke:HeroData|write_stat_infoboxes|HERO_NAME}}
Which outputs Hero Not Found
write_hero_comparison_table
Writes the Hero Comparison table for a specific Level and Spirit Power
Parameters
- level - Number of Levels / 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
From wikitext:
{{#invoke:HeroData|write_hero_comparison_table|LEVEL|SPIRITPOWER}}
Which outputs
Hero | DPS | Sustained DPS | Bullet Damage | Bullets per sec | Fire Rate (%) | Ammo | Reload Time (s) | Reload Delay (s) | Bullets Per Shot | Bullets Per Burst | Time Between Bursted Bullets (s) | Light Melee | Heavy Melee | Reload Single | Bullet Velocity (m/s) | Bullet Gravity Scale | Falloff Start Range | Falloff End Range | Bonus Attack Range (m) | Rounds Per Second At Max Spin | Spin Acceleration (%) | Spin Deceleration (%) | Max Health | Health Regen | Bullet Resist (%) | Spirit Resist (%) | Crit Reduction (%) | Move Speed (m/s) | Sprint Speed (m/s) | Stamina Cooldown (s) | Stamina |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Grey Talon | 114 | 90.9 | 62.5 | 1.82 | 0 | 17 | 2.35 | 0 | 1 | 1 | 0 | 92.4 | 170 | false | 495 | 0.8 | 18 | 54 | 0 | 0 | 0 | 0 | 869 | 2.5 | 0 | 0 | 0 | 11.3 | 0.5 | 5 | 4 |
Lash | 92.5 | 61.8 | 15.1 | 4 | 0 | 29 | 2.35 | 0 | 1 | 3 | 0.08 | 92.4 | 170 | false | 635 | 0.8 | 20 | 57.5 | 0 | 0 | 0 | 0 | 1010 | 2 | 0 | 15 | 0 | 7.3 | 1.5 | 5 | 3 |
Paradox | 86.8 | 57.4 | 10.9 | 3.57 | 0 | 40 | 2.59 | 0 | 1 | 5 | 0.07 | 92.4 | 170 | false | 525 | 0.1 | 20 | 57.5 | 0 | 0 | 0 | 0 | 990 | 2 | 0 | 0 | 0 | 6.8 | 0.5 | 5 | 3 |
Haze | 72.6 | 87.2 | 7.26 | 10 | 0 | 125 | 2.35 | 0 | 1 | 1 | 0 | 92.4 | 170 | false | 762 | 1.5 | 20 | 46 | 0 | 0 | 0 | 0 | 797 | 2 | 0 | 0 | 0 | 8.3 | 0.5 | 5 | 3 |
Abrams | 98.1 | 57.1 | 6.54 | 1.67 | 0 | 9 | 0.353 | 0.705 | 9 | 1 | 0 | 92.4 | 170 | true | 610 | 0.8 | 20 | 45.7 | 0 | 0 | 0 | 0 | 944 | 1.5 | 0 | 0 | 0 | 6.8 | 0.5 | 5 | 3 |
Vyper | 171 | 81 | 10.3 | 16.7 | 0 | 24 | 1.6 | 0 | 1 | 1 | 0 | 92.4 | 170 | false | 411 | 0 | 12.7 | 33 | 0 | 0 | 0 | 0 | 880 | 2 | 0 | 0 | 0 | 11.6 | 0.5 | 5 | 4 |
Seven | 99.6 | 66.5 | 16.3 | 4 | 0 | 29 | 2.35 | 0 | 1 | 3 | 0.08 | 92.4 | 170 | false | 635 | 0.8 | 20 | 57.5 | 0 | 0 | 0 | 0 | 891 | 3 | 0 | 0 | -35 | 11.7 | 0.5 | 5 | 3 |
Wraith | 97.9 | 61.1 | 8.81 | 11.1 | 0 | 52 | 2.82 | 0 | 1 | 1 | 0 | 92.4 | 170 | false | 572 | 0 | 20 | 57.5 | 0 | 0 | 0 | 0 | 891 | 2 | 0 | 0 | 0 | 7.3 | 12.5 | 5 | 3 |
Calico | 129 | 63 | 3.22 | 5 | 0 | 12 | 2.5 | 0 | 8 | 1 | 0 | 92.4 | 170 | false | 318 | 0.8 | 20 | 57.5 | 0 | 0 | 0 | 0 | 1000 | 2 | 0 | 0 | 0 | 7.3 | 0.5 | 5 | 3 |
Warden | 137 | 73.6 | 26.5 | 5.76 | 44 | 17 | 2.91 | 0 | 1 | 1 | 0 | 92.4 | 170 | false | 290 | 0.25 | 20 | 57.5 | 0 | 0 | 0 | 0 | 1050 | 2 | 0 | 0 | 0 | 6.3 | 1.5 | 5 | 3 |
Dynamo | 74.8 | 49.1 | 18.7 | 4 | 0 | 18 | 2.35 | 0 | 1 | 1 | 0 | 92.4 | 170 | false | 320 | 0.8 | 20 | 57.5 | 0 | 0 | 0 | 0 | 1130 | 2 | 10.5 | 0 | 0 | 6.8 | 0.5 | 5 | 3 |
Lady Geist | 86.3 | 59.9 | 38.8 | 2.22 | 0 | 13 | 2.59 | 0 | 1 | 1 | 0 | 92.4 | 170 | false | 828 | 0.8 | 20 | 57.5 | 0 | 0 | 0 | 0 | 1100 | 1 | 0 | 0 | 0 | 6.3 | 2 | 5 | 3 |
Mo & Krill | 115 | 64.6 | 5.18 | 5.56 | 0 | 20 | 2.82 | 0 | 4 | 1 | 0 | 92.4 | 170 | false | 320 | 0.8 | 20 | 57.5 | 0 | 0 | 0 | 0 | 1180 | 3 | 0 | 0 | -20 | 8.1 | 0.5 | 5 | 3 |
Mirage | 74.6 | 50.9 | 26.1 | 2.86 | 0 | 16 | 2.6 | 0 | 1 | 1 | 0 | 92.4 | 170 | false | 828 | 0.8 | 20 | 57.5 | 0 | 0 | 0 | 0 | 957 | 2 | 0 | 0 | 0 | 7.3 | 0.5 | 5 | 3 |
Yamato | 93.3 | 97 | 7.46 | 2.5 | 0 | 42 | 2.44 | 0 | 5 | 1 | 0 | 98.4 | 183 | false | 254 | 0 | 20 | 45.7 | 0 | 0 | 0 | 0 | 841 | 2 | 0 | 0 | 0 | 8.3 | 0.5 | 5 | 3 |
Wrecker | 125 | 72 | 31.2 | 4 | 0 | 15 | 2.75 | 0 | 1 | 1 | 0 | 92.4 | 170 | false | 635 | 0.8 | 20 | 57.5 | 0 | 0 | 0 | 0 | 1000 | 2 | 0 | 0 | 0 | 7.3 | 0.5 | 5 | 3 |
Shiv | 87.6 | 57.1 | 7.67 | 1.9 | 0 | 10 | 2.8 | 0 | 6 | 1 | 0 | 92.4 | 170 | false | 610 | 0.8 | 19.8 | 41.1 | 0 | 0 | 0 | 0 | 985 | 2 | 0 | 0 | 0 | 7 | 0.5 | 5 | 3 |
THE MAGNIFICENT SINCLAIR | 94 | 71 | 32.9 | 2 | 0 | 22 | 2.5 | 0 | 1 | 2 | 0.1 | 92.4 | 170 | false | 86.4 | 0 | 25.4 | 61 | 0 | 0 | 0 | 0 | 891 | 3 | 0 | 0 | 0 | 11.9 | 0.5 | 5 | 3 |
Trapper | 164 | 103 | 7.56 | 1.67 | 0 | 8 | 2.82 | 0 | 13 | 1 | 0 | 92.4 | 170 | false | 381 | 0 | 16 | 45.7 | 0 | 0 | 0 | 0 | 1050 | 2 | 0 | -15 | 0 | 7.3 | 0.5 | 5 | 3 |
Infernus | 87.4 | 45.5 | 8.74 | 10 | 0 | 27 | 2.49 | 0 | 1 | 1 | 0 | 92.4 | 170 | false | 660 | 0.8 | 20 | 57.5 | 0 | 0 | 0 | 0 | 963 | 2 | 0 | 0 | 0 | 6.8 | 0.5 | 5 | 3 |
Bebop | 100 | 69.5 | 8.04 | 12.5 | 0 | 66 | 2.35 | 0 | 1 | 1 | 0 | 92.4 | 170 | false | 508 | 0.8 | 20 | 50.8 | 851 | 0 | 0 | 0 | 1100 | 3 | 10 | 10.5 | 0 | 6.55 | 3.5 | 5 | 3 |
Raven | 72.5 | 47.6 | 39.9 | 1.82 | 0 | 9 | 2.59 | 0 | 1 | 1 | 0 | 92.4 | 170 | false | 828 | 0.8 | 20 | 57.5 | 0 | 0 | 0 | 0 | 913 | 2 | 0 | 0 | 0 | 7.3 | 0.5 | 5 | 3 |
Ivy | 115 | 55.9 | 8.05 | 14.3 | 0 | 33 | 2.44 | 0 | 1 | 1 | 0 | 79 | 145 | false | 572 | 0.8 | 20 | 57.5 | 0 | 0 | 0 | 0 | 910 | 2 | 0 | 0 | 0 | 7.3 | 0.5 | 5 | 4 |
107 | 70.4 | 7.61 | 2 | 0 | 11 | 2.82 | 0 | 7 | 1 | 0 | 104 | 161 | false | 559 | 0.8 | 16 | 45.7 | 0 | 0 | 0 | 0 | 847 | 2 | 0 | -15 | 0 | 7.3 | 0.5 | 5 | 3 | |
Kelvin | 104 | 61.4 | 25.9 | 4 | 0 | 15 | 2.59 | 0 | 1 | 1 | 0 | 92.4 | 170 | false | 254 | 0.3 | 20 | 57.5 | 0 | 0 | 0 | 0 | 1200 | 2 | 0 | 15 | 0 | 6.8 | 0.5 | 5 | 3 |
Fathom | 110 | 61.5 | 7.07 | 2.22 | 0 | 13 | 0.3 | 0.705 | 7 | 1 | 0 | 92.4 | 170 | true | 559 | 0.8 | 16 | 45.7 | 0 | 0 | 0 | 0 | 946 | 2 | 0 | 0 | 0 | 7.3 | 0.5 | 5 | 3 |
Holliday | 102 | 63.2 | 45.8 | 2.22 | 0 | 10 | 2.75 | 0 | 1 | 1 | 0 | 92.4 | 170 | false | 635 | 0.8 | 20 | 57.5 | 0 | 0 | 0 | 0 | 913 | 2 | 0 | 0 | 0 | 8.3 | 0.5 | 5 | 2 |
Viscous | 94.1 | 57.9 | 18.8 | 5 | 0 | 20 | 2.5 | 0 | 1 | 1 | 0 | 92.4 | 170 | false | 254 | 0 | 20 | 57.5 | 0 | 0 | 0 | 0 | 968 | 2 | 0 | 0 | 0 | 7.3 | 0.5 | 5 | 3 |
Vindicta | 102 | 60.5 | 19.3 | 5.82 | 28 | 22 | 2.91 | 0 | 1 | 1 | 0 | 92.4 | 170 | false | 740 | 0.8 | 20 | 64 | 0 | 0 | 0 | 0 | 745 | 2 | 0 | 0 | 0 | 8 | 0.5 | 5 | 2 |
McGinnis | 123 | 75.9 | 9.86 | 5 | 0 | 66 | 3.29 | 0 | 1 | 1 | 0 | 92.4 | 170 | false | 590 | 0.8 | 20 | 57.5 | 0 | 12.5 | 0.5 | 0.25 | 1000 | 2 | 15 | 0 | 0 | 6.8 | 0.5 | 5 | 2 |
Localizable values
Localizable values as of writing this:
- Lore
- Playstyle
- Role
- WeaponDescription
- WeaponName
- elements in WeaponTypes
- elements in RecommendedItems