imported>Koanyan5028
Created page with "{{Stat Bar|amount=30|stat=speed}} This template can be used to create a Stat Bar that indicates maximum amount of potions that can be consumed. The <code>amount</code> argment is used to pass the maximum amount of potions that can be consumed. Valid values: <code>0</code>, <code>5</code>, <code>10</code>, <code>15</code>, <code>20</code>, <code>25</code>, <code>30</code> The bar color can be specified by the <code>stat</code> argment with stat name (e.g. defense),..."
 
the mass documenting
 
Line 1: Line 1:
{{Stat Bar|amount=30|stat=speed}}
'''<code>Template:Stat Bar</code> renders a coloured 10-segment bar showing how many of the maximum 30 potions can be consumed for a given stat.'''
__TOC__


This template can be used to create a Stat Bar that indicates maximum amount of potions that can be consumed.
== Overview ==
This template draws a small bar made of ten ■/□ blocks preceded by the numeric label <code>amount/30</code> in bold. The number of filled blocks reflects the <code>amount</code> value, and the colour of the bar is chosen either from a named stat (via [[Template:Stat Color]]) or from a raw colour code. It is used to show maximum potion consumption per stat, and is the building block used by [[Template:Stat Table]], which calls one Stat Bar per stat row.


== Parameters ==
{| class="wikitable"
! Parameter !! Required? !! What it does !! Example
|-
| <code>amount</code> || Required || How full the bar is, out of 30. Only the exact values 0, 5, 10, 15, 20, 25, 30 are recognised; any other value renders a red "Error: Invalid Argument". Also shown as the <code>amount/30</code> label. || <code>amount=20</code>
|-
| <code>stat</code> || Optional || A stat name passed to [[Template:Stat Color]] to colour the bar (e.g. health, attack, defense/defence, speed, evasion, vitality, crit and its aliases). Takes priority over <code>color</code> if both are given. || <code>stat=speed</code>
|-
| <code>color</code> || Optional || A raw CSS colour for the bar, used only when <code>stat</code> is not given. || <code>color=#55ffff</code>
|}


The <code>amount</code> argment is used to pass the maximum amount of potions that can be consumed.
== How to use ==
1. Type <code><nowiki>{{Stat Bar</nowiki></code>.
2. Set <code>|amount=</code> to one of the allowed steps: 0, 5, 10, 15, 20, 25, or 30. Other numbers produce an error message instead of a bar.
3. Choose a colour one of two ways:
:* <code>|stat=speed</code> — colours the bar by stat name (recommended; keeps colours consistent site-wide). This wins if both are present.
:* <code>|color=#55ffff</code> — a literal colour code, for arbitrary colours.
4. Close with <code><nowiki>}}</nowiki></code>.


Valid values: <code>0</code>, <code>5</code>, <code>10</code>, <code>15</code>, <code>20</code>, <code>25</code>, <code>30</code>
Special-syntax note: the fill levels are a fixed lookup — each allowed <code>amount</code> maps to a specific ■/□ pattern (e.g. 25 → ■■■■■■■■□□). There is no smooth scaling, so you must use one of the seven listed values.


== Copy this ==
<syntaxhighlight lang="wikitext" style="overflow:auto;">
{{Stat Bar|stat=|amount=}}
</syntaxhighlight>


The bar color can be specified by the <code>stat</code> argment with stat name (e.g. defense), or the <code>color</code> argment with color code to use arbitrary color. The <code>stat</code> argment has higher priority if both are used.
== Example ==
Live result:


==Examples==
{{Stat Bar|stat=defense|amount=15}}
Code:
<nowiki>
{{Stat Bar|stat=defense|amount=15}}</nowiki>
Result:
: {{Stat Bar|stat=defense|amount=15}}


----
Wikitext that produced it:
Code:
<nowiki>
{{Stat Bar|color=#55ffff|amount=20}}</nowiki>
Result:
: {{Stat Bar|color=#55ffff|amount=20}}


----
<syntaxhighlight lang="wikitext" style="overflow:auto;">
Code:
{{Stat Bar|stat=defense|amount=15}}
<nowiki>
</syntaxhighlight>
{| class="wikitable"
 
|-
Using a raw colour instead of a stat:
! [[Speed]]
 
! {{Stat Bar|stat=speed|amount=30}}
{{Stat Bar|color=#55ffff|amount=20}}
|}</nowiki>
 
Result:
<syntaxhighlight lang="wikitext" style="overflow:auto;">
: {| class="wikitable"
{{Stat Bar|color=#55ffff|amount=20}}
|-
</syntaxhighlight>
! [[Speed]]
 
! {{Stat Bar|stat=speed|amount=30}}
== Tips & notes ==
|}
* Valid <code>amount</code> values are only 0, 5, 10, 15, 20, 25, 30 — anything else (including 1, 12, 35) shows a red error, not a bar.
* If you set both <code>stat</code> and <code>color</code>, <code>stat</code> wins.
* Prefer <code>stat</code> over <code>color</code> so bar colours stay consistent with [[Template:Stat Color]] across the wiki.
* Related: [[Template:Stat Color]] (the colour lookup it uses) and [[Template:Stat Table]] (builds a full table of these bars).

Latest revision as of 11:55, 20 June 2026

Template:Stat Bar renders a coloured 10-segment bar showing how many of the maximum 30 potions can be consumed for a given stat.

Overview

This template draws a small bar made of ten ■/□ blocks preceded by the numeric label amount/30 in bold. The number of filled blocks reflects the amount value, and the colour of the bar is chosen either from a named stat (via Template:Stat Color) or from a raw colour code. It is used to show maximum potion consumption per stat, and is the building block used by Template:Stat Table, which calls one Stat Bar per stat row.

Parameters

Parameter Required? What it does Example
amount Required How full the bar is, out of 30. Only the exact values 0, 5, 10, 15, 20, 25, 30 are recognised; any other value renders a red "Error: Invalid Argument". Also shown as the amount/30 label. amount=20
stat Optional A stat name passed to Template:Stat Color to colour the bar (e.g. health, attack, defense/defence, speed, evasion, vitality, crit and its aliases). Takes priority over color if both are given. stat=speed
color Optional A raw CSS colour for the bar, used only when stat is not given. color=#55ffff

How to use

1. Type {{Stat Bar. 2. Set |amount= to one of the allowed steps: 0, 5, 10, 15, 20, 25, or 30. Other numbers produce an error message instead of a bar. 3. Choose a colour one of two ways:

  • |stat=speed — colours the bar by stat name (recommended; keeps colours consistent site-wide). This wins if both are present.
  • |color=#55ffff — a literal colour code, for arbitrary colours.

4. Close with }}.

Special-syntax note: the fill levels are a fixed lookup — each allowed amount maps to a specific ■/□ pattern (e.g. 25 → ■■■■■■■■□□). There is no smooth scaling, so you must use one of the seven listed values.

Copy this

{{Stat Bar|stat=|amount=}}

Example

Live result:

15/30 ■■■■■□□□□□

Wikitext that produced it:

{{Stat Bar|stat=defense|amount=15}}

Using a raw colour instead of a stat:

20/30 ■■■■■■□□□□

{{Stat Bar|color=#55ffff|amount=20}}

Tips & notes

  • Valid amount values are only 0, 5, 10, 15, 20, 25, 30 — anything else (including 1, 12, 35) shows a red error, not a bar.
  • If you set both stat and color, stat wins.
  • Prefer stat over color so bar colours stay consistent with Template:Stat Color across the wiki.
  • Related: Template:Stat Color (the colour lookup it uses) and Template:Stat Table (builds a full table of these bars).