Jump to content

Module:HeroData/doc

From Deadlock Wiki
Revision as of 22:08, 26 September 2024 by Sur (talk | contribs) (get_hero_var true parameter example updated)

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

  • Page - translates to english
  • Page/en - translates to english
  • Page/es - translates to spanish

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
  • 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.

Examples

From wikitext:

{{#invoke:HeroData|get_hero_var|Abrams|MaxHealth}}

570


{{#invoke:HeroData|get_hero_var|Abrams|FalloffStartRange}}

20.0000108


{{#invoke:HeroData|get_hero_var|Abrams|FalloffStartRange|2}}

20


{{#invoke:HeroData|get_hero_var|Abrams|WeaponName}}

citadel_weapon_hero_atlas_set


{{#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

HeroDPSSustained DPSBullet DamageBullets per secFire Rate (%)AmmoReload Time (s)Reload Delay (s)Bullets Per ShotBullets Per BurstTime Between Bursted Bullets (s)Light MeleeHeavy MeleeReload SingleBullet Velocity (m/s)Bullet Gravity ScaleFalloff Start RangeFalloff End RangeBonus Attack Range (m)Rounds Per Second At Max SpinSpin Acceleration (%)Spin Deceleration (%)Max HealthHealth RegenBullet Resist (%)Spirit Resist (%)Crit Reduction (%)Move Speed (m/s)Sprint Speed (m/s)Stamina Cooldown (s)Stamina
Grey Talon11490.962.51.820172.35011092.4170false4950.8185400008692.500011.30.554
Lash92.561.815.140292.350130.0892.4170false6350.82057.500001010201507.31.553
Paradox86.857.410.93.570402.590150.0792.4170false5250.12057.5000099020006.80.553
Haze72.687.27.261001252.35011092.4170false7621.52046000079720008.30.553
Abrams98.157.16.541.67090.3530.70591092.4170true6100.82045.700009441.50006.80.553
Vyper1718110.316.70241.6011092.4170false411012.7330000880200011.60.554
Seven99.666.516.340292.350130.0892.4170false6350.82057.50000891300-3511.70.553
Wraith97.961.18.8111.10522.82011092.4170false57202057.5000089120007.312.553
Calico129633.2250122.5081092.4170false3180.82057.50000100020007.30.553
Warden13773.626.55.7644172.91011092.4170false2900.252057.50000105020006.31.553
Dynamo74.849.118.740182.35011092.4170false3200.82057.500001130210.5006.80.553
Lady Geist86.359.938.82.220132.59011092.4170false8280.82057.50000110010006.3253
Mo & Krill11564.65.185.560202.82041092.4170false3200.82057.500001180300-208.10.553
Mirage74.650.926.12.860162.6011092.4170false8280.82057.5000095720007.30.553
Yamato93.3977.462.50422.44051098.4183false25402045.7000084120008.30.553
Wrecker1257231.240152.75011092.4170false6350.82057.50000100020007.30.553
Shiv87.657.17.671.90102.8061092.4170false6100.819.841.10000985200070.553
THE MAGNIFICENT SINCLAIR947132.920222.50120.192.4170false86.4025.4610000891300011.90.553
Trapper1641037.561.67082.820131092.4170false38101645.70000105020-1507.30.553
Infernus87.445.58.74100272.49011092.4170false6600.82057.5000096320006.80.553
Bebop10069.58.0412.50662.35011092.4170false5080.82050.8851000110031010.506.553.553
Raven72.547.639.91.82092.59011092.4170false8280.82057.5000091320007.30.553
Ivy11555.98.0514.30332.44011079145false5720.82057.5000091020007.30.554
Pocket10770.47.6120112.820710104161false5590.81645.7000084720-1507.30.553
Kelvin10461.425.940152.59011092.4170false2540.32057.500001200201506.80.553
Fathom11061.57.072.220130.30.70571092.4170true5590.81645.7000094620007.30.553
Holliday10263.245.82.220102.75011092.4170false6350.82057.5000091320008.30.552
Viscous94.157.918.850202.5011092.4170false25402057.5000096820007.30.553
Vindicta10260.519.35.8228222.91011092.4170false7400.820640000745200080.552
McGinnis12375.99.8650663.29011092.4170false5900.82057.5012.50.50.251000215006.80.552

Localizable values

Localizable values as of writing this:

  • Lore
  • Playstyle
  • Role
  • WeaponDescription
  • WeaponName
  • elements in WeaponTypes