:GetEquipInfo/doc

Terraria Wiki
둘러보기로 이동 검색으로 이동

This template is used to dynamically display the effects of one or several equipped armor items or accessories, or a list of items which have a certain effect when equipped. It takes its data from the database which is based on the source code of Terraria.

Usage

List effects of item

{{ equipinfo | <item name(s) or ID(s)> | item = <item name(s)> | id = <item ID(s)> | <stat to query> | stat = <stat to query> | list = y/yes (optional) | raw = y/yes (optional) }}

First unnamed parameter, item, and id

Specify the item(s) in question; defaults to page name. Only one out of these should be used. Multiple items are to be separated with a slash (/).

Set the first unnamed parameter to statlist and omit all other parameters to print a list of all available stats.

틀:Collapse top

  1. REDIRECT Template:GetEquipInfo

틀:Collapse bottom

Second unnamed parameter or stat

Specify a stat to query; must be a value from those in the list to the right. May be omitted if $list is set. See Template:GetEquipInfo/l10n for hints on the meaning of the stat names.

list

Set this parameter to display all stats of the item(s). The second unnamed parameter will be ignored.

raw

By default, a stat's value will be displayed with some basic formatting to improve readability. Set this parameter to display the raw value as it is in the source code. If used with $list, will display the effects in a <stat name 1>:<stat value 1>;<stat name 2>:<stat value 2> format.

List items with effect

This functionality is handled by {{equipinfo/list}}.

{{ equipinfo/list | <stat name> | where = <custom constraint string> | format = itemname/dotlist/itemlist/mclist (optional) | sep = <custom list separator> (optional) | orderby = <stat to order by> (optional) }}

First unnamed parameter

Specify a stat to look for. The template will fetch all items that have this stat set to any value. $where takes precedence over this parameter.

where

Specify a custom query string in SQL syntax; the queried database is the Equipinfo cargo table. Using the first unnamed parameter is equivalent to |where=<value of $1> IS NOT NULL.

format

By default, the template will merely display a list of item IDs which match the queried effect. There are some predefined formatting options to convert this list into a more usable one: itemname replaces the IDs by the respective item names, and dotlist, itemlist, and mclist produce a list of the respective type with all IDs replaced by {{item}}s. Use the respective {{/options}} subtemplates to take control of the list templates' parameters. Another format option is itemname-linked-pretty, which displays a {{comma}}-formatted list of item names linked using {{eil}}. Specifying any other format option will result in an error.

Custom formatting may be applied by simply passing the output of this template to, for instance, one of the list handling functions of the ParserPower extension, like {{#[[[:틀:Tl/parser function links]]##lstmap lstmap]:}}.

sep

Specify the list separator of the result list, ;&#32; by default. Only has an effect when using the itemname or default $format option.

orderby

Specify the stat by which the result list should be ordered; defaults to item ID. The parameter accepts SQL syntax.

Examples

List effects of item

Code Result
{{equipinfo|Hermes Boots|accRunSpeed}}
  1. REDIRECT Template:GetEquipInfo
{{equipinfo|Hermes Boots|list=y}}
  1. REDIRECT Template:GetEquipInfo
{{equipinfo|Tiki Mask|list=y}}
  1. REDIRECT Template:GetEquipInfo
{{equipinfo|Tiki Shirt|list=y}}
  1. REDIRECT Template:GetEquipInfo
{{equipinfo|Tiki Pants|list=y}}
  1. REDIRECT Template:GetEquipInfo
{{equipinfo|Tiki Mask/Tiki Shirt/Tiki Pants|list=y}}
  1. REDIRECT Template:GetEquipInfo
{{equipinfo|Tiki Mask/Tiki Shirt/Tiki Pants|list=y|raw=y}}
  1. REDIRECT Template:GetEquipInfo

List items with effect

Code Result
{{equipinfo/list|discount}} 틀:Equipinfo/list
{{equipinfo/list|discount|format=itemname}} 틀:Equipinfo/list
{{equipinfo/list|discount|format=dotlist}} 틀:Equipinfo/list
{{equipinfo/list|where=discount IS NOT NULL AND goldRing IS NULL|format=dotlist}} 틀:Equipinfo/list