Difference between revisions of "Template:WeaponTable/row"

From Stoneshard wiki
Jump to navigation Jump to search
(using new DamageText property to load damage into the table)
(fix mismatched elemental damage types)
 
(2 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:Range|{{:Data|{{{1}}}|Range}}}}<!--
-->{{#vardefine:Datastring|{{:Weapon_data|{{{1}}}}}}}<!--
-->{{#vardefine:Name|{{:Data|{{{1}}}|Name}}}}<!--
--- Separate values from datastring into individual variables. ---
-->{{#vardefine:Image|{{:Data|{{{1}}}|Image}}}}<!--
-->{{#vardefine:Unobtainable|{{#explode: {{#var:Datastring}}|;|-2}}}}<!--
-->{{#vardefine:Rarity|{{:Data|{{{1}}}|Rarity}}}}<!--
-->{{#vardefine:Rarity|{{#explode: {{#var:Datastring}}|;|2}}}}<!--
-->{{#vardefine:Total Damage|{{:Data|{{{1}}}|Total Damage}}}}<!--
-->{{#vardefine:Total Damage|{{#explode: {{#var:Datastring}}|;|-3}}}}<!--
-->{{#vardefine:Damage Text|{{:Data|{{{1}}}|DamageText}}}}
-->{{#vardefine:Range|{{#explode: {{#var:Datastring}}|;|8}}}}<!--
-->{{#vardefine:Slashing Damage|{{#explode: {{#var:Datastring}}|;|13}}}}<!--
-->{{#vardefine:Piercing Damage|{{#explode: {{#var:Datastring}}|;|14}}}}<!--
-->{{#vardefine:Crushing Damage|{{#explode: {{#var:Datastring}}|;|15}}}}<!--
-->{{#vardefine:Rending Damage|{{#explode: {{#var:Datastring}}|;|16}}}}<!--
-->{{#vardefine:Fire Damage|{{#explode: {{#var:Datastring}}|;|17}}}}<!--
-->{{#vardefine:Shock Damage|{{#explode: {{#var:Datastring}}|;|18}}}}<!--
-->{{#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:{{:Data|{{{1}}}|Unobtainable}}|{{Unobtainable}}<br />}}<!--
|{{#if:{{#var:Unobtainable}}|{{Unobtainable}}<br />}}<!--
--- 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. ---
--- 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. ---
-->'''[[{{#ifeq:{{SUBPAGENAME}}|{{PAGENAME}}|{{{1}}}|{{{1}}}/{{SUBPAGENAME}}}}|<!--
-->'''[[{{#ifeq:{{SUBPAGENAME}}|{{PAGENAME}}|{{{1}}}|{{{1}}}/{{SUBPAGENAME}}}}|<!--
--- 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? ---
-->{{#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. ---
--- 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}}}}}}]]'''<!--
-->{{#if:{{#var:TranslateName}}|{{#var:TranslateName}}}}]]'''<!--
--- Check if there is a custom image link. If yes, load custom image from link, otherwise load "item name.png". ---
-->[[File:{{{1}}}.png|center|<!--
-->[[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. ---
--- 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}}}}]]
-->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}}}}
| {{#if:{{#var:Rarity}}||{{#vardefine:Rarity|Common}}}}{{c|{{#var:Rarity}}|{{Translate|{{#var:Rarity}}|Properties}}}}
| data-sort-value="{{#var:Total Damage}}" | {{#var:Damage Text}}
| data-sort-value="{{#var:Total Damage}}" |<!--
| {{:Data|{{{1}}}|Durability}}
-->{{#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}}
}}
}}
| {{:Data|{{{1}}}|Price}}
| {{#var:Price}}
| {{Test|{{{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.