Difference between revisions of "Stat"

m
m
 
(23 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>{{#if:{{{2|}}}|{{{2}}}&nbsp;}}<!-- handle stat value
+
<includeonly>{{#vardefine:link|{{{link|{{{1}}}}}}}}<!--
 +
-->{{#if:{{{2|}}}|{{{2}}}&nbsp;}}<!-- handle stat value
 
-->{{#iferror:{{icon|{{{icon|{{{1}}}_Icon.png}}}}}<!-- if icon doesn't exist
 
-->{{#iferror:{{icon|{{{icon|{{{1}}}_Icon.png}}}}}<!-- if icon doesn't exist
 
-->|[[File:{{{1}}}_Icon.png|?]]<!-- handle non-existent icon
 
-->|[[File:{{{1}}}_Icon.png|?]]<!-- handle non-existent icon
-->|{{icon|{{{icon|{{{1}}}_Icon.png}}}|{{{link|{{{1}}}}}}}}}}<!-- add icon with link
+
-->|{{icon|{{{icon|{{{1}}}_Icon.png}}}|{{#ifeq:{{lc:{{{link}}}}}|no||{{#var:link}}}}}}<!-- add icon with link
-->{{#if:{{{label|}}}||&nbsp;[[{{{link|{{{1}}}}}}|{{{1}}}]]}}<!-- handle label
+
-->{{#if:{{{nolabel|}}}||<!-- if no label is specified
 +
-->&nbsp;{{#ifeq:{{lc:{{{link}}}}}|no<!-- if no link is specified
 +
-->|{{{1}}}<!-- use plaintext
 +
-->|[[{{#var:link}}|{{{1}}}]]}}}}}}<!-- else add link
  
-->{{#ifeq:[[:{{PAGENAME}}|{{PAGENAME}}]]<!-- if the page
+
SET PROPERTIES
-->|{{#ask: [[Category:Skills]] [[{{PAGENAME}}]]}}{{#ask: [[Category:Passive talents]] [[{{PAGENAME}}]]}}<!-- is in Category:Skills or Category:Passive talents
+
-->{{#if:<!-- if the page
-->|{{#set:Has stat={{ucfirst:{{lc:{{{1}}}}}}}}}<!-- then set 'Has stat' property
+
-->{{#ask: [[Category:Skills||Passive Talents]] [[{{PAGENAME}}]]}}<!-- is in Category:Skills or Category:Passive Talents
-->{{#set:Has stat value={{{2|}}}}}<!-- and set 'Has stat value' property
+
-->|{{#set:Has stat={{#vardefineecho:index|{{#expr:{{#var:index|0}}+1}}}}<!-- recursively define stat index
-->}}</includeonly><noinclude>{{Stat/Documentation}}</noinclude>
+
-->;{{{2|0}}}<!-- define stat value
 +
-->;{{#replace:{{sc|{{#var:link}}}}|&nbsp;|_}}}}<!-- define stat name and bypass semicolon in '&nbsp;'
 +
-->}}</includeonly><noinclude>{{{{PAGENAME}}/Documentation}}</noinclude>

Latest revision as of 20:46, 2 June 2024

Description[edit]

Displays a stat's icon and name, with a link to the page of the stat.

Usage[edit]

{{stat|<Attack Power>|<+123>|<icon=Attack Power.png>|<link=Attack Power>|<nolabel=yes>}}

Parameters[edit]

Arrow.png1: The name of the stat.
Required.
Arrow.png2: The value of the stat.
Optional.
Arrow.pngicon: The stat's icon.
Optional. Defaults to '{{{1}}}_Icon.png'.
Arrow.pnglink: The page link.
Optional. Defaults to '{{{1}}}'.
Notes: If set to 'no', label will be plaintext.
Arrow.pngnolabel: Determines whether the name of the stat is shown.
Optional.
Notes: Set this parameter any value to hide label text.