Шаблон:Item infobox

Материал из Terraria Wiki
Перейти к навигации Перейти к поиску
Этот шаблон использует расширение Cargo.
Этот шаблон использует Расширение:Cargo — неотъемлемую часть серверной части вики.
Этот шаблон интернационализирован (i18n) — это означает, что его легко переводить на другие языки.
Для более подробной информации см. шаблоны i18n и l10n (англ.)
Перевести этот шаблон можно на странице «Шаблон:Item infobox/l10n».
Этот шаблон использует Lua.
Этот шаблон использует Модуль:Iteminfo — скрипт, написанные на языке программирования Lua. Для более подробной информации о Lua, см. Terraria Wiki:Lua (англ.).
Template-info.svg Документация Документация, указанная ниже, находится на странице «Шаблон:Item infobox/док». (править | история)
См. также этот шаблон на английском языке: Template:Item infobox. В нём может содержаться более полная или подробная информация.

This template is used for displaying the infobox for an item. It is one of the most important and most powerful infobox templates.

Usage

While the template is extremely versatile, its main functionality is to display the standard infobox.

The data which is to be displayed can be manually entered when calling the template, but thanks to {{iteminfo}}, the vast majority of data is generated automatically. To enable automatic data, use the parameter auto and set it to the ID of the item (alternatively: auto=yes and either id=<item ID>, name=<item name>, or nothing else – the latter two methods will cause the template to automatically generate the ID using {{itemIdFromName}}, with the last method using the page title for name reference). This way, all relevant item parameters are set automatically. See the table below for affected parameters. However, they can still be overridden and manually entered parameters always take precedence over the automatic ones.

Основные параметры

Notes:
  • The dollar sign ($) is used to signify that the word after it is the name of a template parameter.
  • All parameters which have a default value listed can usually be omitted. Note that this does not mean that parameters which do not have a default value listed should always be filled in.
