Module:HeroData/doc

Revision as of 22:51, 21 September 2024 by Sur (talk | contribs) (initial)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This is the documentation page for Module:HeroData

Overview

This module provides functions to create hero infoboxes or statboxes (and more miscellaneous items).

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

  • write_infobox – Writes a Template:Infobox_hero template call for a given hero
  • write_stat_boxes – Writes all 3 Template:StatBox template calls (Weapon, Vitality, Spirit) for a given hero

Parameters

Both functions use one parameter.

  • hero_name – Name of the hero, in english

Examples

To use this module from wikitext, use

{{#invoke:HeroData|write_stat_boxes|HERO_NAME}}

Which outputs


Abrams
 
Weapon
"Case Closed"
Reloads single shells at a time. Can be interrupted
DPS   70.1
Ammo   9
Bullets per sec   1.67
Reload Time   0.353s
Vitality
Max Health   600
Bullet Resist   0%
Spirit Resist   0%
Move Speed   6.5m/s

Charges into close combat
Abrams has the bulk and sustain to lead from the front, often running into the middle of his foes and watching them scatter. If his enemies waste their fire on him, his backline teammates can lay out damage with impunity.
























or

{{#invoke:HeroData|write_infobox|HERO_NAME}}

Which outputs

Script error: The function "write_stat_boxes" does not exist.