Template:StatTable: Difference between revisions

From I-Pixelmon
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
<templatestyles src="Template:StatTable/styles.css" />
<templatemessagelocal>
 
{| class="pkmn-stats"
<!--
! scope="row" class="hp" | HP:
Usage:
| {{{HP|N/A}}}
{{StatTable
| style="width:{{#expr: {{{HP|0}}} > 255  ? 255  : {{{HP|0}}} }}px" |
| type  = Grass      <!-- primary type for the total row colour *optional* -->
| HP    = 80
| Attack = 82
| Defense= 83
| SpAtk  = 100
| SpDef  = 100
| Speed  = 80
| Total  = 525        <!-- optional; auto-calculated if omitted -->
}}
-->
 
{| class="stat-chart"
|-
|-
! scope="row" class="lbl hp" | HP:
! scope="row" class="atk" | Attack:
| class="num" | {{{HP|N/A}}}
| {{{Attack|N/A}}}
| class="bar-cell" | <span class="bar hp" style="width: {{#expr: min({{{HP|0}}}, 255)}}px;"></span>
| style="width:{{#expr: {{{Attack|0}}} > 255 ? 255 : {{{Attack|0}}} }}px" |
|-
|-
! scope="row" class="lbl atk" | Attack:
! scope="row" class="def" | Defense:
| class="num" | {{{Attack|N/A}}}
| {{{Defense|N/A}}}
| class="bar-cell" | <span class="bar atk" style="width: {{#expr: min({{{Attack|0}}}, 255)}}px;"></span>
| style="width:{{#expr: {{{Defense|0}}} > 255 ? 255 : {{{Defense|0}}} }}px" |
|-
|-
! scope="row" class="lbl def" | Defense:
! scope="row" class="spa" | Sp.&nbsp;Atk:
| class="num" | {{{Defense|N/A}}}
| {{{SpAtk|N/A}}}
| class="bar-cell" | <span class="bar def" style="width: {{#expr: min({{{Defense|0}}}, 255)}}px;"></span>
| style="width:{{#expr: {{{SpAtk|0}}} > 255 ? 255 : {{{SpAtk|0}}} }}px" |
|-
|-
! scope="row" class="lbl spa" | Sp.&nbsp;Atk:
! scope="row" class="spd" | Sp.&nbsp;Def:
| class="num" | {{{SpAtk|N/A}}}
| {{{SpDef|N/A}}}
| class="bar-cell" | <span class="bar spa" style="width: {{#expr: min({{{SpAtk|0}}}, 255)}}px;"></span>
| style="width:{{#expr: {{{SpDef|0}}} > 255 ? 255 : {{{SpDef|0}}} }}px" |
|-
|-
! scope="row" class="lbl spd" | Sp.&nbsp;Def:
! scope="row" class="spe" | Speed:
| class="num" | {{{SpDef|N/A}}}
| {{{Speed|N/A}}}
| class="bar-cell" | <span class="bar spd" style="width: {{#expr: min({{{SpDef|0}}}, 255)}}px;"></span>
| style="width:{{#expr: {{{Speed|0}}} > 255 ? 255 : {{{Speed|0}}} }}px" |
|-
! scope="row" class="lbl spe" | Speed:
| class="num" | {{{Speed|N/A}}}
| class="bar-cell" | <span class="bar spe" style="width: {{#expr: min({{{Speed|0}}}, 255)}}px;"></span>
|-
|-
! class="total" | Total:
! class="total" | Total:
| colspan="2" class="total-val" style="background:#{{{{{type|Normal}}} color light}};" |
| {{#if:{{{Total|}}}|{{{Total}}}|{{#expr:
  {{#if:{{{Total|}}}|{{{Total}}}|{{#expr: {{{HP|0}}}+{{{Attack|0}}}+{{{Defense|0}}}+{{{SpAtk|0}}}+{{{SpDef|0}}}+{{{Speed|0}}} }} }}
      ({{{HP|0}}}+
      ({{{Attack|0}}}) +
      ({{{Defense|0}}}) +
      ({{{SpAtk|0}}}) +
      ({{{SpDef|0}}}) +
      ({{{Speed|0}}})
}} }}
|}
|}
</templatemessagelocal>
<noinclude>
Adds a coloured Bulbapedia-style base-stat chart.
**Parameters**
* `HP Attack Defense SpAtk SpDef Speed` – numbers (or omit ⇒ “N/A”) 
* `Total` (optional) – total shown; if omitted it’s auto-calculated
</noinclude>

Revision as of 03:40, 19 May 2025

<templatemessagelocal>

HP: N/A
Attack: N/A
Defense: N/A
Sp. Atk: N/A
Sp. Def: N/A
Speed: N/A
Total: 0

</templatemessagelocal>

Adds a coloured Bulbapedia-style base-stat chart.

    • Parameters**
  • `HP Attack Defense SpAtk SpDef Speed` – numbers (or omit ⇒ “N/A”)
  • `Total` (optional) – total shown; if omitted it’s auto-calculated