Template:StatTable: Difference between revisions

From I-Pixelmon
Jump to navigation Jump to search
(Created page with "<includeonly> {| class="pkmn-stats" ! scope="row" class="hp" | HP: | {{HP}} | style="width:{{#expr: min({{HP}},255)}}px" | |- ! scope="row" class="atk" | Attack: | {{Attack}} | style="width:{{#expr: min({{Attack}},255)}}px" | |- ! scope="row" class="def" | Defense: | {{Defense}} | style="width:{{#expr: min({{Defense}},255)}}px" | |- ! scope="row" class="spa" | Sp. Atk: | {{SpAtk}} | style="width:{{#expr: min({{SpAtk}},255)}}px" | |- ! scope="row" class="spd" | Sp.&n...")
 
No edit summary
 
(53 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly>
<includeonly><templatestyles src="Template:StatTable/styles.css"/>
{| class="pkmn-stats"
<!-- table border colour can be overridden via |frame=#rrggbb -->
! scope="row" class="hp" | HP:
<div class="statbox">
| {{HP}}
<table style="border-color:{{{frame|#444}}}">
| style="width:{{#expr: min({{HP}},255)}}px" |
 
|-
<tr>
! scope="row" class="atk" | Attack:
<th class="hdr-stat" colspan="2" rowspan="2">Stat</th>
| {{Attack}}
<th class="hdr-range" colspan="2">Range</th>
| style="width:{{#expr: min({{Attack}},255)}}px" |
</tr>
|-
<tr>
! scope="row" class="def" | Defense:
<th class="hdr-sub">At Lv 50</th>
| {{Defense}}
<th class="hdr-sub">At Lv 100</th>
| style="width:{{#expr: min({{Defense}},255)}}px" |
</tr>
|-
 
! scope="row" class="spa" | Sp.&nbsp;Atk:
 
| {{SpAtk}}
<!-- HP -->
| style="width:{{#expr: min({{SpAtk}},255)}}px" |
<tr class="row-hp">
|-
<td class="lab">HP:<span class=statnumber>{{{HP}}}</span></td>
! scope="row" class="spd" | Sp.&nbsp;Def:
<td class="bar"><div class="fill" style="width:{{#expr: ( {{{HP|0}}} * 100 / 255 ) round 0}}%;"></div></td>
| {{SpDef}}
<td class="range"><small>{{#ifexpr:{{{HP}}}=1|1|{{#expr:((0+2*{{{HP}}}+(0/4))*50/100)+10+50}}}}–{{#ifexpr:{{{HP}}}=1|1|{{#expr:((31+2*{{{HP}}}+(252/4))*50/100)+10+50}}}}</small></td>
| style="width:{{#expr: min({{SpDef}},255)}}px" |
<td class="range"><small>{{#ifexpr:{{{HP}}}=1|1|{{#expr:((0+2*{{{HP}}}+(0/4))*100/100)+10+100}}}}–{{#ifexpr:{{{HP}}}=1|1|{{#expr:((31+2*{{{HP}}}+(252/4))*100/100)+10+100}}}}</small></td>
|-
 
! scope="row" class="spe" | Speed:
<!-- Attack -->
| {{Speed}}
<tr class="row-atk">
| style="width:{{#expr: min({{Speed}},255)}}px" |
<td class="lab">Attack:<span class=statnumber>{{{Attack}}}</span></td>
|-
<td class="bar"><div class="fill" style="width:{{#expr: ( {{{Attack|0}}} * 100 / 255 ) round 0}}%;"></div></td>
! class="total" | Total:
<td class="range"><small>{{#expr:floor((((0+2*{{{Attack}}}+(0/4))*50/100)+5)*0.9)}}–{{#expr:floor((((31+2*{{{Attack}}}+(252/4))*50/100)+5)*1.1)}}</small></td>
| {{#expr: {{HP}}+{{Attack}}+{{Defense}}+{{SpAtk}}+{{SpDef}}+{{Speed}} }}
<td class="range"><small>{{#expr:floor((((0+2*{{{Attack}}}+(0/4))*100/100)+5)*0.9)}}–{{#expr:floor((((31+2*{{{Attack}}}+(252/4))*100/100)+5)*1.1)}}</small></td>
|-
 
|}
</tr>
</includeonly><noinclude>
 
This template draws the Bulbapedia-style base–stat bar chart.  
<!-- Defense -->
Parameters: `HP Attack Defense SpAtk SpDef Speed`.
<tr class="row-def">
<td class="lab">Defense:<span class=statnumber>{{{Defense}}}</span></td>
<td class="bar"><div class="fill" style="width:{{#expr: ( {{{Defense|0}}} * 100 / 255 ) round 0}}%;"></div></td>
<td class="range"><small>{{#expr:floor((((0+2*{{{Defense}}}+(0/4))*50/100)+5)*0.9)}}–{{#expr:floor((((31+2*{{{Defense}}}+(252/4))*50/100)+5)*1.1)}}</small></td>
<td class="range"><small>{{#expr:floor((((0+2*{{{Defense}}}+(0/4))*100/100)+5)*0.9)}}–{{#expr:floor((((31+2*{{{Defense}}}+(252/4))*100/100)+5)*1.1)}}</small></td>
 
</tr>
 
<!-- Sp. Atk -->
<tr class="row-spa">
<td class="lab">Sp.&nbsp;Atk:<span span class=statnumber>{{{SpAtk}}}</span></td>
<td class="bar"><div class="fill" style="width:{{#expr: ( {{{SpAtk|0}}} * 100 / 255 ) round 0}}%;"></div></td>
<td class="range"><small>{{#expr:floor((((0+2*{{{SpAtk}}}+(0/4))*50/100)+5)*0.9)}}–{{#expr:floor((((31+2*{{{SpAtk}}}+(252/4))*50/100)+5)*1.1)}}</small></td>
<td class="range"><small>{{#expr:floor((((0+2*{{{SpAtk}}}+(0/4))*100/100)+5)*0.9)}}–{{#expr:floor((((31+2*{{{SpAtk}}}+(252/4))*100/100)+5)*1.1)}}</small></td>
</tr>
 
<!-- Sp. Def -->
<tr class="row-spd">
<td class="lab">Sp.&nbsp;Def:<span class=statnumber>{{{SpDef}}}</span></td>
<td class="bar"><div class="fill" style="width:{{#expr: ( {{{SpDef|0}}} * 100 / 255 ) round 0}}%;"></div></td>
<td class="range"><small>{{#expr:floor((((0+2*{{{SpDef}}}+(0/4))*50/100)+5)*0.9)}}–{{#expr:floor((((31+2*{{{SpDef}}}+(252/4))*50/100)+5)*1.1)}}</small></td>
<td class="range"><small>{{#expr:floor((((0+2*{{{SpDef}}}+(0/4))*100/100)+5)*0.9)}}–{{#expr:floor((((31+2*{{{SpDef}}}+(252/4))*100/100)+5)*1.1)}}</small></td>
 
</tr>
 
<!-- Speed -->
<tr class="row-spe">
<td class="lab">Speed:<span class=statnumber>{{{Speed}}}</span></td>
<td class="bar"><div class="fill" style="width:{{#expr: ( {{{Speed|0}}} * 100 / 255 ) round 0}}%;"></div></td>
<td class="range"><small>{{#expr:floor((((0+2*{{{Speed}}}+(0/4))*50/100)+5)*0.9)}}–{{#expr:floor((((31+2*{{{Speed}}}+(252/4))*50/100)+5)*1.1)}}</small></td>
<td class="range"><small>{{#expr:floor((((0+2*{{{Speed}}}+(0/4))*100/100)+5)*0.9)}}–{{#expr:floor((((31+2*{{{Speed}}}+(252/4))*100/100)+5)*1.1)}}</small></td>
 
</tr>
 
<!-- Total (no bar) -->
<tr class="total">
<td class="lab">Total:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span>{{#expr:{{{HP}}}+{{{Attack}}}+{{{Defense}}}+{{{SpAtk}}}+{{{SpDef}}}+{{{Speed}}}}}</span></td>
<td class="bar"></td>
</tr>
 
</table>
</div></includeonly><noinclude>
<pre>{{StatTable
  |HP=80 |Attack=82 |Defense=83 |SpAtk=100 |SpDef=100 |Speed=80
}}</pre>
{{StatTable|type=Dragon|HP=105|Attack=150|Defense=90|SpAtk=150|SpDef=90|Speed=95|Total=680}}
{{StatTable|type=Normal|HP=105|Attack=180|Defense=100|SpAtk=180|SpDef=100|Speed=115|Total=780}}
{{StatTable|type=Normal|HP=10|Attack=10|Defense=10|SpAtk=10|SpDef=10|Speed=10|Total=10}}
[[Category:Template documentation]]
</noinclude>
</noinclude>

Latest revision as of 05:13, 2 June 2025

{{StatTable
 |HP=80 |Attack=82 |Defense=83 |SpAtk=100 |SpDef=100 |Speed=80
}}
Stat Range
At Lv 50 At Lv 100
HP:105
165–212 320–414
Attack:150
139–222 274–438
Defense:90
85–156 166–306
Sp. Atk:150
139–222 274–438
Sp. Def:90
85–156 166–306
Speed:95
90–161 175–317
Total:     680
Stat Range
At Lv 50 At Lv 100
HP:105
165–212 320–414
Attack:180
166–255 328–504
Defense:100
94–167 184–328
Sp. Atk:180
166–255 328–504
Sp. Def:100
94–167 184–328
Speed:115
108–183 211–361
Total:     780
Stat Range
At Lv 50 At Lv 100
HP:10
70–117 130–224
Attack:10
13–68 22–130
Defense:10
13–68 22–130
Sp. Atk:10
13–68 22–130
Sp. Def:10
13–68 22–130
Speed:10
13–68 22–130
Total:     60