Difference between revisions of "Template:Weapon"
Jump to navigation
Jump to search
(add category parameter) |
(update for RtR) |
||
Line 5: | Line 5: | ||
-->{{#vardefine:Datastring|{{:Weapon_data|{{#var:Page}}}}}}<!-- | -->{{#vardefine:Datastring|{{:Weapon_data|{{#var:Page}}}}}}<!-- | ||
--- Separate values from datastring into individual variables. --- | --- Separate values from datastring into individual variables. --- | ||
-->{{#vardefine:Tier|{{#explode: {{#var:Datastring}}|;|0}}}}<!-- | |||
-->{{#vardefine:Unobtainable|{{#explode: {{#var:Datastring}}|;|-2}}}}<!-- | -->{{#vardefine:Unobtainable|{{#explode: {{#var:Datastring}}|;|-2}}}}<!-- | ||
-->{{#vardefine:Rarity|{{#explode: {{#var:Datastring}}|;| | -->{{#vardefine:Rarity|{{#explode: {{#var:Datastring}}|;|3}}}}<!-- | ||
-->{{#vardefine:WeaponType|{{#explode: {{#var:Datastring}}|;| | -->{{#vardefine:WeaponType|{{#explode: {{#var:Datastring}}|;|2}}}}<!-- | ||
-->{{#vardefine:Slashing Damage|{{#explode: {{#var:Datastring}}|;| | -->{{#vardefine:Slashing Damage|{{#explode: {{#var:Datastring}}|;|12}}}}<!-- | ||
-->{{#vardefine:Piercing Damage|{{#explode: {{#var:Datastring}}|;| | -->{{#vardefine:Piercing Damage|{{#explode: {{#var:Datastring}}|;|13}}}}<!-- | ||
-->{{#vardefine:Crushing Damage|{{#explode: {{#var:Datastring}}|;| | -->{{#vardefine:Crushing Damage|{{#explode: {{#var:Datastring}}|;|14}}}}<!-- | ||
-->{{#vardefine:Rending Damage|{{#explode: {{#var:Datastring}}|;| | -->{{#vardefine:Rending Damage|{{#explode: {{#var:Datastring}}|;|15}}}}<!-- | ||
-->{{#vardefine:Fire Damage|{{#explode: {{#var:Datastring}}|;| | -->{{#vardefine:Fire Damage|{{#explode: {{#var:Datastring}}|;|16}}}}<!-- | ||
-->{{#vardefine:Shock Damage|{{#explode: {{#var:Datastring}}|;| | -->{{#vardefine:Shock Damage|{{#explode: {{#var:Datastring}}|;|17}}}}<!-- | ||
-->{{#vardefine:Poison Damage|{{#explode: {{#var:Datastring}}|;| | -->{{#vardefine:Poison Damage|{{#explode: {{#var:Datastring}}|;|18}}}}<!-- | ||
-->{{#vardefine:Caustic Damage|{{#explode: {{#var:Datastring}}|;| | -->{{#vardefine:Caustic Damage|{{#explode: {{#var:Datastring}}|;|19}}}}<!-- | ||
-->{{#vardefine:Frost Damage|{{#explode: {{#var:Datastring}}|;| | -->{{#vardefine:Frost Damage|{{#explode: {{#var:Datastring}}|;|20}}}}<!-- | ||
-->{{#vardefine:Arcane Damage|{{#explode: {{#var:Datastring}}|;| | -->{{#vardefine:Arcane Damage|{{#explode: {{#var:Datastring}}|;|21}}}}<!-- | ||
-->{{#vardefine:Unholy Damage|{{#explode: {{#var:Datastring}}|;| | -->{{#vardefine:Unholy Damage|{{#explode: {{#var:Datastring}}|;|22}}}}<!-- | ||
-->{{#vardefine:Sacred Damage|{{#explode: {{#var:Datastring}}|;| | -->{{#vardefine:Sacred Damage|{{#explode: {{#var:Datastring}}|;|23}}}}<!-- | ||
-->{{#vardefine:Psionic Damage|{{#explode: {{#var:Datastring}}|;| | -->{{#vardefine:Psionic Damage|{{#explode: {{#var:Datastring}}|;|24}}}}<!-- | ||
-->{{#vardefine:Durability|{{#explode: {{#var:Datastring}}|;| | -->{{#vardefine:Durability|{{#explode: {{#var:Datastring}}|;|5}}}}<!-- | ||
-->{{#vardefine:Description|{{#explode: {{#var:Datastring}}|;|-1}}}}<!-- | -->{{#vardefine:Description|{{#explode: {{#var:Datastring}}|;|-1}}}}<!-- | ||
-->{{#vardefine:Price|{{#explode: {{#var:Datastring}}|;|7}}}}<!-- | -->{{#vardefine:Price|{{#explode: {{#var:Datastring}}|;|7}}}}<!-- | ||
Line 33: | Line 34: | ||
--- Check if item is marked as unobtainable. --- | --- Check if item is marked as unobtainable. --- | ||
-->{{#if:{{#var:Unobtainable}}|{{Unobtainable}}<br />}}<!-- | -->{{#if:{{#var:Unobtainable}}|{{Unobtainable}}<br />}}<!-- | ||
--- TEMP - display weapon Tier --- | |||
-->{{#if:{{#var:Tier}}|{{#var:Tier}}<br />}}<!-- | |||
--- Check if item is of better rarity than common --- | --- Check if item is of better rarity than common --- | ||
-->{{#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}} | -->{{#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}} |
Revision as of 20:08, 25 December 2024
Documentation
[purge]
This is weapon template created for use together with the Template:Tooltip hover box template to display tooltip with item attributes for weapons.
Usage: Copy this code to any page where you want to display the item tooltip:
{{{{{1|Tooltip hover box}}}|title={{Weapon}}}}
You can provide the item name as first parameter, otherwise the pagename is used.
By default, the page is also labelled with a category corresponding to the item type (ie. Heavy Aldorian Bow will receive the Category: Bow
).
If you don't want to add this category to a page, add the category
parameter:
{{{{{1|Tooltip hover box}}}|title={{Weapon|Heavy Aldorian Bow|category=no}}}}
Examples:
Data does not exist. Heavy Aldorian Bow Common |
Durability: /
|
Data does not exist. |
Data does not exist. Orcish Battlesickle Common |
Durability: /
|
Data does not exist. |