Difference between revisions of "Template:Consumable"

From Stoneshard wiki
Jump to navigation Jump to search
 
Line 6: Line 6:
-->{{#vardefine:Rending Damage|{{:{{ROOTPAGENAME}}|Rending Damage}}}}<!--
-->{{#vardefine:Rending Damage|{{:{{ROOTPAGENAME}}|Rending Damage}}}}<!--
-->{| width=300px;
-->{| width=300px;
|style="text-align:center;"|{{#if:{{:{{ROOTPAGENAME}}|Unobtainable}}|{{Unobtainable}}<br />|}}<span style="font-size: 20px;">{{Translate|{{#if:{{:{{ROOTPAGENAME}}|Name}}|{{:{{ROOTPAGENAME}}|Name}}|{{ROOTPAGENAME}}}}|ConsumableNames}}</span><br /><span style="color:#9d9a9a;">{{Translate|{{:{{ROOTPAGENAME}}|ItemType}}|Properties}}</span>{{#ifeq:{{:{{ROOTPAGENAME}}|Properties1}}|{{:{{ROOTPAGENAME}}|PropertyText}}||{{Tooltip rule}}}}<!--
|style="text-align:center;"|{{#if:{{:{{ROOTPAGENAME}}|Unobtainable}}|{{Unobtainable}}<br />|}}<span style="font-size: 20px;">{{Translate|{{#if:{{:{{ROOTPAGENAME}}|Name}}|{{:{{ROOTPAGENAME}}|Name}}|{{ROOTPAGENAME}}}}|ConsumableNames}}</span><br /><span style="color:#9d9a9a;">{{Translate|{{:{{ROOTPAGENAME}}|ItemType}}|Properties}}</span>{{#ifeq:{{:{{ROOTPAGENAME}}|Properties1}}|{{:{{ROOTPAGENAME}}|PropertyText}}||{{Tooltip rule}}}}
-->{{#if:{{#var:Slashing Damage}}{{#var:Piercing Damage}}{{#var:Crushing Damage}}{{#var:Rending Damage}}|
|-
|-
|style="text-align:center;"|<!--
|style="text-align:center;"|{{#if:{{#var:Slashing Damage}}{{#var:Piercing Damage}}{{#var:Crushing Damage}}{{#var:Rending Damage}}|<!--
--- 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}} {{Translate|Damage|Properties}}<br>}}<!--

Latest revision as of 21:08, 21 February 2023

Template-info.png Documentation

This is consumable template created for use together with the Template:Tooltip hover box template on a specific consumable's page or consumable's tooltip page.

Usage: The page itself must contain the consumable's data before this Template works. For example, if I wanted to create the Agrimony page, I'll add this code to the start of the page and modify the values:

<includeonly>{{#switch: {{{1}}}
|ItemType = Ingredient
|Properties1 = Energy Replenishment
|Values1 = {{c|+|+5}}
|Properties2 = Health Restoration
|Values2 = {{c|+|+0.50% (45x)}}
|Properties3 = Immunity
|Values3 = {{c|+|+1%}}
|PropertyText = 
|Description = Agrimony has been valued for its healing qualities since olden times.
|Price = 10
|#default = 
}}</includeonly>

This data is invisible on the page itself, thanks to the includeonly tags.


Next, copy this code to Agrimony or Agrimony/Tooltip or Agrimony/anything page:

{{ {{{1|Tooltip hover box}}}
|title= {{Consumable}}
}}

It will automatically load the consumable's data and fill them into this format. Go to Agrimony to see the result.