Module:HeroUtil/doc

Utility functions for Heroes.

getLowestRarities {...}
Obtains the non-focus rarities, focus rarities, and reward rarities of a Hero or all Heroes. Focus and reward rarities are based on all Summoning Focuses and rewards over time.

Parameters

 * page: The page name of the Hero.
 * current: True if only the current general summoning pool is used to populate non-focus rarities, false to use all previous general summoning pools as well. This does not affect focus and reward rarities.
 * new: True if only Heroes that appear in New Heroes or Special Heroes summoning events are considered, false to include all summoning events. Has no effect if page is given.
 * mask: If given, must be a table with the following keys:
 * nonfocus: Query non-focus rarities if this field is true, skip the query otherwise.
 * focus: Query focus rarities if this field is true, skip the query otherwise.
 * reward: Query reward rarities if this field is true, skip the query otherwise.

Return values
The availability object is a Lua table with the following fields: And the following method:
 * nonfocus: Lua sequence of rarities at which a Hero can be summoned as a non-focus unit. Unavailable if omitted using the mask parameter; otherwise, always present even if it is empty.
 * focus: Lua sequence of rarities at which a Hero can be summoned as a focus unit. Similarly masked.
 * reward: Lua sequence of rarities at which a Hero has been rewarded. Similarly masked.
 * bounds: Returns the minimum and maximum rarities the Hero is available at, based on the rarities present in this object. Returns nil if the Hero is unavailable.

If page is given, the return value is simply the availability object of the Hero with that page name.

If page is nil, the function returns a table instead, where each key is a Hero's page name and the value is the availability object of that Hero. Only Heroes with available rarities appear in this table (e.g. Special Heroes will not appear at all if mask is set to, because they never appear as non-focus units in summoning events).

getReleaseTimes {...}
Like getLowestRarities, but for the earliest times the Heroes are released.

Parameters

 * page, mask: Same as getLowestRarities.
 * current, new: Ignored; these options only affect Heroes who are previously available and therefore cannot alter the release times.

Return values
The availability object is a Lua table with the following fields: And the following method: All timestamps represent if a Hero is unavailable.
 * nonfocus: Unix timestamp representing the earliest time a Hero can be summoned as a non-focus unit. May be masked.
 * focus: Unix timestamp representing the earliest time a Hero can be summoned as a focus unit. May be masked.
 * reward: Unix timestamp representing the earliest time a Hero has been rewarded. May be masked.
 * earliest: Returns the earliest time a Hero is available, based on the release times present in this object.

The top-level return value is defined in the same way as getLowestRarities.

lowestRarity
Returns the lowest rarity a Hero is available at, by considering non-focus / focus / reward sources of the Hero. Returns nothing if the Hero is unavailable.

Parameters
Omitting all of nonfocus, focus, and reward has the same effect as considering all these sources. If only some of these arguments are omitted, the omitted sources are ignored.
 * 1: Page name of the Hero.
 * nonfocus: Whether the current general summoning pool is considered.
 * focus: Whether all past summoning events are considered.
 * reward: Whether reward units are considered.

availabilityText
Returns a wikitext string representing the rarities the Hero on the given page is available at. Only rarities from a single source are chosen; non-focus rarities have the highest priority, followed by focus rarities, and finally reward rarities.

Parameters

 * 1, nonfocus, focus, reward: Same as lowestRarity.
 * avail: Lua-only. If given, should be an availability object returned from getLowestRarities; in this case the function uses the rarities defined in that object instead of querying the database with the other parameters.