Template:Resource: Difference between revisions
(Corrected type: bardic inspriation) |
HiddenDragon (talk | contribs) (Use new arcane resource image file) |
||
(32 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
<includeonly | <includeonly>{{trim| | ||
{{#lvardef: type | UNDEFINED }} | |||
{{#lvardef: icon | Alert Icon.png }} | |||
{{#lvardef: isplural | 0 }} | |||
{{#lvardef: icononly | 0 }} | |||
{{#lvardef: nameonly | 0 }} | |||
{{#lvardef: count | 1 }} | |||
{| | |||
{{#if: {{{type|}}} | |||
| {{#lvardef: type | {{{type|}}} }} | |||
| | | {{#if: {{{1|}}} | {{#lvardef: type | {{{1}}} }} }} | ||
| {{ | }} | ||
| | |||
| | {{#if: {{{count|}}} | ||
| {{ | | {{#lvardef: count | {{{count|}}} }} | ||
| {{#if: {{{2|}}} | {{#lvardef: count | {{{2|}}} }} }} | |||
| | }} | ||
| {{ | |||
| | {{#ifexpr: {{#lvar: count}} > 1 | {{#lvardef: isplural | 1 }} }} | ||
| | |||
| {{ | <!--there may be special cases where you want to have plural forms without a count (i.e. explanations)--> | ||
| < | {{#if: {{{forceplural|}}} | ||
| | | {{#ifeq: {{{forceplural|}}} | yes | {{#lvardef:isplural|1}} | {{#lvardef:isplural|0}} }} | ||
| {{ | }} | ||
| | |||
| | <!-- lc is to make the input all lower case, so that case is not my biggest priority --> | ||
| {{ | {{#switch: {{lc: {{#lvar:type}} }} | ||
| | |||
| | | action = | ||
| {{ | {{#lvardef: type | {{#if: {{{nameonly|}}}|Action|[[Action]]}}{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }} | ||
| | {{#lvardef: icon | Action Icon.png }} | ||
| | |||
| {{ | | bonus | ba | bonus action = | ||
| | {{#lvardef: type | {{#if: {{{nameonly|}}}|Bonus action|[[Bonus action]]}}{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }} | ||
| | {{#lvardef: icon | Bonus Action Icon.png }} | ||
| | |||
| | | reaction = | ||
| | {{#lvardef: type | {{#if: {{{nameonly|}}}|Reaction|[[Reaction]]}}{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }} | ||
| | {{#lvardef: icon | Reaction Icon.png }} | ||
| | |||
| | | movement = | ||
| | {{#lvardef: type | {{#if: {{{nameonly|}}}|Movement|[[Movement speed|Movement]]}} }} | ||
| | {{#lvardef: icon | Movement Speed Icon.png }} | ||
| | {{#if: {{{count|}}} {{{2|}}} | ||
| {{ | | {{#lvardef: count | {{color|red|(ERROR: Use <code>movement m</code> or <code>movement ft</code>.)}} }} | ||
| < | [[Category:Pages with errors]] | ||
| | }} | ||
| {{Resource | type | |||
| | | movement m = | ||
| | {{#lvardef: type | {{#if: {{{nameonly|}}}|Movement|[[Movement speed|Movement]]}} }} | ||
| | {{#lvardef: icon | Movement Speed Icon.png }} | ||
| < | {{#if: {{{count|}}} | ||
| {{#lvardef: count | {{Distance | m = {{{count|}}} }} }} | |||
| {{#if: {{{2|}}} | {{#lvardef: count | {{Distance | m = {{{2|}}} }} }} }} | |||
}} | |||
| movement ft = | |||
{{#lvardef: type | {{#if: {{{nameonly|}}}|Movement|[[Movement speed|Movement]]}} }} | |||
{{#lvardef: icon | Movement Speed Icon.png }} | |||
<!-- Backwards compatibility only; this isn't meant to be used with a value --> | |||
{{#if: {{{count|}}} | |||
| {{#lvardef: count | {{Distance | ft = {{{count|}}} }} }} | |||
| {{#if: {{{2|}}} | {{#lvardef: count | {{Distance | ft = {{{2|}}} }} }} }} | |||
}} | |||
| half movement = | |||
{{#lvardef: type | {{#if: {{{nameonly|}}}|Movement (Half cost)|[[Movement speed|Movement]] (Half cost)}} }} | |||
{{#lvardef: icon | Movement Speed Icon.png }} | |||
| sd | supdie | superiority die = | |||
{{#lvardef: type | Superiority {{#ifexpr: {{#lvar: isplural}} > 0 |Dice|Die}} }} | |||
{{#lvardef: icon | Superiority Die d8 Icon.png }} | |||
| fi | fnginf | fungal infestation = | |||
{{#lvardef: type |Fungal Infestation Charge{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }} | |||
{{#lvardef: icon | Fungal Infestation Charge Icon.png }} | |||
| ki = | |||
{{#lvardef: type | Ki Point{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }} | |||
{{#lvardef: icon | Monk Ki Icon.png }} | |||
| ws | wldshp | wild shape | wildshape = | |||
{{#lvardef: type | Wild Shape Charge{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }} | |||
{{#lvardef: icon | Wild Shape Charges Icon.png | |||
}} | |||
| spell1 | s1 | level1 | l1 = | |||
{{#lvardef: type | Level 1 Spell Slot{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }} | |||
{{#lvardef: icon | Spell Slot Icon.png }} | |||
| spell2 | s2 | level2 | l2 = | |||
{{#lvardef: type | Level 2 Spell Slot{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }} | |||
{{#lvardef: icon | Spell Slot Icon.png }} | |||
| spell3 | s3 | level3 | l3 = | |||
{{#lvardef: type | Level 3 Spell Slot{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }} | |||
{{#lvardef: icon | Spell Slot Icon.png }} | |||
| spell4 | s4 | level4 | l4 = | |||
{{#lvardef: type | Level 4 Spell Slot{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }} | |||
{{#lvardef: icon | Spell Slot Icon.png }} | |||
| spell5 | s5 | level5 | l5 = | |||
{{#lvardef: type | Level 5 Spell Slot{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }} | |||
{{#lvardef: icon | Spell Slot Icon.png }} | |||
| spell6 | s6 | level6 | l6 = | |||
{{#lvardef: type | Level 6 Spell Slot{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }} | |||
{{#lvardef: icon | Spell Slot Icon.png }} | |||
| ar | arcrec | arcane recovery = | |||
{{#lvardef: type | Arcane Recovery Charge{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }} | |||
{{#lvardef: icon | Arcane Recovery Charges Icons.png }} | |||
| bi | bardin | bardic inspiration = | |||
{{#lvardef: type | Bardic Inspiration Charge{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }} | |||
{{#lvardef: icon | Bardic Inspiration Resource Icon.png }} | |||
| cd | chadiv | channel divinity = | |||
{{#lvardef: type | Channel Divinity Charge{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }} | |||
{{#lvardef: icon | Channel Divinity Charges Icons.png }} | |||
| co | chaoat | channel oath = | |||
{{#lvardef: type | Channel Oath Charge{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }} | |||
{{#lvardef: icon | Channel Oath Icon.png }} | |||
| rg | rage = | |||
{{#lvardef: type | Rage Charge{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }} | |||
{{#lvardef: icon | Rage Charges Icons.png }} | |||
| sp | srcpnt | sorcery = | |||
{{#lvardef: type | Sorcery Point{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }} | |||
{{#lvardef: icon | Sorcery Points Icons.png }} | |||
| wp | warpri | war priest = | |||
{{#lvardef: type | War Priest Charge{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }} | |||
{{#lvardef: icon | War Priest Charges Icon.png}} | |||
| lh | layonh | lay on hands = | |||
{{#lvardef: type | Lay on Hands Charge{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }} | |||
{{#lvardef: icon | Lay on Hands Resource Icon.png }} | |||
| nr | natrec | natural recovery = | |||
{{#lvardef: type | Natural Recovery Charge{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }} | |||
{{#lvardef: icon | Natural Recovery Charges Icon.png }} | |||
| toc | tides of chaos = | |||
{{#lvardef: type | Tides of Chaos Charge{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }} | |||
{{#lvardef: icon | Tides of Chaos Resource Icon.png }} | |||
| lp | luck | lukpnt | luck point = | |||
{{#lvardef: type | Luck Point{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }} | |||
{{#lvardef: icon | Luck Point Resource Icon.png }} | |||
| es | eyestalk | eyestalk action = | |||
{{#lvardef: type | Eyestalk Action{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }} | |||
{{#lvardef: icon | Eyestalk Action Icon.png }} | |||
| shadowspell3 | ss3 | shadowlevel3 | sl3 = | |||
{{#lvardef: type | Level 3 Shadow Spell Slot{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }} | |||
{{#lvardef: icon | Shadow Spell Slot Icon.png }} | |||
| arcane arrow | arcarr | aa = | |||
{{#lvardef: type | Arcane Arrow{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }} | |||
{{#lvardef: icon | Arcane Arrow Resource Icon.png }} <!-- TODO: Update this icon when patch releases --> | |||
| bladesong power | bladesong | bsp = | |||
{{#lvardef: type | Bladesong Power}} | |||
{{#lvardef: icon | Bladesong Resource Icon.png }} <!-- TODO: Update this icon when patch releases --> | |||
| cosmic omen | cosmic | cos = | |||
{{#lvardef: type | Cosmic Omen{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }} | |||
{{#lvardef: icon | Cosmic Omen Resource Icon.png }} | |||
| star map | starmap | sm = | |||
{{#lvardef: type | Star Map{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }} | |||
{{#lvardef: icon | Star Map Resource Icon.png }} | |||
| writhing current | writhing | wc = | |||
{{#lvardef: type | Writhing Current{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }} | |||
{{#lvardef: icon | Writhing Current Resource Icon.png }} | |||
| #default = | |||
{{Main namespace only|[[Category:Pages with unknown resources]]}} | |||
<!-- end switch --> | |||
}} | |||
<!-- end trim (variable definitions) --> | |||
}}{{#ifexpr: {{#lvar: isplural}} > 0 | |||
| {{#if: {{{forceplural|}}} | | {{#lvar: count}} }} | |||
}}{{#if: {{{nameonly|}}} | |||
| {{Nbts}} | |||
| {{SmallIcon | {{#lvar:icon}} }} | |||
}}{{#if: {{{icononly|}}} | |||
| <!-- blank --> | |||
| {{nbts}}{{#lvar: type}} | |||
}}</includeonly><noinclude>{{Documentation}} | |||
[[Category:Templates]] | |||
[[Category:Icon templates]] | |||
[[Category:Link templates]] | |||
</noinclude> | </noinclude> |
Latest revision as of 18:54, 4 February 2025
- {{r}}
Display action resources, including specific class resources, in a standardized and consistent format. This template is intended to be inline.
- Usage
{{Resource | <type> | [count] | [icononly] | [nameonly] | [forceplural]}}
< ... >
denotes mandatory parameters and[ ... ]
denotes optional parameters.
Refer to the table below for all the supported resource types and their aliases.
Supported resources
Below is a table of all the resource options this template accepts as well as their aliases. This should cover all the resources in the game.
Resource | Input |
---|---|
![]() |
action
|
![]() |
bonus, bonus action, ba
|
![]() |
reaction
|
![]() |
movement (no value)
|
![]() |
movement m (value in meters)
|
![]() |
movement ft (value in feet)
|
![]() |
half movement
|
![]() |
aa, arcarr, arcane arrow
|
![]() |
ar, arcrec, arcane recovery
|
![]() |
bi, bardin, bardic inspiration
|
![]() |
bsp, bladesong, bladesong power
|
![]() |
cd, chadiv, channel divinity
|
![]() |
co, chaoat, channel oath
|
![]() |
cos, cosmic, cosmic omen
|
![]() |
fi, fnginf, fungal infestation
|
![]() |
ki
|
![]() |
l1, s1, spell1, level1
|
![]() |
l2, s2, spell2, level2
|
![]() |
l3, s3, spell3, level3
|
![]() |
l4, s4, spell4, level4
|
![]() |
l5, s5, spell5, level5
|
![]() |
l6, s6, spell6, level6
|
![]() |
shadowspell3, ss3, shadowlevel3, sl3
|
![]() |
lh, layonh, lay on hands
|
![]() |
nr, natrec, natural recovery
|
![]() |
rg, rage
|
![]() |
sp, srcpnt, sorcery
|
![]() |
sm, star map, star maps
|
![]() |
sd, supdie, superiority die
|
![]() |
wp, warpri, war priest
|
![]() |
ws, wldshp, wild shape, wildshape
|
![]() |
toc, tides of chaos
|
![]() |
lp, lukpnt, luck, luck point
|
![]() |
wc, writhing, writhing current
|
Examples
Markup | Renders as |
---|---|
{{Resource | invalid}} | ![]() |
{{Resource}} | ![]() |
{{Resource | supdie}} | ![]() |
{{Resource | SuPdIe | 2}} | 2![]() |
{{Resource | supdie| forceplural=yes}} | ![]() |
{{Resource | ki | count = 200}} | 200![]() |
{{Resource | lh | icononly = yes}} | ![]() |
{{Resource | movement m | count = 1.5}} | ![]() ![]() |
Costs: {{Resource | ki | count = 2 | icononly = yes}} | Costs: 2![]() |
Costs: {{Resource | l2 | count = 2 | nameonly = yes}} | Costs: 2 Level 2 Spell Slots |
Recover half of your max {{Resource | ki | forceplural = yes}}, once per short rest. | Recover half of your max ![]() |
{{Resource | type = ar | 1 | forceplural = yes}} | ![]() |
{{Resource | type = shadowspell3 | 1 }} | ![]() |
{{Resource | type = eyestalk | 1 }} | ![]() |
{{r|reaction}}s | ![]() |
Template data
Display an action resource with its accompanying icon.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Type | 1 type | The name of the resource. For shorter aliases for these options, refer to the full list on the template page.
| String | required |
Count | 2 count | The number of the specified resources consumed.
| String | optional |
Name only | nameonly | Hide the resource icon leaving just the name of resource and the count. | Boolean | optional |
Icon only | icononly | Hide the resource name leaving just the resource icon and the count. | Boolean | optional |
Force plural | forceplural | Force the output use the plural form even when count is 1. | Boolean | optional |