Module:Util/doc

From Fire Emblem Heroes Wiki
Jump to: navigation, search

This is the documentation page for Module:Util

This module blackboxes several FEH-related operations (eg. Fetching heroes, skills, skill info) and is intended for use by other Lua modules. This module should not be called from #invoke directly.

mf(str)[edit source]

Removes special characters from str so that it is usable as a file name; equivalent to {{MF}}.

isNilOrEmpty(val)[edit source]

Checks if the specified value is nil or empty

returnDefaultIfEmpty(val)[edit source]

Returns '-' if the specified value is nil or empty

parseTime(str)[edit source]

Returns the Unix timestamp representing the given ISO 8601 formatted time.

formatTime(t)[edit source]

Returns the ISO 8601 formatted time represented by the given Unix timestamp.

MIN_TIME[edit source]

The constant string 1970-01-01T00:00:00Z.

MAX_TIME[edit source]

The constant string 2038-01-19T03:14:07Z.

getHeroIcon(hero,size,resplendent)[edit source]

  • Input: Hero name, image size, whether to obtain the Resplendent Attire (default false)
  • Output: Icon of the Hero that links to the Hero page

getWeaponSortOrder()[edit source]

Obtains the sort order of weapon types, by color then by weapon. Uses WeaponTypes.

Return values[edit source]

A table that maps full weapon types to increasing values, e.g. 'Red Sword'1, 'Red Bow'2.

getMoveSortOrder()[edit source]

Obtains the sort order of move types. Uses MoveTypes.

Return values[edit source]

A table that maps move types to increasing values, e.g. 'Infantry'1, 'Armored'2.

getSkillChains(skills)[edit source]

Returns two tables representing dependencies between the given skills. The first table contains WikiName of skills as keys and lists of the skill's prerequisites as values; the second table is for descendants of skills.

If a table is passed as an argument, it must be a list that contains only the WikiNames of skills to be queried. Otherwise all existing skills are used.

getRarityText()[edit source]

Returns an array containing rarity texts from 1★ to 5★.

getDifficulties()[edit source]

Returns a sorted array of difficulties.

difficultySort(x, y)[edit source]

Returns the relative order between two unit tab names, based on their difficulties. Can be used as the comparison function to table.sort.