Difference between revisions of "Template:ArmorTable/row"

From Stoneshard wiki
Jump to navigation Jump to search
(update loading extra names and images from data page instead of item page)
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly><!--
<includeonly><!--
--- Define variables for properties used more than once in the template - goal is to only load each property from the Data page once. ---
--- Load complete datastring into a variable - to only load from the Armor data page once. ---
-->{{#vardefine:Name|{{:Armor_data|{{{1}}}|Name}}}}<!--
-->{{#vardefine:Datastring|{{:Armor_data|{{{1}}}}}}}<!--
-->{{#vardefine:Name2|{{:Armor_data|{{{1}}}|Name2}}}}<!--
--- Separate values from datastring into individual variables. ---
-->{{#vardefine:Name3|{{:Armor_data|{{{1}}}|Name3}}}}<!--
-->{{#vardefine:Unobtainable|{{#explode: {{#var:Datastring}}|;|-3}}}}<!--
-->{{#vardefine:Name4|{{:Armor_data|{{{1}}}|Name4}}}}<!--
-->{{#vardefine:Rarity|{{#explode: {{#var:Datastring}}|;|4}}}}<!--
-->{{#vardefine:Image|{{:Armor_data|{{{1}}}|Image}}}}<!--
-->{{#vardefine:ArmorClass|{{#explode: {{#var:Datastring}}|;|3}}}}<!--
-->{{#vardefine:Image2|{{:Armor_data|{{{1}}}|Image2}}}}<!--
-->{{#vardefine:Protection|{{#explode: {{#var:Datastring}}|;|8}}}}<!--
-->{{#vardefine:Image3|{{:Armor_data|{{{1}}}|Image3}}}}<!--
-->{{#vardefine:Durability|{{#explode: {{#var:Datastring}}|;|7}}}}<!--
-->{{#vardefine:Image4|{{:Armor_data|{{{1}}}|Image4}}}}<!--
-->{{#vardefine:Price|{{#explode: {{#var:Datastring}}|;|6}}}}<!--
-->{{#vardefine:Image|{{#explode: {{#var:Datastring}}|;|-6}}}}<!--
-->{{#vardefine:Image2|{{#explode: {{#var:Datastring}}|;|-5}}}}<!--
-->{{#vardefine:Image3|{{#explode: {{#var:Datastring}}|;|-4}}}}<!--
--- Load translations that are used multiple times into variables. ---
-->{{#vardefine:TranslateName|{{Translate|{{{1}}}|ItemNames}}}}
|-
|-
|{{#if:{{:Armor data|{{{1}}}|Unobtainable}}|{{Unobtainable}}<br />}}'''[[{{#ifeq:{{SUBPAGENAME}}|{{PAGENAME}}|{{{1}}}|{{{1}}}/{{SUBPAGENAME}}}}|{{#if:{{#var:Name}}|{{#if:{{Translate|{{#var:Name}}|ItemNames}}|{{Translate|{{#var:Name}}|ItemNames}}}}|{{#if:{{Translate|{{{1}}}|ItemNames}}|{{Translate|{{{1}}}|ItemNames}}}}}}]]'''<!--
|{{#if:{{#var:Unobtainable}}|{{Unobtainable}}<br />}}'''[[{{#ifeq:{{SUBPAGENAME}}|{{PAGENAME}}|{{{1}}}|{{{1}}}/{{SUBPAGENAME}}}}|{{#var:TranslateName}}]]'''<!--
 
-->{{#if:{{#var:Image2}}|<!--
-->{{#if:{{#var:Image2}}|<!--
 
--><div style="margin:0 auto 0 auto">[[File:{{#if:{{#var:Image}}|{{#var:Image}}|{{{1}}}.png}}|alt={{#var:TranslateName}}|class=image2x|link={{#ifeq:{{SUBPAGENAME}}|{{PAGENAME}}|{{{1}}}|{{{1}}}/{{SUBPAGENAME}}}}|{{#var:TranslateName}}]]<!--
--><div style="margin:0 auto 0 auto">[[File:{{#if:{{#var:Image}}|{{#var:Image}}|{{{1}}}.png}}|alt={{#if:{{#var:Name}}|{{Translate|{{#var:Name}}|ItemNames}}|{{Translate|{{{1}}}|ItemNames}}}}|class=image2x|link={{#ifeq:{{SUBPAGENAME}}|{{PAGENAME}}|{{{1}}}|{{{1}}}/{{SUBPAGENAME}}}}|{{#if:{{#var:Name}}|{{Translate|{{#var:Name}}|ItemNames}}|{{Translate|{{{1}}}|ItemNames}}}}]]<!--
-->[[File:{{#var:Image2}}|alt={{#var:TranslateName}}|class=image2x|link={{#ifeq:{{SUBPAGENAME}}|{{PAGENAME}}|{{{1}}}|{{{1}}}/{{SUBPAGENAME}}}}|{{#var:TranslateName}}]]</div><!--
-->[[File:{{#var:Image2}}|alt={{#if:{{#var:Name2}}|{{Translate|{{#var:Name2}}|ItemNames}}|{{#if:{{#var:Name}}|{{Translate|{{#var:Name}}|Name}}|ItemNames}}|{{Translate|{{{1}}}|ItemNames}}}}}}|class=image2x|link={{#ifeq:{{SUBPAGENAME}}|{{PAGENAME}}|{{{1}}}|{{{1}}}/{{SUBPAGENAME}}}}|{{#if:{{#var:Name2}}|{{Translate|{{#var:Name2}}|ItemNames}}|{{#if:{{#var:Name}}|{{#var:Name}}|{{Translate|{{{1}}}|ItemNames}}}}}}]]</div><!--
 
-->{{#if:{{#var:Image3}}<!--
-->{{#if:{{#var:Image3}}<!--
-->|[[File:{{#var:Image3}}|center|alt={{#var:TranslateName}}|class=image2x|link={{#ifeq:{{SUBPAGENAME}}|{{PAGENAME}}|{{{1}}}|{{{1}}}/{{SUBPAGENAME}}}}|{{#var:TranslateName}}]]<!--
-->}}<!--
-->|[[File:{{#if:{{#var:Image}}|{{#var:Image}}|{{{1}}}.png}}|center|alt={{#var:TranslateName}}|class=image2x|link={{#ifeq:{{SUBPAGENAME}}|{{PAGENAME}}|{{{1}}}|{{{1}}}/{{SUBPAGENAME}}}}]]}}


-->|{{#if:{{#var:Image4}}<!--
|{{#if:{{#var:Rarity}}||{{#vardefine:Rarity|Common}}}}{{c|{{#var:Rarity}}|{{Translate|{{#var:Rarity}}|Properties}}}}
 
-->|<div style="margin:0 auto 0 auto">[[File:{{#var:Image3}}|alt={{#if:{{#var:Name3}}|{{Translate|{{#var:Name3}}|ItemNames}}|{{#if:{{#var:Name}}|{{Translate|{{#var:Name}}|ItemNames}}|{{Translate|{{{1}}}|ItemNames}}}}}}|class=image2x|link={{#ifeq:{{SUBPAGENAME}}|{{PAGENAME}}|{{{1}}}|{{{1}}}/{{SUBPAGENAME}}}}|{{#if:{{#var:Name3}}|{{Translate|{{#var:Name3}}|ItemNames}}|{{#if:{{#var:Name}}|{{Translate|{{#var:Name}}|ItemNames}}|{{Translate|{{{1}}}|ItemNames}}}}}}]]<!--
-->[[File:{{#var:Image4}}|alt={{#if:{{#var:Name4}}|{{Translate|{{#var:Name4}}|ItemNames}}|{{#if:{{#var:Name}}|{{Translate|{{#var:Name}}|ItemNames}}|{{Translate|{{{1}}}|ItemNames}}}}}}|class=image2x|link={{#ifeq:{{SUBPAGENAME}}|{{PAGENAME}}|{{{1}}}|{{{1}}}/{{SUBPAGENAME}}}}|{{#if:{{#var:Name4}}|{{Translate|{{#var:Name4}}|ItemNames}}|{{#if:{{#var:Name}}|{{Translate|{{#var:Name}}|ItemNames}}|{{Translate|{{{1}}}|ItemNames}}}}}}]]</div><!--
 
-->|[[File:{{#var:Image3}}|center|alt={{#if:{{#var:Name}}|{{Translate|{{#var:Name}}|ItemNames}}|{{Translate|{{{1}}}|ItemNames}}}}|class=image2x|link={{#ifeq:{{SUBPAGENAME}}|{{PAGENAME}}|{{{1}}}|{{{1}}}/{{SUBPAGENAME}}}}]]<!--
 
-->}}}}<!--
 
-->|[[File:{{#if:{{#var:Image}}|{{#var:Image}}|{{{1}}}.png}}|center|alt={{#if:{{#var:Name}}|{{Translate|{{#var:Name}}|ItemNames}}|{{Translate|{{{1}}}|ItemNames}}}}|class=image2x|link={{#ifeq:{{SUBPAGENAME}}|{{PAGENAME}}|{{{1}}}|{{{1}}}/{{SUBPAGENAME}}}}]]}}
 
| {{#vardefine:item rarity|{{:Armor data|{{{1}}}|Rarity}}}}{{#if:{{#var:item rarity}}||{{#vardefine:item rarity|Common}}}}{{c|{{#var:item rarity}}|{{Translate|{{#var:item rarity}}|Properties}}}}
{{#ifeq:{{lc:{{#var:armor table type}}}}|jewelry||
{{#ifeq:{{lc:{{#var:armor table type}}}}|jewelry||
{{!}} {{#vardefine:item protection|{{:Armor data|{{{1}}}|Protection}}}}{{#if:{{#var:item protection}}|{{#var:item protection}}|0}}
{{#ifeq:{{lc:{{#var:armor table type}}}}|shield||
{{!}} {{Translate|{{:Armor data|{{{1}}}|ArmorClass}}|Properties}}
{{!}} {{#if:{{#var:Protection}}|{{#var:Protection}}|0}}
}}
{{!}} {{Translate|{{#var:ArmorClass}}|Properties}}
}}
}}
| {{:Armor data|{{{1}}}|Durability}}
| {{#var:Durability}}
| {{:Armor data|{{{1}}}|Price}}
| {{#var:Price}}
| {{Test|{{{1}}}}}</includeonly><noinclude>{{doc|Template:ArmorTable}}[[Category:Templates]]</noinclude>
| {{Test|{{{1}}}}}</includeonly><noinclude>{{doc|Template:ArmorTable}}[[Category:Templates]]</noinclude>

Latest revision as of 22:08, 19 June 2023

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