Difference between revisions of "Template:Skill"
m |
(remove translation of Range value, on translated pages explode the Modifiers parameter into singular attributes and send them for translation individually) |
||
Line 2: | Line 2: | ||
-->{{#vardefine:Page|{{#if:{{{1|}}}|{{{1|}}}|{{ROOTPAGENAME}}}}}}<!-- | -->{{#vardefine:Page|{{#if:{{{1|}}}|{{{1|}}}|{{ROOTPAGENAME}}}}}}<!-- | ||
-->{{#vardefine:Skilltree|{{#if:{{{1|}}}|{{:Skill data|{{{1|}}}}}|{{:Skill data|{{ROOTPAGENAME}}}}}}}}<!-- | -->{{#vardefine:Skilltree|{{#if:{{{1|}}}|{{:Skill data|{{{1|}}}}}|{{:Skill data|{{ROOTPAGENAME}}}}}}}}<!-- | ||
-->{{#vardefine:Modifiers|{{#if: {{:{{#var:Skilltree}}|{{#var:Page}}|Modifiers}}|{{:{{#var:Skilltree}}|{{#var:Page}}|Modifiers}}|}}}}<!-- | |||
--><div style="width: 300px;">{{#ifeq: {{#var:Skilltree}}|Skill data missing.|Skill with name "{{{1|{{ROOTPAGENAME}}}}}" does not exist.<br><br>Add it to [[Skill data]] or fix the Skill name.|{{#if: {{{1|}}}||{{#ifexist: File:{{#var:Page}}.png | <div style="position:relative;float:right;margin-top: -9px;">[[File:{{#var:Page}}.png|{{Translate|{{{Name|{{#var:Page}}}}}|SkillNames}}|link={{#ifeq:{{SUBPAGENAME}}|Tooltip|{{BASEPAGENAME}}|{{PAGENAME}}/Tooltip}}]]</div>| }}}}<span style="font-size: 20px;">{{Translate|{{{Name|{{#if:{{:{{#var:Skilltree}}|{{#var:Page}}|Name}}|{{:{{#var:Skilltree}}|{{#var:Page}}|Name}}|{{#var:Page}}}}}}}|SkillNames}}</span> <br />{{#switch: {{:{{#var:Skilltree}}|{{#var:Page}}|Active}} | Active | active = {{C|Active|{{Translate|Active|Properties}}}} | Passive | passive = {{C|Passive|{{Translate|Passive|Properties}}}} | {{:{{#var:Skilltree}}|{{#var:Page}}|Active}} }} | --><div style="width: 300px;">{{#ifeq: {{#var:Skilltree}}|Skill data missing.|Skill with name "{{{1|{{ROOTPAGENAME}}}}}" does not exist.<br><br>Add it to [[Skill data]] or fix the Skill name.|{{#if: {{{1|}}}||{{#ifexist: File:{{#var:Page}}.png | <div style="position:relative;float:right;margin-top: -9px;">[[File:{{#var:Page}}.png|{{Translate|{{{Name|{{#var:Page}}}}}|SkillNames}}|link={{#ifeq:{{SUBPAGENAME}}|Tooltip|{{BASEPAGENAME}}|{{PAGENAME}}/Tooltip}}]]</div>| }}}}<span style="font-size: 20px;">{{Translate|{{{Name|{{#if:{{:{{#var:Skilltree}}|{{#var:Page}}|Name}}|{{:{{#var:Skilltree}}|{{#var:Page}}|Name}}|{{#var:Page}}}}}}}|SkillNames}}</span> <br />{{#switch: {{:{{#var:Skilltree}}|{{#var:Page}}|Active}} | Active | active = {{C|Active|{{Translate|Active|Properties}}}} | Passive | passive = {{C|Passive|{{Translate|Passive|Properties}}}} | {{:{{#var:Skilltree}}|{{#var:Page}}|Active}} }} | ||
{{Tooltip rule}} | {{Tooltip rule}} | ||
{{#switch: {{:{{#var:Skilltree}}|{{#var:Page}}|Active}} | {{#switch: {{:{{#var:Skilltree}}|{{#var:Page}}|Active}} | ||
| Active | | Active | ||
| active = <div style="float: left">{{Translate|Type|Properties}}</div><div style="float: right">{{Translate|{{:{{#var:Skilltree}}|{{#var:Page}}|Type}}|Properties}}</div>{{Clear}}{{#if: {{:{{#var:Skilltree}}|{{#var:Page}}|Range}} | <div style="float: left">{{Translate|Range|Properties}}</div><div style="float: right"> | | active = <div style="float: left">{{Translate|Type|Properties}}</div><div style="float: right">{{Translate|{{:{{#var:Skilltree}}|{{#var:Page}}|Type}}|Properties}}</div>{{Clear}}{{#if: {{:{{#var:Skilltree}}|{{#var:Page}}|Range}} | <div style="float: left">{{Translate|Range|Properties}}</div><div style="float: right">{{:{{#var:Skilltree}}|{{#var:Page}}|Range}}</div>{{Clear}} | }}{{#if: {{:{{#var:Skilltree}}|{{#var:Page}}|Energy}} | <div style="float: left">{{Translate|Energy|Properties}}</div><div style="float: right">{{:{{#var:Skilltree}}|{{#var:Page}}|Energy}}</div>{{Clear}} |}}{{#if: {{:{{#var:Skilltree}}|{{#var:Page}}|Cooldown}} | <div style="float: left">{{Translate|Cooldown|Properties}}</div><div style="float: right">{{:{{#var:Skilltree}}|{{#var:Page}}|Cooldown}}</div>{{Clear}} | }}{{#if: {{:{{#var:Skilltree}}|{{#var:Page}}|Backfireper}} | <div style="float: left">{{Translate|Backfire Chance|Properties}}</div><div style="float: right">{{:{{#var:Skilltree}}|{{#var:Page}}|Backfireper}}</div>{{Clear}} | }}{{#if: {{#var:Modifiers}} | {{Translate|Modified by|Properties}}: {{#ifeq:{{SUBPAGENAME}}|{{PAGENAME}}|{{#var:Modifiers}}|{{Translate|{{#explode:{{#var:Modifiers}}|, }}|Properties}}{{#if: {{#explode:{{#var:Modifiers}}|, |1}}|{{Translate|{{#explode:{{#var:Modifiers}}|, |1}}|Properties}}}}{{#if: {{#explode:{{#var:Modifiers}}|, |2}}|{{Translate|{{#explode:{{#var:Modifiers}}|, |2}}|Properties}}}}{{#if: {{:{{#var:Skilltree}}|{{#var:Page}}|Requirements}}|<br><br>}}|{{#if: {{:{{#var:Skilltree}}|{{#var:Page}}|Requirements}}|<br>}}}} | ||
| }}{{#if: {{:{{#var:Skilltree}}|{{#var:Page}}|Requirements}}|{{C|Req|{{Translate|{{:{{#var:Skilltree}}|{{#var:Page}}|Requirements}}|Properties}}}}{{Tooltip rule}}|{{#if: {{:{{#var:Skilltree}}|{{#var:Page}}|Type}} |{{Tooltip rule}}}}}} | | }}{{#if: {{:{{#var:Skilltree}}|{{#var:Page}}|Requirements}}|{{C|Req|{{Translate|{{:{{#var:Skilltree}}|{{#var:Page}}|Requirements}}|Properties}}}}{{Tooltip rule}}|{{#if: {{:{{#var:Skilltree}}|{{#var:Page}}|Type}} |{{Tooltip rule}}}}}} | ||
<div class="mw-collapsible" id="mw-customcollapsible-description1">{{#ifeq:{{SUBPAGENAME}}|{{PAGENAME}}|{{C|Gray|{{:{{#var:Skilltree}}|{{#var:Page}}|Description}}}}|{{C|Gray|{{Translate|{{ROOTPAGENAME}}|SkillDescription}}}}}}</div> | <div class="mw-collapsible" id="mw-customcollapsible-description1">{{#ifeq:{{SUBPAGENAME}}|{{PAGENAME}}|{{C|Gray|{{:{{#var:Skilltree}}|{{#var:Page}}|Description}}}}|{{C|Gray|{{Translate|{{ROOTPAGENAME}}|SkillDescription}}}}}}</div> |
Revision as of 19:06, 14 January 2023
This is skill template used to create an infobox on a specific skill's Tooltip page. It loads the skill data from the respective Skill data page.
Usage: Copy this code to any page. The name of the page will be used as the skill name parameter.
{{ {{{1|Tooltip hover box}}}|title={{Skill}}}}
You can specify a different skill name to be used instead of the page name. For example:
{{ {{{1|Tooltip hover box}}}|title={{Skill|My skill name}}}}
Skill pages also display icons and skill formulae for skills that have them, but this doesn't work for tooltips.
For this case, you can define a tooltip=1 parameter to not show the skill image.
{{ {{{1|Tooltip hover box}}}|title={{Skill|My skill name|tooltip=1}}}}
If you don't want a skill to display skill formulae (and hide the button), remove the
|Formuladesc = ...
parameter from the skill's data.
This template is also used by:
{{TooltipImage}}
to generate toolipts on hover{{SkillTable/row}}
to populate skill tables on skilltree landing pages
See Swords_(skill_tree) for examples.
Examples without icons below:
Add it to Skill data or fix the Skill name.|Stone Armor
spell
Add it to Skill data or fix the Skill name.|Cleaving Strike
attack
Add it to Skill data or fix the Skill name.|Offensive Tactic
maneuver
Add it to Skill data or fix the Skill name.|Hammer and Anvil
stance
Add it to Skill data or fix the Skill name.|Campfire
maneuver
Add it to Skill data or fix the Skill name.|Honed Edge
Passive
Add it to Skill data or fix the Skill name.|Skinning
Active
The chance of successful skinning depends on the type of damage used to kill the animal.
Piercing and Crushing Damage harm pelts the least.
Add it to Skill data or fix the Skill name.|Element of Surprise
Passive
Example of a tooltip version (doesn't show the skill image, helps with some plugin limitations):
Add it to Skill data or fix the Skill name.|Campfire
maneuver
Example of a non-existing skill:
Add it to Skill data or fix the Skill name.|Skill data missing.
Skill data missing.