Template:CargoDamage: Difference between revisions

From Official Barotrauma Wiki
Jump to: navigation, search
mNo edit summary
mNo edit summary
Line 1: Line 1:
<noinclude>{{doc}}[[Category:Templates]][[Category:Cargo Querying Templates]]</noinclude><includeonly>
<noinclude>{{doc}}[[Category:Templates]][[Category:Cargo Querying Templates]]</noinclude>
{| class="responsive-table" style="width:{{#if: {{{width|}}}|{{{width}}}|50}}%;"
<includeonly>{| class="responsive-table" style="width:{{{width|50}}}%"
<th>Item</th>{{#ifeq: {{{tabletype|}}}|sub|
! Item{{#ifeq:{{{tabletype|}}}|sub|
<th>Shots</th>|}}
! Shots}}
<th>Afflictions</th>{{#ifeq: {{{tabletype|}}}|melee|
! Afflictions{{#ifeq:{{{tabletype|}}}|melee|
<th><abbr title="hits per second">Attack Speed</abbr></th>|}}
! <abbr title="hits per second">Attack Speed</abbr>}}
<th>Armor Penetration</th>{{#ifeq: {{{tabletype|}}}|sub|
! Armor Penetration{{#ifeq:{{{tabletype|}}}|sub|
<th>Structure Damage</th>
! Structure Damage
<th>Explosion Range</th>|}}{{#cargo_query:
! Explosion Range}}{{#cargo_query:
tables = Items,Ammunition
tables = Items,Ammunition
| join on = Items.name = Ammunition.name
| join on = Items.name = Ammunition.name
Line 16: Line 16:
| named args = yes
| named args = yes
}}
}}
|}
|}</includeonly>
</includeonly>

Revision as of 02:21, 2 August 2022

Documentation

This template is used to display a damage table that reads data from the Items cargo table. Items called this way must have their data set in their respective infoboxes, on their respective pages, for the data to be stored in the cargo table.

Sub Templates

Syntax

{{CargoDamage|tabletype=<melee> or <sub>|item 1|item 2|item 3|item 4|item 5|item 6|width = <custom width, default 50>}}

Important note: unlike most templates, parameters cannot have spaces and/or newlines between them and the separator pipes. So the following won't work, for example: {{CargoDamage| item 1 | item 2 }}

Example

{{CargoDamage|tabletype=melee|Diving Knife|Hardened Diving Knife|Dementonite Diving Knife|Europan Handshake}}

Gives:

Item Afflictions! Attack Speed Armor Penetration
Error: No field named "bluntforcetrauma" found for the database table "Items".