Difference between revisions of "Template:Items infobox"
From Official Barotrauma Wiki
m |
m |
||
(9 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | <noinclude> | + | <noinclude>{{doc}}[[Category:Templates]] |
− | |||
− | |||
− | {{doc}} | ||
− | |||
{{#cargo_declare:_table=Items | {{#cargo_declare:_table=Items | ||
| identifier = String | | identifier = String | ||
Line 21: | Line 17: | ||
| drunkdelay = Integer | | drunkdelay = Integer | ||
| nauseadelay = Integer | | nauseadelay = Integer | ||
+ | | ammo = Wikitext | ||
+ | | magazine = Integer | ||
+ | | ammocount = Integer | ||
+ | | hands = Integer | ||
+ | | note = Wikitext | ||
<!-- damage --> | <!-- damage --> | ||
| pellets = Integer | | pellets = Integer | ||
| structuredamage = Float | | structuredamage = Float | ||
+ | | itemdamage = Float | ||
| penetration = Integer | | penetration = Integer | ||
| piercing = Integer | | piercing = Integer | ||
Line 174: | Line 176: | ||
-->{{#if:{{{stubnote|}}}|{{!}}stubnote={{{stubnote}}}|}}<!-- | -->{{#if:{{{stubnote|}}}|{{!}}stubnote={{{stubnote}}}|}}<!-- | ||
-->{{#if:{{{cleanup|}}}|{{!}}cleanup={{{cleanup}}}|}}<!-- | -->{{#if:{{{cleanup|}}}|{{!}}cleanup={{{cleanup}}}|}}<!-- | ||
− | -->{{#if:{{{cleanupnote|}}}|{{!}}cleanupnote={{{cleanupnote}}}|}}|}}}} | + | -->{{#if:{{{cleanupnote|}}}|{{!}}cleanupnote={{{cleanupnote}}}|}}|}}}}</noinclude> |
− | </noinclude><includeonly>{{#vardefine:match|{{#ifeq:{{{version|}}}|{{Current version}}|True|{{#ifeq:{{#explode:{{{version|}}}|.|0}}{{#explode:{{{version|}}}|.|1}}|{{#explode:{{Current_version}}|.|0}}{{#explode:{{Current_version}}|.|1}}|True|{{#ifeq:{{{version|}}}|0.8.2.3|Legacy|False}}}}}}}}{| class="infobox responsive-table" align=right | + | <includeonly><onlyinclude>{{#vardefine:match|{{#ifeq:{{{version|}}}|{{Current version}}|True|{{#ifeq:{{#explode:{{{version|}}}|.|0}}{{#explode:{{{version|}}}|.|1}}|{{#explode:{{Current_version}}|.|0}}{{#explode:{{Current_version}}|.|1}}|True|{{#ifeq:{{{version|}}}|0.8.2.3|Legacy|False}}}}}}}}{| class="infobox responsive-table" align=right |
{{#if:{{{version|}}}|! class="infobox2 responsive-table" colspan="3" style="text-align:right;"{{!}}<!-- | {{#if:{{{version|}}}|! class="infobox2 responsive-table" colspan="3" style="text-align:right;"{{!}}<!-- | ||
-->{{#if:{{{deletion|}}}|[[File:Orders dismissed.png|32px|This page is a candidate for deletion.{{#if:{{{deletionnote|}}}|{{{deletenote}}}|}}|link=:Category:Candidates for deletion]][[Category:Candidates for deletion]][[Category:Problem articles]]|}}<!-- | -->{{#if:{{{deletion|}}}|[[File:Orders dismissed.png|32px|This page is a candidate for deletion.{{#if:{{{deletionnote|}}}|{{{deletenote}}}|}}|link=:Category:Candidates for deletion]][[Category:Candidates for deletion]][[Category:Problem articles]]|}}<!-- | ||
Line 186: | Line 188: | ||
! class="infobox2 responsive-table" colspan="3" | {{{name|{{PAGENAME}}}}} | ! class="infobox2 responsive-table" colspan="3" | {{{name|{{PAGENAME}}}}} | ||
|- | |- | ||
− | | colspan="3" style="padding:0.5em;text-align:center !important;" | {{#if: {{{customtext|}}} | {{{customtext}}} | {{#if: {{{noicon|}}}|| | + | | colspan="3" style="padding:0.5em;text-align:center !important;" | {{#if:{{{customtext|}}}|{{{customtext}}}|{{#if:{{{noicon|}}}|| |
− | {{ImageHandler | + | {{ImageHandler|file = {{{image|{{{icon|{{{name|{{PAGENAME}}}}}.png}}}}}}| imagewidth = {{#if:{{{imagewidth|{{{iconwidth|}}}}}}|{{{imagewidth|{{{iconwidth}}}}}}px}}}}<!-- |
− | | file | + | -->{{#if:{{{caption|}}}|<div style="margin:auto;text-align:center;max-width:450px;word-wrap: break-word;"><small>{{{caption}}}</small></div>}}}}<!-- |
− | | imagewidth | + | -->{{#ifeq:{{#if:{{{noicon|}}}|f|t}}|{{#if:{{{image2|{{{sprite|}}}}}}|t|ff}}|<br><br>}}<!-- oof |
− | }}<!-- | + | -->{{#if:{{{image2|{{{sprite|}}}}}}|[[File:{{{image2|{{{sprite|}}}}}}|{{{imagewidth2|{{{spritewidth|180}}}}}}px]]{{#if:{{{caption2|}}}|<br><small>{{{caption2}}}</small>}}}}<!-- |
− | + | -->{{#if:{{{identifier|}}}|<br><span style="margin:auto;text-align:center;color:#808080;"><small>ID: <code>{{{identifier|}}}</code></small></span>}}<!-- | |
− | -->{{#if: {{{caption|}}} |<div style="margin:auto;text-align:center;max-width:450px;word-wrap: break-word;"><small>{{{caption}}}</small></div> | + | -->{{#if: {{{description|}}}|<div style="margin: 0 auto;width:50%;float:center;border-bottom: 1px #E2D9A4 dotted;"></div>''<small>{{{description}}}</small>''}}}} |
− | |||
− | -->{{#ifeq:{{#if:{{{noicon|}}}|f|t}}|{{#if:{{{image2|{{{sprite|}}}}}}|t|ff}}|<br><br> | ||
− | |||
− | -->{{#if: {{{image2|{{{sprite|}}}}}} |[[File:{{{image2|{{{sprite|}}}}}}|{{{imagewidth2|{{{spritewidth|180}}}}}}px]] | ||
− | {{#if: {{{caption2|}}} |<br><small>{{{caption2}}}</small>}} | ||
− | |||
− | {{#if:{{{identifier|}}}|<br><span style="margin:auto;text-align:center;color:#808080;"><small>ID: <code>{{{identifier|}}}</code></small></span>}} | ||
− | {{#if: {{{description|}}} |<div style="margin: 0 auto;width:50%;float:center;border-bottom: 1px #E2D9A4 dotted;"></div>''<small>{{{description}}}</small>'' | ||
− | |||
|-<!-- | |-<!-- | ||
Line 338: | Line 331: | ||
{{!}}- | {{!}}- | ||
|}}}}<!-- if there's no structure damage, but there is explosionstructuredamage | |}}}}<!-- if there's no structure damage, but there is explosionstructuredamage | ||
+ | |||
+ | --> | ||
+ | {{#if: {{{itemdamage|}}}| | ||
+ | {{!}} style="width:40%;font-size:105%;" {{!}} {{#if:{{{explosionrange|}}}|Item Damage|Thalamus Damage}} | ||
+ | {{!}} style="width:60%;text-align:center;" colspan="2" {{!}} {{{itemdamage}}} | ||
+ | {{!}}- | ||
+ | |}}<!-- | ||
--> | --> | ||
Line 647: | Line 647: | ||
}}|}}<!-- | }}|}}<!-- | ||
--------------------------------------------------------------------------- CATEGORIES | --------------------------------------------------------------------------- CATEGORIES | ||
− | -->{{#if:{{{nocat|}}}||[[Category:{{#switch:{{{type}}} | + | -->{{TEX|2={{#if:{{{nocat|}}}||[[Category:{{#switch:{{{type}}} |
|weapon= Weapons | |weapon= Weapons | ||
|tool= Tools | |tool= Tools | ||
Line 685: | Line 685: | ||
|rarematerial=[[Category:Crafting Materials]] | |rarematerial=[[Category:Crafting Materials]] | ||
|#default= }}}}<!-- | |#default= }}}}<!-- | ||
− | |||
− | |||
--------------------------------------------------------------------------- MAIN CARGO STORAGE | --------------------------------------------------------------------------- MAIN CARGO STORAGE | ||
-->{{#cargo_store:_table=Items | -->{{#cargo_store:_table=Items | ||
Line 702: | Line 700: | ||
| duration = {{{duration|}}} | | duration = {{{duration|}}} | ||
| explosionrange = {{{explosionrange|}}} | | explosionrange = {{{explosionrange|}}} | ||
+ | | ammo = {{{ammo|}}} | ||
+ | | magazine = {{{magazine|}}} | ||
+ | | ammocount = {{{ammocount|}}} | ||
+ | | hands = {{{hands|}}} | ||
+ | | note = {{{note|}}} | ||
<!-- damage --> | <!-- damage --> | ||
| pellets = {{{pellets|}}} | | pellets = {{{pellets|}}} | ||
| structuredamage = {{{structuredamage|}}} | | structuredamage = {{{structuredamage|}}} | ||
+ | | itemdamage = {{{itemdamage|}}} | ||
| penetration = {{{penetration|}}} | | penetration = {{{penetration|}}} | ||
| piercing = {{{piercing|}}} | | piercing = {{{piercing|}}} | ||
Line 777: | Line 781: | ||
| fabricatortimealt = {{{fabricatortimealt|}}} | | fabricatortimealt = {{{fabricatortimealt|}}} | ||
| fabricatedamount = {{{fabricatedamount|}}} | | fabricatedamount = {{{fabricatedamount|}}} | ||
− | }}}} | + | }}}}</onlyinclude></includeonly> |
− | </includeonly> |
Latest revision as of 20:07, 28 July 2022
Basic
Field | Note | Example | Default |
---|---|---|---|
name | Item name | Wrench | {{PAGENAME}}
|
icon | Icon of item | Wrench.png | {{PAGENAME}}.png
|
iconwidth | Forced icon width (px) | 250 | 180 |
caption | Caption under image | Inventory icon | |
sprite | Sprite of item | Wrench_sprite.png | |
spritewdith | Forced sprite width (px) | 90 | 180 |
caption2 | Caption under image | Inventory icon | |
identifier | Internal identifier of the item from game files (optional) | wrench | |
description | In-game item description | Useful for crafting |
Stats
Field | Note | Example | Expected | Default |
---|---|---|---|---|
nostats | Skips Stats section if true | yes | whitespace/empty or string | |
type | Sets category of item depending on the type | weapon | weapon tool gear medical chemical electrical container ammo explosive gatherable misc gardening mineralmaterial organicmaterial processedmaterial rarematerial fuel misc exotic vehicle | General Item |
size | Size of the item. Default is small. | medium | medium/undefined | small |
ammo | Ammo used by an item | ![]() |
item(s) | |
ammocost | Cost of ammo | 100 Marks | number | |
ammocount | Amount of ammo a item can hold | 4 | number | |
fuel | Fuel used by item | ![]() |
item(s) | |
fuelcost | Cost of fuel | 100 Marks | number | |
fuelcount | Amount of fuel an item can hold | 4 | number | |
maxstack | Maximum number of items in a stack | 10 | number | |
payload | Payload used by an item | ![]() |
item(s) | |
payloadcost | Cost of payload | 100 Marks | number | |
payloadcount | Amount of payloads an item can hold | 1 | number | |
supplyname | Name of item that fits no other field | Food | text | |
supplycost | Cost of supply item | 100 Marks | number | |
supplycount | Amount of supply items an item can hold | 4 | number | |
supplyitems | Supply items used by an item | ![]() |
item(s) | |
itemcapacity | Amount of generic items a storage item can hold (for containers) | 4 | number |
Damage
Field | Note | Example | Expected | Default |
---|---|---|---|---|
usedby | What weapon(s) use this ammo | ![]() |
Hyperlinks to relevant weapons | |
afflictions | Afflictions list. Deprecated, use individual afflictions instead. However, until the transition is over, for compatibility reasons you must set this to "yes" ( |afflictions=yes ). |
yes | yes (Previously: list of afflictions using Template:Affliction) | |
bluntforcetrauma, lacerations, gunshotwound, deeptissueinjury, organdamage, burn, bleeding, oxygenlow, huskinfection, psychosis, morbusinepoisoning, sufforinpoisoning, deliriuminepoisoning, cyanidepoisoning, radiationsickness, paralysis, progressivestun, stun, explosionradiationsickness, explosiondeeptissueinjury, explosionburn, explosionlacerations, explosionbleeding, explosionstun | Each individual affliction | 25 | number | |
blulast, laclast, gunlast... | Use to remove the <br> after an affliction, if there is no stun specified. First 3 letters of the affliction followed by -last. | yes | yes (or any value). Don't use if there is stun. | |
xradlast, xdeelast, xburlast, xlaclast, xblelast | Same as above but for explosion afflictions. "x" - first 3 letters - "last" | yes | yes (or any value). Don't use if there is explosionstun. | |
attackspeed | Number of potential hits per second. This is usually 1/<reload> (+<maxchargetime> if any). | 5 | number | |
explosionrange | Range of explosion if any, in meters (it's in centimeters in the xml). Must be set for the explosionafflictions to be displayed. | 7 | number | |
penetration | Armor penetration | 10 | number | |
structuredamage | Structure damage | 20 | number | |
explosionstructuredamage | Explosion structure damage | 20 | number | |
magazine | Number of rounds in a magazine | 20 | number | |
reusable | shows that this ammo is reusable if set to yes, hidden otherwise | yes | yes | hidden |
Store
Field | Note | Example | Expected |
---|---|---|---|
nostore | Skips Store section if true | yes | whitespace/empty or string |
unbuyable | If item can't be bought anywhere | true |
|
baseprice | Base price of item | 200 | number |
outpostmultiplier | Price multiplier of item at the Habitation Outpost | 1.25 | number |
outpostminavailable | Minimum amout of stock available at the Habitation Outpost | 3 | number |
outpostunbuyable | If item is unbuyable in this outpost. Ignored if overall unbuyable=true is set. | true |
|
citymultiplier | Price multiplier of item at a Colony | 1.25 | number |
cityminavailable | Minimum amout of stock available at a Colony | 3 | number |
cityunbuyable | If item is unbuyable in this outpost. Ignored if overall unbuyable=true is set. | true |
|
researchmultiplier | Price multiplier of item at the Research Outpost | 1.25 | number |
researchminavailable | Minimum amout of stock available at the Research Outpost | 3 | number |
researchunbuyable | If item is unbuyable in this outpost. Ignored if overall unbuyable=true is set. | true |
|
militarymultiplier | Price multiplier of item at the Military Outpost | 1.25 | number |
militaryminavailable | Minimum amout of stock available at the Military Outpost | 3 | number |
militaryunbuyable | If item is unbuyable in this outpost. Ignored if overall unbuyable=true is set. | true |
|
minemultiplier | Price multiplier of item at the Mining Outpost | 1.25 | number |
mineminavailable | Minimum amout of stock available at the Mining Outpost | 3 | number |
mineunbuyable | If item is unbuyable in this outpost. Ignored if overall unbuyable=true is set. | all |
|
armorymultiplier | Price multiplier of item from this merchant | 1.25 | number |
armoryminavailable | Minimum amout of stock available from this merchant | 3 | number |
armoryunbuyable | If item is unbuyable at this merchant. Ignored if overall unbuyable=true is set. | all |
|
Skill Requirements
Field | Note | Example | Expected |
---|---|---|---|
noreq | Skips Skill Requirements section if true | yes | whitespace/empty or string |
weapons | Weapons skill required to handle item without penalty | 10 | number |
mechanical | Mechanical skill required to handle item without penalty | 10 | number |
electrical | Electrical skill required to handle item without penalty | 10 | number |
medical | Medical skill required to handle item without penalty | 10 | number |
handicap | Penalty for not having the correct level for this item | Fuel used up 3x as fast | string |
Crafting
Field | Note | Example | Expected |
---|---|---|---|
fabricator | Is the item constructible in a regular fabricator | yes | yes/no |
medicalfabricator | Is the item constructible in a medical fabricator | yes | yes/no |
talent | What talent is required to craft this item | Quickdraw | link to the talents page with an anchor to the job or link to the specific talent page itself if we make one |
fabricatedamount | How many items are crafted at once (if 1<) | 4 | number |
fabricatortime | Time required to craft item (seconds) | 10 | number |
fabricatorskill | Skill required to craft item | medical | mechanical/electrical/medical/weapons |
fabricatorskilllevel | Skill level required to craft item | 20 | number |
fabricatorskill2 | Second Skill required to craft item | medical | mechanical/electrical/medical/weapons |
fabricatorskilllevel2 | Skill level of the second skill required to craft item | 20 | number |
fabricatormaterials | Items required to craft item | ![]() |
item |
fabricatedamount | Amount of items produced by fabrication | 3 | number |
deconstructor | Is the item deconstructible | yes | yes/no |
deconstructortime | Time required to deconstruct item (seconds) | 10 | number |
deconstructormaterials | Items recieved after deconstructing | ![]() |
item |
Other
Field | Note | Example | Expected |
---|---|---|---|
nocat | Doesn't display category if true | yes | whitespace/empty or string |
Example
Wrench | ||
---|---|---|
![]() Inventory icon. ![]() Sprite. ID: wrench Makes mechanical repairs possible.
| ||
Stats | ||
Type | Tool | |
Afflictions | ||
Attack Speed | 1 | |
Structure damage | 2 | |
Crafting | ||
Fabricator Requirements (produces 1 items) |
Skill: Mechanical Engineering 20
| |
Deconstructor Yield | ||
Store | ||
![]() |
Buy | Sell |
![]() |
10 mk | 2 mk |
![]() |
9 mk | 2 mk |
![]() |
12 mk | 3 mk |
![]() |
12 mk | 3 mk |
![]() |
10 mk | 2 mk |
The example seen to the right is defined as follows:
{{Items infobox | name = Wrench | icon = Wrench.png | caption = Inventory icon. | sprite = Wrench sprite.png | spritewidth = 61 | caption2 = Sprite. | identifier = wrench | description = Makes mechanical repairs possible. | type = tool | noreq = yes | afflictions = yes | bluntforcetrauma = 4 | stun = 0.2 | attackspeed = 1 | structuredamage = 2 | baseprice = 10 | outpostmultiplier = 1 | outpostminavailable = 10 | citymultiplier = 0.9 | cityminavailable = 15 | researchmultiplier = 1.25 | researchminavailable = 10 | militarymultiplier = 1.25 | militaryminavailable = 10 | minemultiplier = 1 | mineminavailable = 10 | deconstructor = Yes | fabricator = Yes | fabricatortime = 10 | fabricatorskill = mechanical | fabricatorskilllevel = 20 | fabricatedamount = 1 | deconstructortime = 10 | fabricatormaterials = {{Hyperlink|Iron}} | deconstructormaterials = {{Hyperlink|Iron}} }}
The above documentation is transcluded from Template:Items infobox/doc. (edit | history)
This template defines the table "Items". View table.