Difference between revisions of "Template:Weapon test"

From Stoneshard wiki
Jump to navigation Jump to search
(cleaned up pagename variables for testing)
 
(3 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. ---
--- If item name is provided as parameter, use the parameter instead of root page. ---
-->{{#vardefine:RootPage|{{#if:{{{1|}}}|{{{1|}}}|{{ROOTPAGENAME}}}}}}<!--
-->{{#vardefine:Page|{{#if:{{{1|}}}|{{{1|}}}|{{ROOTPAGENAME}}}}}}<!--
-->{{#vardefine:BasePage|{{#if:{{BASEPAGENAME}}|{{BASEPAGENAME}}|{{#var:RootPage}}}}}}<!--
--- Load complete datastring into a variable - to only load from the Armor data page once. ---
-->{{#vardefine:SubPage|{{#if:{{SUBPAGENAME}}|{{SUBPAGENAME}}|{{#var:RootPage}}}}}}<!--
-->{{#vardefine:Datastring|{{:Weapon_data|{{#var:Page}}}}}}<!--
-->{{#vardefine:Page|{{#if:{{PAGENAME}}|{{PAGENAME}}|{{#var:RootPage}}}}}}<!--
--- Separate values from datastring into individual variables. ---
-->{{#vardefine:Rarity|{{:Weapon_data|{{#var:RootPage}}|Rarity}}}}<!--
-->{{#vardefine:Unobtainable|{{#explode: {{#var:Datastring}}|;|-2}}}}<!--
-->{{#vardefine:Weapon Type|{{:Weapon_data|{{#var:RootPage}}|WeaponType}}}}<!--
-->{{#vardefine:Rarity|{{#explode: {{#var:Datastring}}|;|2}}}}<!--
-->{{#vardefine:Slashing Damage|{{:Weapon_data|{{#var:RootPage}}|Slashing Damage}}}}<!--
-->{{#vardefine:WeaponType|{{#explode: {{#var:Datastring}}|;|1}}}}<!--
-->{{#vardefine:Piercing Damage|{{:Weapon_data|{{#var:RootPage}}|Piercing Damage}}}}<!--
-->{{#vardefine:Slashing Damage|{{#explode: {{#var:Datastring}}|;|13}}}}<!--
-->{{#vardefine:Crushing Damage|{{:Weapon_data|{{#var:RootPage}}|Crushing Damage}}}}<!--
-->{{#vardefine:Piercing Damage|{{#explode: {{#var:Datastring}}|;|14}}}}<!--
-->{{#vardefine:Rending Damage|{{:Weapon_data|{{#var:RootPage}}|Rending Damage}}}}<!--
-->{{#vardefine:Crushing Damage|{{#explode: {{#var:Datastring}}|;|15}}}}<!--
-->{{#vardefine:Fire Damage|{{:Weapon_data|{{#var:RootPage}}|Fire Damage}}}}<!--
-->{{#vardefine:Rending Damage|{{#explode: {{#var:Datastring}}|;|16}}}}<!--
-->{{#vardefine:Frost Damage|{{:Weapon_data|{{#var:RootPage}}|Frost Damage}}}}<!--
-->{{#vardefine:Fire Damage|{{#explode: {{#var:Datastring}}|;|17}}}}<!--
-->{{#vardefine:Shock Damage|{{:Weapon_data|{{#var:RootPage}}|Shock Damage}}}}<!--
-->{{#vardefine:Frost Damage|{{#explode: {{#var:Datastring}}|;|18}}}}<!--
-->{{#vardefine:Poison Damage|{{:Weapon_data|{{#var:RootPage}}|Poison Damage}}}}<!--
-->{{#vardefine:Shock Damage|{{#explode: {{#var:Datastring}}|;|19}}}}<!--
-->{{#vardefine:Caustic Damage|{{:Weapon_data|{{#var:RootPage}}|Caustic Damage}}}}<!--
-->{{#vardefine:Poison Damage|{{#explode: {{#var:Datastring}}|;|20}}}}<!--
-->{{#vardefine:Arcane Damage|{{:Weapon_data|{{#var:RootPage}}|Arcane Damage}}}}<!--
-->{{#vardefine:Caustic Damage|{{#explode: {{#var:Datastring}}|;|21}}}}<!--
-->{{#vardefine:Sacred Damage|{{:Weapon_data|{{#var:RootPage}}|Sacred Damage}}}}<!--
-->{{#vardefine:Arcane Damage|{{#explode: {{#var:Datastring}}|;|22}}}}<!--
-->{{#vardefine:Unholy Damage|{{:Weapon_data|{{#var:RootPage}}|Unholy Damage}}}}<!--
-->{{#vardefine:Sacred Damage|{{#explode: {{#var:Datastring}}|;|23}}}}<!--
-->{{#vardefine:Psionic Damage|{{:Weapon_data|{{#var:RootPage}}|Psionic Damage}}}}<!--
-->{{#vardefine:Unholy Damage|{{#explode: {{#var:Datastring}}|;|24}}}}<!--
-->{{#vardefine:Durability|{{:Weapon_data|{{#var:RootPage}}|Durability}}}}<!--
-->{{#vardefine:Psionic Damage|{{#explode: {{#var:Datastring}}|;|25}}}}<!--
-->{{#vardefine:Description|{{:Weapon_data|{{#var:RootPage}}|Description}}}}<!--
-->{{#vardefine:Durability|{{#explode: {{#var:Datastring}}|;|4}}}}<!--
-->{{#vardefine:Description|{{#explode: {{#var:Datastring}}|;|-1}}}}<!--
-->{{#vardefine:Price|{{#explode: {{#var:Datastring}}|;|7}}}}<!--
--- Load translations that are used multiple times into variables. ---
-->{{#vardefine:TranslateName|{{Translate|{{#var:Page}}|ItemNames}}}}<!--
-->{{#vardefine:TranslateDamage|{{Translate|Damage|Properties}}}}<!--
-->{{#vardefine:TranslatePrice|{{Translate|Price|Properties}}}}<!--
--- Weapon Tooltip start. ---
--- Weapon Tooltip start. ---
-->{| width=300px;
-->{| width=300px;
|style="text-align:center;"|<!--
|style="text-align:center;"|<!--
--- Check if item is marked as unobtainable. ---
--- Check if item is marked as unobtainable. ---
-->{{#if:{{:Weapon_data|{{#var:RootPage}}|Unobtainable}}|{{Unobtainable}}<br />}}<!--
-->{{#if:{{#var:Unobtainable}}|{{Unobtainable}}<br />}}<!--
--- Check if item has Rarity, then format the text, color the item name with Rarity's color and display the weapon type. Default to Common Rarity if the item has no Rarity. ---
--- Check if item is of better rarity than common ---
-->{{#if: {{#var:Rarity}} | <span style="font-size: 20px;">{{c|{{#var:Rarity}}|{{Translate|{{#var:RootPage}}|ItemNames}}}}</span> <br /> <span style="color:#9d9a9a;">{{Translate|{{#var:Rarity}}|Properties}} | <span style="font-size: 20px;">{{Translate|{{#var:RootPage}}|ItemNames}}</span> <br /> <span style="color:#9d9a9a;">{{Translate|Common|Properties}} }} {{Translate|{{#var:Weapon Type}}|Properties}}</span>{{Tooltip rule}}
-->{{#if: {{#var:Rarity}} | <span style="font-size: 20px;">{{c|{{#var:Rarity}}|{{#var:TranslateName}}}}</span> <br /> <span style="color:#9d9a9a;">{{Translate|{{#var:Rarity}}|Properties}} | <span style="font-size: 20px;">{{#var:TranslateName}}</span> <br /> <span style="color:#9d9a9a;">{{Translate|Common|Properties}} }} {{Translate|{{#var:WeaponType}}|Properties}}</span>{{Tooltip rule}}
|-
|-
|style="text-align:center;"|<!--
|style="text-align:center;"|<!--
--- Only display Damage types that have a value. ---
--- Only display Damage types that have a value. ---
-->{{#if:{{#var:Slashing Damage}}|{{#var:Slashing Damage}} {{Translate|Slashing|Properties}} {{Translate|Damage|Properties}}<br>}}<!--
-->{{#if:{{#var:Slashing Damage}}|{{#var:Slashing Damage}} {{Translate|Slashing|Properties}} {{#var:TranslateDamage}}<br>}}<!--
-->{{#if:{{#var:Piercing Damage}}|{{#var:Piercing Damage}} {{Translate|Piercing|Properties}} {{Translate|Damage|Properties}}<br>}}<!--
-->{{#if:{{#var:Piercing Damage}}|{{#var:Piercing Damage}} {{Translate|Piercing|Properties}} {{#var:TranslateDamage}}<br>}}<!--
-->{{#if:{{#var:Crushing Damage}}|{{#var:Crushing Damage}} {{Translate|Crushing|Properties}} {{Translate|Damage|Properties}}<br>}}<!--
-->{{#if:{{#var:Crushing Damage}}|{{#var:Crushing Damage}} {{Translate|Crushing|Properties}} {{#var:TranslateDamage}}<br>}}<!--
-->{{#if:{{#var:Rending Damage}}|{{#var:Rending Damage}} {{Translate|Rending|Properties}} {{Translate|Damage|Properties}}<br>}}<!--
-->{{#if:{{#var:Rending Damage}}|{{#var:Rending Damage}} {{Translate|Rending|Properties}} {{#var:TranslateDamage}}<br>}}<!--
--- Swap the order of words for Russian wiki version on Fire, Frost, Shock, Poison and Caustic damage types, its a grammar/pronounciation thing apparently. ---
--- Swap the order of words for Russian wiki version on Fire, Frost, Shock, Poison and Caustic damage types, its a grammar/pronounciation thing apparently. ---
-->{{#if:{{#var:Fire Damage}}|{{c|Fire|{{#var:Fire Damage}} {{#ifeq: {{#titleparts: {{#var:Page}} | 1 | 2}} | ru |{{Translate|Damage|Properties}} {{Translate|Fire|Properties}}|{{Translate|Fire|Properties}} {{Translate|Damage|Properties}}}}}}<br>}}<!--
-->{{#if:{{#var:Fire Damage}}|{{c|Fire|{{#var:Fire Damage}} {{#ifeq: {{#titleparts: {{PAGENAME}} | 1 | 2}} | ru |{{#var:TranslateDamage}} {{Translate|Fire|Properties}}|{{Translate|Fire|Properties}} {{#var:TranslateDamage}}}}}}<br>}}<!--
-->{{#if:{{#var:Frost Damage}}|{{c|Frost|{{#var:Frost Damage}} {{#ifeq: {{#titleparts: {{#var:Page}} | 1 | 2}} | ru |{{Translate|Damage|Properties}} {{Translate|Frost|Properties}}|{{Translate|Frost|Properties}} {{Translate|Damage|Properties}}}}}}<br>}}<!--
-->{{#if:{{#var:Frost Damage}}|{{c|Frost|{{#var:Frost Damage}} {{#ifeq: {{#titleparts: {{PAGENAME}} | 1 | 2}} | ru |{{#var:TranslateDamage}} {{Translate|Frost|Properties}}|{{Translate|Frost|Properties}} {{#var:TranslateDamage}}}}}}<br>}}<!--
-->{{#if:{{#var:Shock Damage}}|{{c|Shock|{{#var:Shock Damage}} {{#ifeq: {{#titleparts: {{#var:Page}} | 1 | 2}} | ru |{{Translate|Damage|Properties}} {{Translate|Shock|Properties}}|{{Translate|Shock|Properties}} {{Translate|Damage|Properties}}}}}}<br>}}<!--
-->{{#if:{{#var:Shock Damage}}|{{c|Shock|{{#var:Shock Damage}} {{#ifeq: {{#titleparts: {{PAGENAME}} | 1 | 2}} | ru |{{#var:TranslateDamage}} {{Translate|Shock|Properties}}|{{Translate|Shock|Properties}} {{#var:TranslateDamage}}}}}}<br>}}<!--
-->{{#if:{{#var:Poison Damage}}|{{c|Poison|{{#var:Poison Damage}} {{#ifeq: {{#titleparts: {{#var:Page}} | 1 | 2}} | ru |{{Translate|Damage|Properties}} {{Translate|Poison|Properties}}|{{Translate|Poison|Properties}} {{Translate|Damage|Properties}}}}}}<br>}}<!--
-->{{#if:{{#var:Poison Damage}}|{{c|Poison|{{#var:Poison Damage}} {{#ifeq: {{#titleparts: {{PAGENAME}} | 1 | 2}} | ru |{{#var:TranslateDamage}} {{Translate|Poison|Properties}}|{{Translate|Poison|Properties}} {{#var:TranslateDamage}}}}}}<br>}}<!--
-->{{#if:{{#var:Caustic Damage}}|{{c|Caustic|{{#var:Caustic Damage}} {{#ifeq: {{#titleparts: {{#var:Page}} | 1 | 2}} | ru |{{Translate|Damage|Properties}} {{Translate|Caustic|Properties}}|{{Translate|Caustic|Properties}} {{Translate|Damage|Properties}}}}}}<br>}}<!--
-->{{#if:{{#var:Caustic Damage}}|{{c|Caustic|{{#var:Caustic Damage}} {{#ifeq: {{#titleparts: {{PAGENAME}} | 1 | 2}} | ru |{{#var:TranslateDamage}} {{Translate|Caustic|Properties}}|{{Translate|Caustic|Properties}} {{#var:TranslateDamage}}}}}}<br>}}<!--
-->{{#if:{{#var:Arcane Damage}}|{{c|Arcane|{{#var:Arcane Damage}} {{Translate|Arcane|Properties}} {{Translate|Damage|Properties}}}}<br>}}<!--
-->{{#if:{{#var:Arcane Damage}}|{{c|Arcane|{{#var:Arcane Damage}} {{Translate|Arcane|Properties}} {{#var:TranslateDamage}}}}<br>}}<!--
-->{{#if:{{#var:Sacred Damage}}|{{c|Sacred|{{#var:Sacred Damage}} {{Translate|Sacred|Properties}} {{Translate|Damage|Properties}}}}<br>}}<!--
-->{{#if:{{#var:Sacred Damage}}|{{c|Sacred|{{#var:Sacred Damage}} {{Translate|Sacred|Properties}} {{#var:TranslateDamage}}}}<br>}}<!--
-->{{#if:{{#var:Unholy Damage}}|{{c|Unholy|{{#var:Unholy Damage}} {{Translate|Unholy|Properties}} {{Translate|Damage|Properties}}}}<br>}}<!--
-->{{#if:{{#var:Unholy Damage}}|{{c|Unholy|{{#var:Unholy Damage}} {{Translate|Unholy|Properties}} {{#var:TranslateDamage}}}}<br>}}<!--
-->{{#if:{{#var:Psionic Damage}}|{{c|Psionic|{{#var:Psionic Damage}} {{Translate|Psionic|Properties}} {{Translate|Damage|Properties}}}}<br>}}<!--
-->{{#if:{{#var:Psionic Damage}}|{{c|Psionic|{{#var:Psionic Damage}} {{Translate|Psionic|Properties}} {{#var:TranslateDamage}}}}<br>}}<!--
-->{{Tooltip rule}}
-->{{Tooltip rule}}
|-
|-
|<!--
|<!--
--- Load and sort this weapon's properties, we use another template. ---
--- Load and sort this weapon's properties, we use another template. ---
--><div style="width:100%;color:#9d9a9a;">{{Test|{{#var:RootPage}}}}</div>
--><div style="width:100%;color:#9d9a9a;">{{Test_test|{{#var:Page}}}}</div>
<div style="color:#9d9a9a;">{{Translate|Durability|Properties}}: <span style="color:white;">{{#var:Durability}}/{{#var:Durability}}</span></div>
<div style="color:#9d9a9a;">{{Translate|Durability|Properties}}: <span style="color:white;">{{#var:Durability}}/{{#var:Durability}}</span></div>
|-
|-
|style="color:#9d7969;text-align:justify"|<!--
|style="color:#9d7969;text-align:justify"|<!--
--- Depending on which page we are currently on, description is loaded either from Data page, or from description translation template. ---
--- Depending on which page we are currently on, description is loaded either from Data page, or from description translation template. ---
-->{{Tooltip rule}}{{#if: {{#titleparts: {{#var:Page}} | 1 | 2}}|{{#ifeq: {{#var:Page}}|{{#var:RootPage}}/Tooltip |{{#var:Description}}|{{Translate|{{#var:RootPage}}|ItemDescriptions}}}}|{{#var:Description}}}}<div style="float:right;">[[File:Gold_Icon.png|18px|alt={{Translate|Price|Properties}}|link=|{{Translate|Price|Properties}}]]{{W|{{:Weapon_data|{{#var:RootPage}}|Price}}}}</div><br />
-->{{Tooltip rule}}{{#if: {{#titleparts: {{PAGENAME}} | 1 | 2}}|{{#ifeq: {{PAGENAME}}|{{#var:Page}}/Tooltip |{{#var:Description}}|{{Translate|{{#var:Page}}|ItemDescriptions}}}}|{{#var:Description}}}}<div style="float:right;">[[File:Gold_Icon.png|18px|alt={{#var:TranslatePrice}}|link=|{{#var:TranslatePrice}}]]{{W|{{#var:Price}}}}</div><br />
|-
|-
|style="text-align:center;"|[[File:{{#if:{{:Weapon_data|{{#var:RootPage}}|Image}}|{{:Weapon_data|{{#var:RootPage}}|Image}}|{{#var:RootPage}}.png}}|class=image2x|link={{#ifeq:{{#var:SubPage}}|Tooltip|{{#var:BasePage}}|{{#var:Page}}/Tooltip}}|alt={{Translate|{{#var:RootPage}}|ItemNames}}|{{Translate|{{#var:RootPage}}|ItemNames}}]]
|style="text-align:center;"|[[File:{{#var:Page}}.png|class=image2x|link=|alt={{#var:TranslateName}}|{{#var:TranslateName}}]]
|}
|}
{{#if: {{#titleparts: {{#var:Page}} | 1 | 2}} | {{#ifeq: {{#var:Page}} | {{#var:RootPage}}/Tooltip |[[Category:{{#var:Weapon Type}} Tooltips]]|{{#if: {{#titleparts: {{#var:Page}} | 1 | 3}}|[[Category: {{uc:{{#titleparts: {{#var:Page}} | 1 | 2}}}} {{#var:Weapon Type}} Tooltips]]|[[Category: {{uc:{{#titleparts: {{#var:Page}} | 1 | 2}}}} {{#var:Weapon Type}}]]}}}}|[[Category:{{#var:Weapon Type}}]]}}</includeonly><noinclude>{{doc}}
{{#if: {{#titleparts: {{PAGENAME}} | 1 | 2}} | {{#ifeq: {{PAGENAME}} | {{#var:Page}}/Tooltip |[[Category:{{#var:WeaponType}} Tooltips]]|{{#if: {{#titleparts: {{PAGENAME}} | 1 | 3}}|[[Category: {{uc:{{#titleparts: {{PAGENAME}} | 1 | 2}}}} {{#var:WeaponType}} Tooltips]]|[[Category: {{uc:{{#titleparts: {{PAGENAME}} | 1 | 2}}}} {{#var:WeaponType}}]]}}}}|[[Category:{{#var:WeaponType}}]]}}</includeonly><noinclude>{{doc}}
[[Category:Tooltip templates]]</noinclude>
[[Category:Tooltip templates]]</noinclude>

Latest revision as of 18:46, 31 May 2023

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