Template:CargoDamage: Difference between revisions
No edit summary |
mNo edit summary |
||
(26 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
<noinclude>{{doc}}[[Category:Templates]]</noinclude><includeonly> | <noinclude>{{doc}}[[Category:Templates]][[Category:Cargo Querying Templates]]</noinclude> | ||
{| class="responsive-table" style="width | <includeonly>{| class="responsive-table" style="width:{{{width|50}}}%" | ||
<th>Item</th>{{#ifeq: {{{tabletype|}}}|sub| | <th>Item</th>{{#ifeq:{{{tabletype|}}}|sub| | ||
<th>Shots</th> | <th>Shots</th>}} | ||
<th>Afflictions</th>{{#ifeq: {{{tabletype|}}}|melee| | <th>Afflictions | ||
<th><abbr title="hits per second">Attack Speed</abbr></th> | </th>{{#ifeq:{{{tabletype|}}}|melee| | ||
<th>Armor Penetration</th>{{#ifeq: {{{tabletype|}}}|sub| | <th><abbr title="hits per second">Attack Speed</abbr></th>}} | ||
<th>Armor Penetration</th>{{#ifeq:{{{tabletype|}}}|sub| | |||
<th>Structure Damage</th> | <th>Structure Damage</th> | ||
<th>Explosion Range</th> | <th>Explosion Range</th>}}{{#cargo_query: | ||
tables = Items,Ammunition | tables = Items,Ammunition | ||
| join on = Items.name = Ammunition.name | | join on = Items.name = Ammunition.name | ||
| fields = Items.name, Items.icon, Items. | | fields = Items._pageName, Items.name, Items.icon, Items.ammocount, Items.attackspeed, Items.penetration, Items.structuredamage, Items.explosionstructuredamage, Items.note, Items.explosionrange, Items.explosionrange2, Items.projectiles, Items.projectiles2, Items.afflictionsname, Items.afflictions, Items.explosionafflictions, Items.afflictions2name, Items.afflictions2, Items.explosionafflictions2 {{#ifeq: {{{tabletype|}}}|sub|, Ammunition.magazine, Ammunition.penetration, Ammunition.structuredamage, Items.explosionstructuredamage, Ammunition.explosionrange, Ammunition.usedby, Ammunition.usedbyweapondamagemodifier, Ammunition.usedby2, Ammunition.usedby2weapondamagemodifier, Ammunition.usedby3, Ammunition.usedby3weapondamagemodifier,|,}} | ||
| where = {{#if: {{{1|}}}|Items.name = "{{{1}}}" OR Items.name = "{{{2}}}" OR Items.name = "{{{3}}}" OR Items.name = "{{{4}}}" OR Items.name = "{{{5}}}" OR Items.name = "{{{6}}}"|{{#ifeq: {{{tabletype|}}}|sub|Ammunition.usedby LIKE " | | where = ({{#if: {{{1|}}}|Items.name = "{{{1}}}" OR Items.name = "{{{2}}}" OR Items.name = "{{{3}}}" OR Items.name = "{{{4}}}" OR Items.name = "{{{5}}}" OR Items.name = "{{{6}}}"|{{#ifeq: {{{tabletype|}}}|sub|Ammunition.usedby LIKE "{{{weapon|{{PAGENAME}}}}}" OR Ammunition.usedby2 LIKE "{{{weapon|{{PAGENAME}}}}}" OR Ammunition.usedby3 LIKE "{{{weapon|{{PAGENAME}}}}}"}}}}) AND hideintables IS NULL | ||
| format = template | | format = template | ||
| template = {{#switch: {{{tabletype}}}|sub = CargoDamage/sub|melee=CargoDamage/row|CargoDamage/row}} | | template = {{#switch: {{{tabletype}}}|sub = CargoDamage/sub|melee=CargoDamage/row|CargoDamage/row}} | ||
| named args = yes | | named args = yes | ||
}} | }} | ||
|} | |}</includeonly> | ||
</includeonly> |
Latest revision as of 09:59, 27 March 2024
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 |
---|---|---|---|
Dementonite Diving Knife |
1.48 | 0% | |
Diving Knife |
1.33 | 0% | |
Europan Handshake |
1.33 | 0% | |
Hardened Diving Knife |
1.33 | 25% |
The above documentation is transcluded from Template:CargoDamage/doc. (edit | history)