Параметр Описание Авто Пример Значение по умолчанию
(если пропущено)
Примечание
{{item infobox

Параметры карточки

Параметры карточки
| boxwidth Width of the infobox 27em 21em Number with unit. Default is 21em or stretching to image width
| float Position of the infobox left right
| css
 or
| style
CSS style affecting the entire infobox Any width or float properties defined here will override the template's $boxwidth and $float parameters, respectively.
| auto Enables automatic data 465 Can also be yes (see text above).
| id ID of the item ✔️ 465 The automatic data gathering for $tooltip is based on this.
| name Name of the item ✔️ Wood Page name Will be displayed as heading of the infobox.
| lname Localized name of the item ✔️ Древесина {{tr|$name}} Will be displayed as heading of the infobox; only to be used if $name is not existent in the {{tr}} database of the specific language.
| showenglishname Display of English name of this item yes
no
Defaults to no for languages that have an in-game translation (en, de (немецкий), es (испанский), fr (французский), it (итальянский), pl (польский), pt (португальский), ru (русский), zh (китайский)), and to yes for all other languages.
| namesub Name sub-heading Additional information directly underneath the title of the infobox; rarely useful for item infoboxes.

Image-related parameters

Image-related parameters
| imagealt Complete custom control over the entire image display [[File:Wood.png]] Overrides all image parameters in this parameter category (except for $imagebreak).

If intending to manually reproduce the gray border that the infobox places automatically between $image, $imageold. etc., a simple <hr/> should not be used. Instead, enclose the different images that should be separated in <li> tags (except for the first image). The $imagebreak parameter will also still work as expected in this case and create vertical breaks at the separators. See Sensors for a simple example and Fish Bowls for a more elaborate, fully customized example.

Use |imagealt= to hide all images.

| ext File extension of $image gif png
| image Main image of the inventory icon or equipped item/set Wood.png $name.$ext
| imageold Variant image of the older versions Compass (old).png $name (old) Default value: First checks for the .gif and then for the .png. Due to the way the automatic image detection is handled internally, it will likely fail on items whose name contains a dot (e.g. S.D.M.G.). It is necessary to explicitly specify the image in that case. (This applies to all image-related parameters.)
| imageplaced Image of the placed item Wood (placed).png $name (placed)
| imageequipped Image of the equipped item/set Shackle (equipped).png $name (equipped)
| imagefemale Image of the female equipped item/set Robe (equipped) female.png $name female.$ext
| imageoldalt Complete custom control over the "old" image display [[File:Compass (old).png]] Use |imageoldalt= to hide the default "old" image.
| imageplacedalt Complete custom control over the "placed" image display [[File:Wood (placed).png]] Use |imageplacedalt= to hide the default "placed" image.
| imageequippedalt Complete custom control over the "equipped" image display [[File:Shackle (equipped).png]] Use |imageequippedalt= to hide the default "equipped" image.
| imagebreak Arranges multiple images in rows rather than in columns yes Causes the main/"old", "placed", "equipped", and "female" images to all take up a separate row, with small horizontal bars in between (example: Book). Note that the main and "old" images will always be displayed in the same row.
| imagemode Controls image selection placed/equipped full If set to full (which will only be the default for the infobox $view), the template will attempt to display all different types of images mentioned above. If not set to full, it will only attempt to display the main image (which will be the case for other $views by default, e.g. table), for performance reasons. It is possible, however, to enable (attempted) display of certain image types even if the mode is not full: Set the parameter to old, placed, equipped, or any combination of these three to cause the template to fetch these images as well.
| imageinfo Prevents the internal usage of {{image}} no Setting it to no will cause the template to use the standard [[File:]] syntax instead of {{image}}. {{image}} will increase the expensive function count, so if there are many item infoboxes on one page, the expensive function count limit may be exceeded. Using imageinfo=no can reduce the count to avoid exceeding it. In the vast majority of cases, this is not necessary.

Параметры характеристик

Параметры характеристик
| autoswing Auto-use capability ✔️ yes Displays Autoswing, Autofire, or Auto-use in the top-right corner of the infobox. Hover text is determined by $damagetype ("Autoswing" for melee, "Autofire" for ranged and magic, and "Auto-use" for anything else).
| stack Maximum possible stack size ✔️[1] 99 1 Maximum quantity of this item that can be stacked in a single inventory slot.
| pick Pickaxe power ✔️[1] 100 Without percentage sign (%), unless more complex wikitext is used. If any of the three parameters is used, all three symbols will always be displayed: Pickaxe icon.png Hammer icon.png Axe icon.png
| hammer Hammer power ✔️[1] 75
| axe Axe power ✔️[1] 50
| pickreq Required pickaxe power for destroying 150 Without percentage sign (%)!
| hammerreq Required hammer power for destroying 80 Without percentage sign (%)! Prints the following behind it: "(только в сложном режиме)"
| type
 (deprecated:
| type2)
Classification and categorization ✔️ Weapon/Tool Broad classifications like "Weapon", "Tool", "Furniture", etc. Separate multiple values with a slash (/). Many types, such as "Crafting material", will be added automatically.
| fishing Fishing power ✔️[1] Without percentage sign (%)!
| bait Bait power ✔️ Without percentage sign (%)!
| damage Damage ✔️[1]
| damagetype Damage type ✔️[1] Possible values: melee, ranged, magic, summon, and throwing. The infobox will automatically categorize the page in the appropriate weapon type category, but only for the automatically generated damage type. For any additional, manually added damage type, a |listcat=<damage type> weapons will be necessary.
| knockback Knockback ✔️[1] @@@@ / {{kb|5}} If more than one value is needed, wrap the individual values with {{kb}} in order to ensure correct styling. The @@@@ string does not need {{kb}}.
| defense Defense ✔️[1]
| tileboost Tile range boost ✔️
| bonus Miscellaneous bonuses
| setbonus Set bonus ✔️[1] For armor sets, where $type contains Set. Note that because this parameter is only sensible for set item infoboxes – which don't use $auto since it doesn't work with sets – its data will always be generated automatically (instead of only when $auto is set). Set this parameter to an empty value to hide the automatically generated set bonus.
| placeable Placeable ✔️ yes no
| width Width when placed In tiles. Defaults to 1 for blocks.
| height Height when placed
| consumable Consumable ✔️ True if the item leaves the player's inventory with Использовать / Атаковать; includes placeable items. It is found in the game's source code.
| mana Mana cost ✔️[1]
| mheal Mana restoration ✔️[1]
| hheal Health restoration ✔️[1]
| critical Critical strike chance ✔️[1] 11 Without percentage sign (%), unless more complex wikitext is used. If no value is entered and the main $type is Weapon, a default value of 4 will be used.
| body slot Body slot ✔️
| use Use time ✔️[1] @@@@ / {{ut|30}} If more than one value is needed, wrap the individual values with {{ut}} in order to ensure correct styling. The @@@@ string does not need {{ut}}.
| velocity
 (deprecated:
| sspeed)
Velocity ✔️[1]
| toolspeed Tool speed ✔️[1]
| tooltip Tooltip ✔️[1]
| rare Rarity ✔️[1] @@@@ / {{rare|0}} Use the {{rare}} template.
| research Research required ✔️ 5
| buy Buy value ✔️[1] Enter the value using the coin template ({{coin}}). If using $auto, use buy=y/yes/true/show to enable display of automatic buy price (disabled by default, since many items that can be sold cannot be bought). Alternatively, add buy, buyable, or vendor to $tags.
| sell Sell value ✔️[1] Also enter the value using the coin template.
| value Value ✔️ Mostly used internally. Will not be displayed directly, but serves as the base for $buy and $sell. It can be used to suppress buy and sell value display entirely by setting it to a blank value (|value=).

Параметры бафов и дебафов

Параметры бафов и дебафов
| buff Buff provided ✔️ Name of the buff. As a shortcut for $buffduration and $buffchance, they can be appended to this value, separated with a slash: | buff = <name> / <duration> / <chance>. Chance may also be omitted.
| idbuff Buff ID ✔️
| bufflink Buff link target ✔️
| bufftip Buff tooltip ✔️
| buffchance Buff chance ✔️
| buffduration Buff duration ✔️[1] Enter the value using the {{duration}} template.
| buff<n> Additional buff provided Can be continued nearly infinitely, e.g. buff2, buff3, etc.
| idbuff<n> Buff ID
| bufflink<n> Buff link target
| bufftip<n> Buff tooltip
| buffchance<n> Buff chance
| buffduration<n> Buff duration
| debuff Debuff inflicted Name of the debuff. As a shortcut for $debuffduration and $debuffchance, they can be appended to this value, separated with a slash: | debuff = <name> / <duration> / <chance>. Chance may also be omitted.
| iddebuff Debuff ID
| debufflink Debuff link target
| debufftip Debuff tooltip
| debuffchance Debuff chance
| debuffduration Debuff duration [1] Enter the value using the {{duration}} template.
| debuff<n> Additional debuff provided Can be continued nearly infinitely, e.g. debuff2, debuff3, etc.
| iddebuff<n> Debuff ID
| debufflink<n> Debuff link target
| debufftip<n> Debuff tooltip
| debuffchance<n> Debuff chance
| debuffduration<n> Debuff duration

Параметры звуков

Параметры звуков
| sounduse Use sound effect ✔️ Item_1.wav Can be a comma-separated list for multiple sounds. Caption is "При исп.".
| sound1 Custom additional sound effect Can be a comma-separated list for multiple sounds.
| soundcaption1 Caption for the sound effect
| sound2 Custom additional sound effect Can be a comma-separated list for multiple sounds.
| soundcaption2 Caption for the sound effect
| sound<n> Custom additional sound effect Can be continued nearly infinitely, e.g. sound3+soundcaption3, sound4+soundcaption4, etc. Sounds will only be displayed if there is a sound<n> parameter with a corresponding soundcaption<n> parameter.
| soundcaption<n> Caption for the sound effect

Параметры средств передвижения

Параметры средств передвижения
| idmount Mount ID ✔️

Параметры снарядов

Параметры снарядов
| idprojectile
 (deprecated:
| shoot)
Projectile ID ✔️ Can be a comma-separated list for multiple IDs.
| projectilename Projectile name ✔️
| projectileimage Projectile image ✔️
| projectileblock Projectile images arrangement Operates similarly to $imagebreak.

Параметры идентификаторов

Параметры идентификаторов
| showids Display of ID section no ID section is not hidden by default.
| idshow Vanity item ID
| idtile Tile ID ✔️
| idtileshow Vanity tile ID
| idtilesub Tile sub-ID ✔️ Internally known as placeStyle in Terraria.
| idwall Wall ID ✔️[1]
| idarmor Armor ID ✔️
| idprojectileshow Vanity projectile ID
| idbuffshow Vanity buff ID 170–172 The values of these parameters require to be escaped, i.e., wikitext like templates or parser functions will need to be wrapped with <esc> and </esc>.
| idbuffshow<n> Vanity buff ID 1007 <esc>{{3DS}}</esc>
| iddebuffshow Vanity debuff ID
| iddebuffshow<n> Vanity debuff ID

Параметры бэкенда

Параметры бэкенда
| cate Toggles categorization no Set to yes to force categorization when it is disabled by default (on non-mainspace pages). Set to no to disable categorization.
| listexclude Toggles categorization yes no Set to yes to disable categorization. Overrides cate=yes, but not cate=no.
| cargo Toggles cargo data storage no Set to force to force cargo data storage when it is disabled by default (on non-mainspace pages). Set to no to disable cargo data storage. Note that setting it to anything else (e.g. yes) also disables cargo data storage, so please stick to the unambiguous no.
| listcat Categorization ✔️ Supplemental category names to include the current item in. Separate multiple categories with a slash character (/). Category sortkeys are supported (e.g. |listcat = Souls{{!}}Night adds the sortkey "Night"). The following categories will be added automatically:
  • Vendor items, if buy=true or $tags contains buy/buyable/vendor.
  • Craftable items, if this item is the result of any recipe.
  • Swords, if $listcat contains broadswords or shortswords.
  • Minecart track items, if this item is such an item.
  • Arrows, Coins, Bullets, Sands, Darts, Rockets, or Flares, if this item is that kind of ammo.
  • Hamaxes, Hammers, Chainsaws, Axes, Drills, or Pickaxes, if this item is that type of tool.
  • Weapon items, if this item is a weapon or tool and deals damage.
  • <Damage type> weapons, if this item is a weapon.
| tag
 or
| tags
Categorization ✔️ Supplemental category names to appropriately categorize the item. Can contain any of the following (separate multiple with a slash character (/):
  • buy/buyable/vendor (implies buy=yes)
    • vendor:<NPC name>
  • hardmodeonly/hardmode (implies hardmode=yes)
  • allversions (implies allversions=yes)
  • dd2 (means that this item can only be purchased with Медаль защитника)
  • drop (implies listcat=drop items)
  • loot (implies listcat=loot items)
  • plunder (implies listcat=plunder items)
    • plunder:<location>
  • fished (implies listcat=fished items)
  • unobtainable (implies listcat=unobtainable items)
  • developer (implies listcat=developer items).
  • storage (implies listcat=storage items).
  • informational (implies listcat=informational items).
  • quest rewards (implies listcat=quest rewards).
  • light source (implies listcat=light source items).
  • novelty (implies listcat=novelty items).
  • mechanism (implies listcat=mechanism items).
  • potion ingredients (implies listcat=potion ingredients).
  • bag loot/bagloot (implies listcat=bag loot items).
  • treasure bag loot (implies listcat=Treasure Bag loot items).
  • minion (implies type=weapon and listcat=minion summon items).
  • sentry (implies type=weapon and listcat=sentry summon items).

All other values will have no effect. All tags will be stored to cargo for querying.

| allversions Platform version availability ✔️ Set to yes to assert that the item is available on all platforms of Terraria, or to no to assert that the item is not available on any platforms of Terraria. This is only to be used if no {{exclusive}} banner is on the page. If omitted and if $tags does not contain allversions, it will be detected automatically based on the result of {{eversions|<item name>}} (but only if $id or $auto are set). Categorizes the page in all five version content categories (with the exception of Category:Japanese console content), if yes is determined.
| hardmode Hardmode-exclusivity ✔️ yes Set to yes to assert that the item is not available in pre-Hardmode, but only becomes available in Hardmode. Categorizes the page in Category:Hardmode-only items.

Параметры вида карточки

By default, an item infobox is displayed in the standard infobox style, a boxed, table-like listing of stats on the right of the article text. It is possible to change the display format (called "view"), however – there are four other views available: custom, item, table, and void (additionally test). They can be selected via the $view (aliases: $mode, $output) parameter. Each view has an own subpage which contains the code for the respective output.

Вид Описание Подстраница
custom Completely custom output. /customView
infobox
(по умолчанию)
Standard infobox-style output. /infoboxView
item Displays the item as formatted by {{item}}. /itemView
table Displays an entire table row (including the row separator, |-). /tableView
void Does not display anything. This is useful when it is necessary to store item information to the Cargo database, but an own infobox for the item is unwanted (e.g. on group pages, where there is a main infobox for all items of the group). /voidView

Some views enable additional, view-exclusive parameters:

Параметр Описание Пример Значение по умолчению
(если пропущено)
Примечание
{{item infobox

Настраиваемый вид

Настраиваемый вид
| template Name of the formatting template This parameter is required when using the custom view. It is to be set to the name of the template that contains the custom code for the output. (For instance, |view=custom|template=item infobox/infoboxView could also be used for a standard infobox style, because {{item infobox/infoboxView}} contains the code for the infobox output.)
| extargs Additional custom parameters Enable additional, custom parameters for the {{item infobox}} call that are handled by the formatting template. Separate multiple parameter names with a slash character (/). This parameter should only be used if the parameters specified in it are used in the {{item infobox}} call.

Вид «Предмет»

Вид «Предмет»
(параметры {{item}}) The following additional {{item}} parameters will be processed as if the template itself was called:
  • mode
  • nolink
  • link
  • wrap
  • icons
  • note
  • note2
  • anchor
  • showid
  • class
  • css
  • t

See {{item}} for documentation.

Вид «Таблица»

Вид «Таблица»
| cols Columns to display item2cells/sell This parameter defines which columns/cells are to be displayed in the resulting table row. The content and formatting of those cells is handled by the respective subpage of Template:Item infobox/tableView, by default. The following values are predefined:

However, it is also possible to include another page name, e.g. Moss/Placed on bricks (via |cols=:Moss/Placed on bricks) for a custom formatting for that cell.

In addition, it is possible to include columns for which the content is set in the same {{item infobox}} call. These column names begin with col: (e.g. |cols=col:notes) and the content can be set in the parameter of the same name (i.e. |col:notes=This is the note).

| colsep Separator for $cols \ / Specify the character that separates the column names in $cols. This is useful when using column names that include slashes, since the default separator is a slash and would thus treat that column name as two different columns.
| extargs Additional custom parameters Enable additional, custom parameters for the {{item infobox}} call that are handled by the column formatting page. Separate multiple parameter names with a slash character (/). See each column subpage for details on its available extargs.

For instance, the item2cells column formatting page is able to process four exclusive parameters, $rowspan, $anchor, $nolink, and $link. These parameters can be specified in the {{item infobox}} call to influence the formatting carried out by item2cells, but they will have no effect unless explicitly specified via |extargs=rowspan/anchor/nolink/link. This parameter should only be used if the parameters specified in it are used in the {{item infobox}} call.

  1. 1,00 1,01 1,02 1,03 1,04 1,05 1,06 1,07 1,08 1,09 1,10 1,11 1,12 1,13 1,14 1,15 1,16 1,17 1,18 1,19 1,20 1,21 1,22 1,23 Any occurrence of the string @@@@ in the parameter value will be replaced by the automatically generated data. This can be used to mix automatic and manual data.

Настройки

Данный шаблон поддерживает параметры при помощи шаблона {{options}}. Все доступные параметры описаны ниже. О его использовании и прочей информации см. {{options}}.

См. Шаблон:item infobox/initOptions для параметров по умолчанию для данного шаблона.

НазваниеПсевдонимЗначение по умолчаниюСопоставление значений[1]Примечание
viewoutput
mode
infobox
cols(empty)
colsep(empty)
extargs(empty)
imagemode(empty)
imageinfo(empty)y(empty)
yes(empty)
on(empty)
non
offn
autoimageold(empty)y(empty)
yes(empty)
on(empty)
non
offn
autoimageplaced(empty)y(empty)
yes(empty)
on(empty)
non
offn
autoimageequipped(empty)y(empty)
yes(empty)
on(empty)
non
offn
extold(empty)
extplaced(empty)
extequipped(empty)
item2cells:anchor(empty)yesy
ony
n(empty)
no(empty)
off(empty)
item2cells:nolink(empty)yesy
ony
n(empty)
no(empty)
off(empty)
template(empty)
  1. Такие значения будут храниться и загружаться такими, какими они сопоставлены здесь. Другие значения, без сопоставлений, будут храниться и загружаться такими, какими они были указаны.

Подстраницы

Существует множество дополнительных подстраниц, которые используются для форматирования определённых данных:

См. также