Difference between revisions of "Template:WeaponTable/row"

From Stoneshard wiki
Jump to navigation Jump to search
Tag: Reverted
(Undo revision 52400 by Psojed (talk))
Tag: Undo
Line 1: Line 1:
<includeonly><!--
<includeonly>{{#vardefine:range|{{#ifeq: {{:Data|{{{1}}}|Range}}|Data does not exist.|{{#switch: Range
--- Define variables for properties used more than once in the template - goal is to only load each property from the Data page once. ---
|{{:{{{1}}}|Properties1}} = {{:{{{1}}}|Values1}}
-->{{#vardefine:Slashing Damage|{{:Data|{{{1}}}|Slashing Damage}}}}<!--
|{{:{{{1}}}|Properties2}} = {{:{{{1}}}|Values2}}
-->{{#vardefine:Piercing Damage|{{:Data|{{{1}}}|Piercing Damage}}}}<!--
|{{:{{{1}}}|Properties3}} = {{:{{{1}}}|Values3}}
-->{{#vardefine:Crushing Damage|{{:Data|{{{1}}}|Crushing Damage}}}}<!--
|{{:{{{1}}}|Properties4}} = {{:{{{1}}}|Values4}}
-->{{#vardefine:Rending Damage|{{:Data|{{{1}}}|Rending Damage}}}}<!--
|{{:{{{1}}}|Properties5}} = {{:{{{1}}}|Values5}}
-->{{#vardefine:Fire Damage|{{:Data|{{{1}}}|Fire Damage}}}}<!--
|{{:{{{1}}}|Properties6}} = {{:{{{1}}}|Values6}}
-->{{#vardefine:Frost Damage|{{:Data|{{{1}}}|Frost Damage}}}}<!--
|{{:{{{1}}}|Properties7}} = {{:{{{1}}}|Values7}}
-->{{#vardefine:Shock Damage|{{:Data|{{{1}}}|Shock Damage}}}}<!--
|{{:{{{1}}}|Properties8}} = {{:{{{1}}}|Values8}}
-->{{#vardefine:Poison Damage|{{:Data|{{{1}}}|Poison Damage}}}}<!--
|{{:{{{1}}}|Properties9}} = {{:{{{1}}}|Values9}}
-->{{#vardefine:Caustic Damage|{{:Data|{{{1}}}|Caustic Damage}}}}<!--
|{{:{{{1}}}|Properties10}} = {{:{{{1}}}|Values10}}
-->{{#vardefine:Arcane Damage|{{:Data|{{{1}}}|Arcane Damage}}}}<!--
|{{:{{{1}}}|Properties11}} = {{:{{{1}}}|Values11}}
-->{{#vardefine:Sacred Damage|{{:Data|{{{1}}}|Sacred Damage}}}}<!--
|{{:{{{1}}}|Properties12}} = {{:{{{1}}}|Values12}}
-->{{#vardefine:Unholy Damage|{{:Data|{{{1}}}|Unholy Damage}}}}<!--
|{{:{{{1}}}|Properties13}} = {{:{{{1}}}|Values13}}
-->{{#vardefine:Psionic Damage|{{:Data|{{{1}}}|Psionic Damage}}}}<!--
|#default = }}|{{:Data|{{{1}}}|Range}}
-->{{#vardefine:Range|{{:Data|{{{1}}}|Range}}}}<!--
}}}}
-->{{#vardefine:Name|{{:Data|{{{1}}}|Name}}}}<!--
-->{{#vardefine:Image|{{:Data|{{{1}}}|Image}}}}<!--
-->{{#vardefine:Rarity|{{:Data|{{{1}}}|Rarity}}}}<!--
|-
|-
|{{#if:{{:Data|{{{1}}}|Unobtainable}}|{{Unobtainable}}<br />}}<!--
|{{#if:{{:{{{1}}}|Unobtainable}}|{{Unobtainable}}<br />}}'''[[{{#ifeq:{{SUBPAGENAME}}|{{PAGENAME}}|{{{1}}}|{{{1}}}/{{SUBPAGENAME}}}}|{{#if:{{:{{{1}}}|Name}}|{{#if:{{Translate|{{:{{{1}}}|Name}}|ItemNames}}|{{Translate|{{:{{{1}}}|Name}}|ItemNames}}}}|{{#if:{{Translate|{{{1}}}|ItemNames}}|{{Translate|{{{1}}}|ItemNames}}}}}}]]'''[[File:{{#if:{{:{{{1}}}|Image}}|{{:{{{1}}}|Image}}|{{{1}}}.png}}|center|alt={{#if:{{:{{{1}}}|Name}}|{{Translate|{{:{{{1}}}|Name}}|ItemNames}}|{{Translate|{{{1}}}|ItemNames}}}}|class=image2x|link={{#ifeq:{{SUBPAGENAME}}|{{PAGENAME}}|{{{1}}}|{{{1}}}/{{SUBPAGENAME}}}}]]
--- Check if we are on a subpage. If subpagename = pagename, we are not on a subpage, therefore URL becomes "item name". If we are on a subpage, URL becomes "item name/subgpagename". Used for other languages. ---
| {{#vardefine:item rarity|{{:{{{1}}}|Rarity}}}}{{#if:{{#var:item rarity}}||{{#vardefine:item rarity|Common}}}}{{c|{{#var:item rarity}}|{{Translate|{{#var:item rarity}}|Properties}}}}
-->'''[[{{#ifeq:{{SUBPAGENAME}}|{{PAGENAME}}|{{{1}}}|{{{1}}}/{{SUBPAGENAME}}}}|<!--
| data-sort-value="{{TotalDamage|{{{1}}}}}" | {{Damage|{{{1}}}}}
--- Check if there is a custom item name. If yes, check if the custom name has a translation. If yes, load translation of custom name. Otherwise, return empty string. Why do we use this again? ---
| {{:{{{1}}}|Durability}}
-->{{#if:{{#var:Name}}|{{#if:{{Translate|{{#var:Name}}|ItemNames}}|{{Translate|{{#var:Name}}|ItemNames}}}}|<!--
--- Check if item name has a translation. If yes, load translation of item name. If not, return empty string. Used for other languages. ---
-->{{#if:{{Translate|{{{1}}}|ItemNames}}|{{Translate|{{{1}}}|ItemNames}}}}}}]]'''<!--
--- Check if there is a custom image link. If yes, load custom image from link, otherwise load "item name.png". ---
-->[[File:{{#if:{{#var:Image}}|{{#var:Image}}|{{{1}}}.png}}|center|<!--
--- Check if there is a custom name. If yes, load custom name translation, otherwise load item name translation. ---
-->alt={{#if:{{#var:Name}}|{{Translate|{{#var:Name}}|ItemNames}}|{{Translate|{{{1}}}|ItemNames}}}}|class=image2x|link={{#ifeq:{{SUBPAGENAME}}|{{PAGENAME}}|{{{1}}}|{{{1}}}/{{SUBPAGENAME}}}}]]
| {{#if:{{#var:Rarity}}||{{#vardefine:Rarity|Common}}}}{{c|{{#var:Rarity}}|{{Translate|{{#var:Rarity}}|Properties}}}}
| data-sort-value="{{#expr:
{{#if: {{#var:Slashing Damage}} | {{#var:Slashing Damage}} | 0 }} +
{{#if: {{#var:Piercing Damage}} | {{#var:Piercing Damage}} | 0 }} +
{{#if: {{#var:Crushing Damage}} | {{#var:Crushing Damage}} | 0 }} +
{{#if: {{#var:Rending Damage}} | {{#var:Rending Damage}} | 0 }} +
{{#if: {{#var:Fire Damage}} | {{#var:Fire Damage}} | 0 }} +
{{#if: {{#var:Frost Damage}} | {{#var:Frost Damage}} | 0 }} +
{{#if: {{#var:Shock Damage}} | {{#var:Shock Damage}} | 0 }} +
{{#if: {{#var:Poison Damage}} | {{#var:Poison Damage}} | 0 }} +
{{#if: {{#var:Caustic Damage}} | {{#var:Caustic Damage}} | 0 }} +
{{#if: {{#var:Arcane Damage}} | {{#var:Arcane Damage}} | 0 }} +
{{#if: {{#var:Sacred Damage}} | {{#var:Sacred Damage}} | 0 }} +
{{#if: {{#var:Unholy Damage}} | {{#var:Unholy Damage}} | 0 }} +
{{#if: {{#var:Psionic Damage}} | {{#var:Psionic Damage}} | 0 }}
}}" | {{#if:{{#var:Slashing Damage}}|{{Translate|Slashing|Properties}}: {{#var:Slashing Damage}}<br>}}<!--
-->{{#if:{{#var:Piercing Damage}}|{{Translate|Piercing|Properties}}: {{#var:Piercing Damage}}<br>}}<!--
-->{{#if:{{#var:Crushing Damage}}|{{Translate|Crushing|Properties}}: {{#var:Crushing Damage}}<br>}}<!--
-->{{#if:{{#var:Rending Damage}}|{{Translate|Rending|Properties}}: {{#var:Rending Damage}}<br>}}<!--
-->{{#if:{{#var:Fire Damage}}|{{c|Fire|{{Translate|Fire|Properties}}: {{#var:Fire Damage}}}}<br>}}<!--
-->{{#if:{{#var:Frost Damage}}|{{c|Frost|{{Translate|Frost|Properties}}: {{#var:Frost Damage}}}}<br>}}<!--
-->{{#if:{{#var:Shock Damage}}|{{c|Shock|{{Translate|Shock|Properties}}: {{#var:Shock Damage}}}}<br>}}<!--
-->{{#if:{{#var:Poison Damage}}|{{c|Poison|{{Translate|Poison|Properties}}: {{#var:Poison Damage}}}}<br>}}<!--
-->{{#if:{{#var:Caustic Damage}}|{{c|Caustic|{{Translate|Caustic|Properties}}: {{#var:Caustic Damage}}}}<br>}}<!--
-->{{#if:{{#var:Arcane Damage}}|{{c|Arcane|{{Translate|Arcane|Properties}}: {{#var:Arcane Damage}}}}<br>}}<!--
-->{{#if:{{#var:Sacred Damage}}|{{c|Sacred|{{Translate|Sacred|Properties}}: {{#var:Sacred Damage}}}}<br>}}<!--
-->{{#if:{{#var:Unholy Damage}}|{{c|Unholy|{{Translate|Unholy|Properties}}: {{#var:Unholy Damage}}}}<br>}}<!--
-->{{#if:{{#var:Psionic Damage}}|{{c|Psionic|{{Translate|Psionic|Properties}}: {{#var:Psionic Damage}}}}<br>}}<!--
-->
| {{:Data|{{{1}}}|Durability}}
{{#if:{{#var:weapon table ranged}}|
{{#if:{{#var:weapon table ranged}}|
{{!}} {{#var:Range}}
{{!}} {{#var:range}}
}}
}}
| {{:Data|{{{1}}}|Price}}
| {{:{{{1}}}|Price}}
| {{Test|{{{1}}}}}</includeonly><noinclude>{{doc}}[[Category:Templates]]</noinclude>
| {{Properties|{{{1}}}}}</includeonly><noinclude>{{doc}}[[Category:Templates]]</noinclude>

Revision as of 20:19, 28 May 2022

This template has no documentation. If you know how to use this template, please add some.