Difference between revisions of "Template:WeaponTable/row"

From Stoneshard wiki
Jump to navigation Jump to search
(fix for white links in translation pages (Axes/ru))
(fix mismatched elemental damage types)
 
(14 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>{{#vardefine:range|{{#ifeq: {{:Data|{{{1}}}|Range}}|Data does not exist.|{{#switch: Range
<includeonly><!--
|{{:{{{1}}}|Properties1}} = {{:{{{1}}}|Values1}}
--- Load complete datastring into a variable - to only load from the Armor data page once. ---
|{{:{{{1}}}|Properties2}} = {{:{{{1}}}|Values2}}
-->{{#vardefine:Datastring|{{:Weapon_data|{{{1}}}}}}}<!--
|{{:{{{1}}}|Properties3}} = {{:{{{1}}}|Values3}}
--- Separate values from datastring into individual variables. ---
|{{:{{{1}}}|Properties4}} = {{:{{{1}}}|Values4}}
-->{{#vardefine:Unobtainable|{{#explode: {{#var:Datastring}}|;|-2}}}}<!--
|{{:{{{1}}}|Properties5}} = {{:{{{1}}}|Values5}}
-->{{#vardefine:Rarity|{{#explode: {{#var:Datastring}}|;|2}}}}<!--
|{{:{{{1}}}|Properties6}} = {{:{{{1}}}|Values6}}
-->{{#vardefine:Total Damage|{{#explode: {{#var:Datastring}}|;|-3}}}}<!--
|{{:{{{1}}}|Properties7}} = {{:{{{1}}}|Values7}}
-->{{#vardefine:Range|{{#explode: {{#var:Datastring}}|;|8}}}}<!--
|{{:{{{1}}}|Properties8}} = {{:{{{1}}}|Values8}}
-->{{#vardefine:Slashing Damage|{{#explode: {{#var:Datastring}}|;|13}}}}<!--
|{{:{{{1}}}|Properties9}} = {{:{{{1}}}|Values9}}
-->{{#vardefine:Piercing Damage|{{#explode: {{#var:Datastring}}|;|14}}}}<!--
|{{:{{{1}}}|Properties10}} = {{:{{{1}}}|Values10}}
-->{{#vardefine:Crushing Damage|{{#explode: {{#var:Datastring}}|;|15}}}}<!--
|{{:{{{1}}}|Properties11}} = {{:{{{1}}}|Values11}}
-->{{#vardefine:Rending Damage|{{#explode: {{#var:Datastring}}|;|16}}}}<!--
|{{:{{{1}}}|Properties12}} = {{:{{{1}}}|Values12}}
-->{{#vardefine:Fire Damage|{{#explode: {{#var:Datastring}}|;|17}}}}<!--
|{{:{{{1}}}|Properties13}} = {{:{{{1}}}|Values13}}
-->{{#vardefine:Shock Damage|{{#explode: {{#var:Datastring}}|;|18}}}}<!--
|#default = }}|{{:Data|{{{1}}}|Range}}
-->{{#vardefine:Poison Damage|{{#explode: {{#var:Datastring}}|;|19}}}}<!--
}}}}
-->{{#vardefine:Caustic Damage|{{#explode: {{#var:Datastring}}|;|20}}}}<!--
-->{{#vardefine:Frost Damage|{{#explode: {{#var:Datastring}}|;|21}}}}<!--
-->{{#vardefine:Arcane Damage|{{#explode: {{#var:Datastring}}|;|22}}}}<!--
-->{{#vardefine:Unholy Damage|{{#explode: {{#var:Datastring}}|;|23}}}}<!--
-->{{#vardefine:Sacred Damage|{{#explode: {{#var:Datastring}}|;|24}}}}<!--
-->{{#vardefine:Psionic Damage|{{#explode: {{#var:Datastring}}|;|25}}}}<!--
-->{{#vardefine:Durability|{{#explode: {{#var:Datastring}}|;|4}}}}<!--
-->{{#vardefine:Price|{{#explode: {{#var:Datastring}}|;|7}}}}<!--
--- Load translations that are used multiple times into variables. ---
-->{{#vardefine:TranslateName|{{Translate|{{{1}}}|ItemNames}}}}
|-
|-
|{{#if:{{:{{{1}}}|Unobtainable}}|{{Unobtainable}}<br />}}'''[[{{#ifeq:{{SUBPAGENAME}}|{{PAGENAME}}|{{{1}}}|{{{1}}}/{{SUBPAGENAME}}}}|{{#if:{{:{{{1}}}|Name}}|{{#if:{{Translate|{{:{{{1}}}|Name}}|ItemNames}}|{{Translate|{{:{{{1}}}|Name}}|ItemNames}}|{{Translate|nothing|ItemNames}}}}|{{#if:{{Translate|{{{1}}}|ItemNames}}|{{Translate|{{{1}}}|ItemNames}}|{{Translate|nothing|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}}}}]]
|{{#if:{{#var:Unobtainable}}|{{Unobtainable}}<br />}}<!--
| {{#vardefine:item rarity|{{:{{{1}}}|Rarity}}}}{{#if:{{#var:item rarity}}||{{#vardefine:item rarity|Common}}}}{{c|{{#var:item rarity}}|{{Translate|{{#var:item rarity}}|Properties}}}}
--- 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. ---
| data-sort-value="{{TotalDamage|{{{1}}}}}" | {{Damage|{{{1}}}}}
-->'''[[{{#ifeq:{{SUBPAGENAME}}|{{PAGENAME}}|{{{1}}}|{{{1}}}/{{SUBPAGENAME}}}}|<!--
| {{:{{{1}}}|Durability}}
--- Check if item name has a translation. If yes, load translation of item name. If not, return empty string. Used for other languages. ---
-->{{#if:{{#var:TranslateName}}|{{#var:TranslateName}}}}]]'''<!--
-->[[File:{{{1}}}.png|center|<!--
--- Check if there is a custom name. If yes, load custom name translation, otherwise load item name translation. ---
-->alt={{#var:TranslateName}}|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="{{#var:Total Damage}}" |<!--
-->{{#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>}}
| {{#var:Durability}}
{{#if:{{#var:weapon table ranged}}|
{{#if:{{#var:weapon table ranged}}|
{{!}} {{#var:range}}
{{!}} {{#var:Range}}
}}
}}
| {{:{{{1}}}|Price}}
| {{#var:Price}}
| {{Properties|{{{1}}}}}</includeonly><noinclude>{{doc}}[[Category:Templates]]</noinclude>
| {{Test|{{{1}}}}}</includeonly><noinclude>{{doc}}[[Category:Templates]]</noinclude>

Latest revision as of 19:55, 31 May 2023

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