Module:Pet/Data/doc

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

Rarities
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.
 * Example
 * If a pet comes in only and  rarities:

Stats
If a pet has stats, this field should be used. Each stat can come in two forms: Its structure looks like this:
 * 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
Abilities field contains a table with the pet abilities. That table contains other fields described below.

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

Note that -- ability 1/2/3 are comments, used for better navigation.

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 -- ability 1/2/3 are comments, used for better navigation.

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. For a way of setting their values, go to Abilities § Variables section.


 * 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 -- ability 1/2/3 are comments, used for better navigation.

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.

Variables
Variables are the most important part of each ability. The layout is following:

One ability can have multiple variables. This can be handled by adding another table. See legendary, 3rd ability. variable fields should be replaced with the following fields:


 * Ability 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.

Quick Copy
{{Collapsible Section|id=quick-copy| {{DarkCodeBox|lang=lua|text= ['xxx'] = { rarities = 'C-U-R-E-L',  --first letters of each rarity, dashes used only for readability purposes petType = xxx, stats = { str = xxx, },       abilities = { name = { --ability 1 'xxx', --ability 2 'xxx', --ability 3 'xxx', },           desc = { --the describtion of abilities used in the two top cells --ability 1 'xxx', --ability 2 'xxx', --ability 3 'xxx', },           bonus_desc = { --the describtion of abilities used in the bottom cell. --ability 1 'xxx', --ability 2 'xxx', --ability 3 'xxx', },   variables = { common = { { --ability 1 {                   per_lvl = xxx, color = 'Green', suffix = '%%' },           }        },        uncommon = { { --ability 1 {                   per_lvl = xxx, color = 'Green', suffix = '%%' },           }        },        rare = { { --ability 1 {                   per_lvl = xxx, color = 'Green', suffix = '%%' },           },            {  --ability 2 {                   per_lvl = xxx, color = 'Green', suffix = '%%' },           }        },        epic = { { --ability 1 {                   per_lvl = xxx, color = "Green", suffix = "%%" },           },            {  --ability 2 {                   per_lvl = xxx, color = "Green", suffix = "%%" },           }        },        legendary = { { --ability 1 {                   per_lvl = xxx, color = "Green", suffix = "%%" },           },            {  --ability 2 {                   per_lvl = xxx, color = "Green", suffix = "%%" },           },            {  --ability 3 {                   per_lvl = xxx, color = "Green", suffix = "%%" },           }        }    } } }} }}