Template:CargoDamage: Difference between revisions

From Official Barotrauma Wiki
Jump to: navigation, search
(simlplified headers ifeqs)
(simplified further)
Line 1: Line 1:
<noinclude>{{doc}}[[Category:Templates]]</noinclude><includeonly>
<noinclude>{{doc}}[[Category:Templates]]</noinclude><includeonly>
{| class="responsive-table" style="width:{{#if: {{{width|}}}|{{{width}}}|50}}%;"
{| class="responsive-table" style="width:{{#if: {{{width|}}}|{{{width}}}|50}}%;"
! Item{{#ifeq: {{{tabletype|}}}|sub|&nbsp;
<th>Item</th>{{#ifeq: {{{tabletype|}}}|sub|
! Shots|}}
<th>Shots</th>|}}
! Afflictions{{#ifeq: {{{tabletype|}}}|melee|&nbsp;
<th>Afflictions</th>{{#ifeq: {{{tabletype|}}}|melee|
! <abbr title="hits per second">Attack Speed</abbr>|}}
<th><abbr title="hits per second">Attack Speed</abbr></th>|}}
! Armor Penetration{{#ifeq: {{{tabletype|}}}|sub|&nbsp;
<th>Armor Penetration</th>{{#ifeq: {{{tabletype|}}}|sub|
! Structure Damage
<th>Structure Damage</th>
! Explosion Range|}}{{#cargo_query:
<th>Explosion Range</th>|}}{{#cargo_query:
tables = Items,Ammunition
tables = Items,Ammunition
| join on = Items.name = Ammunition.name
| join on = Items.name = Ammunition.name

Revision as of 21:03, 21 June 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:

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