Template:Stat Block: Difference between revisions
Jump to navigation
Jump to search
Create 5e stat block template with inline CSS — no stylesheet dependency |
Rewrite template without ParserFunctions — use only core MediaWiki syntax |
||
| Line 26: | Line 26: | ||
<div style="padding: 4px 12px 6px 12px; border-bottom: 1px solid #822b24; font-size: 0.9em; color: #822b24;"> | <div style="padding: 4px 12px 6px 12px; border-bottom: 1px solid #822b24; font-size: 0.9em; color: #822b24;"> | ||
<b>Armor Class</b> {{{ac|—}}}<br> | <b>Armor Class</b> {{{ac|—}}}<br> | ||
<b>Hit Points</b> {{{hp|—}}} | <b>Hit Points</b> {{{hp|—}}}<br> | ||
<b>Speed</b> {{{speed|—}}} | <b>Speed</b> {{{speed|—}}} | ||
</div> | </div> | ||
| Line 41: | Line 39: | ||
font-size: 0.85em; | font-size: 0.85em; | ||
"> | "> | ||
<div><b>STR</b><br>{{{str|10}}} | <div><b>STR</b><br>{{{str|10}}}<br><small>{{{strmod|+0}}}</small></div> | ||
<div><b>DEX</b><br>{{{dex|10}}}<br><small>{{{dexmod|+0}}}</small></div> | |||
<div><b>CON</b><br>{{{con|10}}}<br><small>{{{conmod|+0}}}</small></div> | |||
<div><b>DEX</b><br>{{{dex|10}}} | <div><b>INT</b><br>{{{int|10}}}<br><small>{{{intmod|+0}}}</small></div> | ||
<div><b>WIS</b><br>{{{wis|10}}}<br><small>{{{wismod|+0}}}</small></div> | |||
<div><b>CHA</b><br>{{{cha|10}}}<br><small>{{{chamod|+0}}}</small></div> | |||
<div><b>CON</b><br>{{{con|10}}} | |||
<div><b>INT</b><br>{{{int|10}}} | |||
<div><b>WIS</b><br>{{{wis|10}}} | |||
<div><b>CHA</b><br>{{{cha|10}}} | |||
</div> | </div> | ||
<!-- Secondary stats --> | <!-- Secondary stats --> | ||
<div style="padding: 4px 12px 4px 12px; border-bottom: 1px solid #822b24; font-size: 0.9em; color: #333;"> | <div style="padding: 4px 12px 4px 12px; border-bottom: 1px solid #822b24; font-size: 0.9em; color: #333;"> | ||
<b>Saving Throws</b> {{{saves|—}}}<br> | |||
<b>Skills</b> {{{skills|—}}}<br> | |||
<b>Senses</b> {{{senses|—}}} | |||
<b>Senses</b> {{{senses|—} | |||
</div> | </div> | ||
<!-- Features / Traits --> | <!-- Features / Traits --> | ||
<div style="padding: 6px 12px; border-bottom: 1px solid #822b24; font-size: 0.9em;"> | |||
{{{traits|}}} | {{{traits|}}} | ||
</div> | |||
<!-- Actions --> | <!-- Actions --> | ||
<div style="padding: 6px 12px; border-bottom: 1px solid #822b24; font-size: 0.9em;"> | |||
<div style="color: #822b24; font-weight: bold; font-size: 1.1em; border-bottom: 1px dotted #822b24; margin-bottom: 4px;">Actions</div> | <div style="color: #822b24; font-weight: bold; font-size: 1.1em; border-bottom: 1px dotted #822b24; margin-bottom: 4px;">Actions</div> | ||
{{{actions|}}} | {{{actions|}}} | ||
</div> | |||
<!-- Bonus Actions --> | <!-- Bonus Actions --> | ||
<div style="padding: 6px 12px; border-bottom: 1px solid #822b24; font-size: 0.9em;"> | |||
<div style="color: #822b24; font-weight: bold; font-size: 1.1em; border-bottom: 1px dotted #822b24; margin-bottom: 4px;">Bonus Actions</div> | <div style="color: #822b24; font-weight: bold; font-size: 1.1em; border-bottom: 1px dotted #822b24; margin-bottom: 4px;">Bonus Actions</div> | ||
{{{bonus_actions|}}} | {{{bonus_actions|}}} | ||
</div> | |||
<!-- Reactions --> | <!-- Reactions --> | ||
<div style="padding: 6px 12px; border-bottom: 1px solid #822b24; font-size: 0.9em;"> | |||
<div style="color: #822b24; font-weight: bold; font-size: 1.1em; border-bottom: 1px dotted #822b24; margin-bottom: 4px;">Reactions</div> | <div style="color: #822b24; font-weight: bold; font-size: 1.1em; border-bottom: 1px dotted #822b24; margin-bottom: 4px;">Reactions</div> | ||
{{{reactions|}}} | {{{reactions|}}} | ||
</div> | |||
<!-- Legendary Actions --> | <!-- Legendary Actions --> | ||
<div style="padding: 6px 12px; border-bottom: 1px solid #822b24; font-size: 0.9em;"> | |||
<div style="color: #822b24; font-weight: bold; font-size: 1.1em; border-bottom: 1px dotted #822b24; margin-bottom: 4px;">Legendary Actions</div> | <div style="color: #822b24; font-weight: bold; font-size: 1.1em; border-bottom: 1px dotted #822b24; margin-bottom: 4px;">Legendary Actions</div> | ||
{{{legendary|}}} | {{{legendary|}}} | ||
</div> | |||
<!-- Freeform blocks | <!-- Freeform blocks --> | ||
<div style="padding: 6px 12px; font-size: 0.9em; color: #333;"> | |||
{{{block1|}}} | {{{block1|}}} | ||
</div> | |||
<div style="padding: 6px 12px; font-size: 0.9em; color: #333; border-top: 1px solid #822b24;"> | |||
{{{block2|}}} | {{{block2|}}} | ||
</div> | |||
<!-- Footer --> | <!-- Footer --> | ||
| Line 130: | Line 96: | ||
</includeonly><noinclude> | </includeonly><noinclude> | ||
== 5e Stat Block Template == | == 5e Stat Block Template == | ||
Produces a D&D 5e-style stat block using inline CSS | Produces a D&D 5e-style stat block using inline CSS. No extensions required — works on any MediaWiki install. | ||
=== Parameters === | === Parameters === | ||
All parameters are optional except `name`. | All parameters are optional except `name`. Modifier parameters must be entered manually (e.g., `strmod=+4`). | ||
= | {| class="wikitable" | ||
! Parameter !! Description !! Example | |||
|- | |||
| name | | `name` || Creature name || Vex Ironjaw | ||
| ac | |- | ||
| hp | | `ac` || Armor Class || 20 (plate, shield) | ||
| speed | |- | ||
| str | | `hp` || Hit Points || 84 (7d10+21) | ||
| saves | |- | ||
| skills | | `speed` || Speed || 25 ft | ||
| senses | |- | ||
| actions | | `str` / `strmod` || STR score / modifier || 18 / +4 | ||
|- | |||
| `dex` / `dexmod` || DEX score / modifier || 10 / +0 | |||
| | |- | ||
| `con` / `conmod` || CON score / modifier || 16 / +3 | |||
} | |- | ||
| `int` / `intmod` || INT score / modifier || 10 / +0 | |||
|- | |||
| `wis` / `wismod` || WIS score / modifier || 14 / +2 | |||
|- | |||
| `cha` / `chamod` || CHA score / modifier || 8 / -1 | |||
|- | |||
| `saves` || Saving throw bonuses || STR +7, CON +6 | |||
|- | |||
| `skills` || Skill bonuses || Athletics +7, Perception +5 | |||
|- | |||
| `senses` || Senses || Darkvision 60 ft, passive Perception 15 | |||
|- | |||
| `traits` || Special traits (freeform wikitext) || '''Sentinel.''' When Vex hits... | |||
|- | |||
| `actions` || Actions section || '''Multiattack.''' Two warhammer attacks. | |||
|- | |||
| `bonus_actions` || Bonus actions section || '''Second Wind.''' Regain 1d10+7 HP. | |||
|- | |||
| `reactions` || Reactions section || '''Protection.''' Impose disadvantage... | |||
|- | |||
| `legendary` || Legendary actions section || '''Detect.''' The creature makes... | |||
|- | |||
| `block1` || Extra freeform block (below legendary) || Spellcasting or class features | |||
|- | |||
| `block2` || Extra freeform block (bottom) || Upgrade paths or notes | |||
|} | |||
=== Notes === | === Notes === | ||
* Uses only inline CSS — | * Uses only inline CSS — no `MediaWiki:Common.css` or ParserFunctions extension required. | ||
* All sections always render their headers. If a section is empty, it shows as a bare header with no content — this is intentional to keep the template simple. | |||
* All sections | * Modifier values must be entered manually with sign (e.g., `+4`, `-1`, `+0`). There is no auto-calculation. | ||
* | |||
* The template is compact (max-width 420px) and can sit inline alongside prose. | * The template is compact (max-width 420px) and can sit inline alongside prose. | ||
[[Category:Templates]] [[Category:Combat Reference]] | [[Category:Templates]] [[Category:Combat Reference]] | ||
</noinclude> | </noinclude> | ||
Latest revision as of 00:44, 27 June 2026
5e Stat Block Template
Produces a D&D 5e-style stat block using inline CSS. No extensions required — works on any MediaWiki install.
Parameters
All parameters are optional except `name`. Modifier parameters must be entered manually (e.g., `strmod=+4`).
| Parameter | Description | Example |
|---|---|---|
| `name` | Creature name | Vex Ironjaw |
| `ac` | Armor Class | 20 (plate, shield) |
| `hp` | Hit Points | 84 (7d10+21) |
| `speed` | Speed | 25 ft |
| `str` / `strmod` | STR score / modifier | 18 / +4 |
| `dex` / `dexmod` | DEX score / modifier | 10 / +0 |
| `con` / `conmod` | CON score / modifier | 16 / +3 |
| `int` / `intmod` | INT score / modifier | 10 / +0 |
| `wis` / `wismod` | WIS score / modifier | 14 / +2 |
| `cha` / `chamod` | CHA score / modifier | 8 / -1 |
| `saves` | Saving throw bonuses | STR +7, CON +6 |
| `skills` | Skill bonuses | Athletics +7, Perception +5 |
| `senses` | Senses | Darkvision 60 ft, passive Perception 15 |
| `traits` | Special traits (freeform wikitext) | Sentinel. When Vex hits... |
| `actions` | Actions section | Multiattack. Two warhammer attacks. |
| `bonus_actions` | Bonus actions section | Second Wind. Regain 1d10+7 HP. |
| `reactions` | Reactions section | Protection. Impose disadvantage... |
| `legendary` | Legendary actions section | Detect. The creature makes... |
| `block1` | Extra freeform block (below legendary) | Spellcasting or class features |
| `block2` | Extra freeform block (bottom) | Upgrade paths or notes |
Notes
- Uses only inline CSS — no `MediaWiki:Common.css` or ParserFunctions extension required.
- All sections always render their headers. If a section is empty, it shows as a bare header with no content — this is intentional to keep the template simple.
- Modifier values must be entered manually with sign (e.g., `+4`, `-1`, `+0`). There is no auto-calculation.
- The template is compact (max-width 420px) and can sit inline alongside prose.