Module:Pet/Data/doc

Module:Pet/Data is a storage module used by Module:Pet.

Data Structure Description
Every pet should contain a field. It should be a string of text containing first letters of each rarity of the pet. Not case sensitive. Letters can be separated with anything. Do not use %, it gets added afterwards.
 * -|Rarities=
 * Example
 * If a pet comes in only and  rarities:

If a pet has stats, this field should be used. Each stat can come in two forms: Its structure looks like this:
 * -|Stats=
 * Leveling stat (one that increases every level)
 * Base stat (one that does not change, leveling stat gets added to it)

stat should be replaced with proper stat code (every stat is supported, see Statname for further reference), while per_lvl and base should be replaced with a numeric value (not string!). base value is not required, and can be deleted if not used.
 * Example
 * For a pet with base strength of 10 and max strength of 60 (which comes to 0.5 strength per level)

Abilities field contains a table with the pet abilities. That table contains other fields described below.
 * -|Abilities=

Name
Name field is a table containing names of abilities. The layout is following:

Note that the [n] entry records for the n-th ability.

Strings are all required and case sensitive. If a pet has number of abilities different than 3, just add or remove a line.

Description
Description field is a table containing main descriptions of abilities. The layout is following:

Note that the [n] entry records for the n-th ability.

Strings are all required and case sensitive. If a pet has number of abilities different than 3, just add or remove a line.
 * Inserting variables
 * Descriptions, in most cases, contain variables that change every level (some may be rounded). Place where they should be located are marked using $($n$)$, where n can be from 0 to 99. Variables for each ability (1/2/3/4) are indexed separately, which means that variables of an ability always start at {0}, then {1}, {2} and so on. They must be continuous, i.e. you cannot skip numbers for it to work. See Variables tab for the method of setting their values.


 * Inserting stat names
 * Some ability descriptions may contain some uses of Statname. Those can be marked with STAT_ALIAS or STATs_ALIAS (for short stats) where ALIAS is the proper alias for each stat (every stat is supported, see Statname for further reference). Must be uppercase.


 * Inserting colors
 * Some abilities may contain colored text. This can be formatted using tags similar to HTML/XML tags, but uppercase. Example: ... (... can be replaced with anything). Every color is supported. Must be uppercase.


 * Inserting coins
 * A few abilities may contain the Coins template. It can be inserted by typing COINS in the description. Must be uppercase.

Bonus Description
Bonus Description field is a table containing bonus description (the one in the bottom cell of the table). Each field should only be used if the ability description contains a variable. The layout is following:

Note that the [n] entry records for the n-th ability.

Strings are all required and case sensitive. If a pet has number of abilities different than 3, just add or remove a line.

If an ability description doesn't contain a variable, set the proper value to nil (not "nil"!) to avoid confusion when editing (to mark that the field should be empty and is not accidentally deleted). After this, the bonus description will be set to the default one (no leveling bonus)

Amounts
Some pets may have a number of abilities other than the default 1-1-2-2-3. In this case, add a special field (ideally before ). It should be a string containing the amounts of abilities for each rarity (0 if rarity doesn't exist). It should always contain 5 numbers. Numbers can be separated with anything.

The variables field adds data for each rarity of the pet. The layout is following:
 * -|Variables=

Rarity-based Variables
rarity-based variable fields should be replaced with the following fields (if any):

Ability Variables
One ability can have multiple variables. This can be handled by adding another table. See legendary, 3rd ability.

ability variable fields should be replaced with the following fields:


 * Abilities with no variables
 * If an ability does not have any variables, do not delete that ability table. Instead, replace the variable table with nil. Example:


 * Rarity doesn't exist
 * If a certain rarity doesn't exist, remove it completely from the variables table.