Template:Resource: Difference between revisions
(Further cleanup.) |
(Added a few more resource aliases) |
||
(7 intermediate revisions by 2 users not shown) | |||
Line 33: | Line 33: | ||
{{#lvardef: icon | Action Icon.png }} | {{#lvardef: icon | Action Icon.png }} | ||
| bonus = | | bonus | ba | bonus action = | ||
{{#lvardef: type | {{#if: {{{nameonly|}}}|Bonus action|[[Bonus action]]}}{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }} | {{#lvardef: type | {{#if: {{{nameonly|}}}|Bonus action|[[Bonus action]]}}{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }} | ||
{{#lvardef: icon | Bonus Action Icon.png }} | {{#lvardef: icon | Bonus Action Icon.png }} | ||
Line 74: | Line 74: | ||
{{#lvardef: icon | Superiority Die d8 Icon.png }} | {{#lvardef: icon | Superiority Die d8 Icon.png }} | ||
| fi | fnginf = | | fi | fnginf | fungal infestation = | ||
{{#lvardef: type |Fungal Infestation Charge{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }} | {{#lvardef: type |Fungal Infestation Charge{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }} | ||
{{#lvardef: icon | Fungal Infestation Charge Icon.png }} | {{#lvardef: icon | Fungal Infestation Charge Icon.png }} | ||
Line 82: | Line 82: | ||
{{#lvardef: icon | Monk Ki Icon.png }} | {{#lvardef: icon | Monk Ki Icon.png }} | ||
| ws | wldshp | wild shape = | | ws | wldshp | wild shape | wildshape = | ||
{{#lvardef: type | Wild Shape Charge{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }} | {{#lvardef: type | Wild Shape Charge{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }} | ||
{{#lvardef: icon | Wild Shape Charges Icon.png | {{#lvardef: icon | Wild Shape Charges Icon.png | ||
Line 151: | Line 151: | ||
{{#lvardef: icon | Tides of Chaos Resource Icon.png }} | {{#lvardef: icon | Tides of Chaos Resource Icon.png }} | ||
| lp | lukpnt | luck point = | | lp | luck | lukpnt | luck point = | ||
{{#lvardef: type | Luck Point{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }} | {{#lvardef: type | Luck Point{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }} | ||
{{#lvardef: icon | Luck Point Resource Icon.png }} | {{#lvardef: icon | Luck Point Resource Icon.png }} | ||
Line 164: | Line 164: | ||
| #default = | | #default = | ||
[[Category:Pages with unknown resources]] | {{Main namespace only|[[Category:Pages with unknown resources]]}} | ||
<!-- end switch --> | <!-- end switch --> | ||
Line 170: | Line 170: | ||
<!-- end trim (variable definitions) --> | <!-- end trim (variable definitions) --> | ||
}} | }}{{#ifexpr: {{#lvar: isplural}} > 0 | ||
| {{#if: {{{forceplural|}}} | | {{#lvar: count}} }} | | {{#if: {{{forceplural|}}} | | {{#lvar: count}} }} | ||
}}{{#if: {{{nameonly|}}} | }}{{#if: {{{nameonly|}}} | ||
Line 178: | Line 178: | ||
| <!-- blank --> | | <!-- blank --> | ||
| {{#lvar: type}} | | {{#lvar: type}} | ||
}} | }}</includeonly><noinclude> | ||
{{Shortcut|r}} | |||
Display action resources, including specific class resources, in a standardized and consistent format. This template is intended to be inline. | |||
Refer to the table below for all the supported resource types and their aliases. | |||
== | == Template data == | ||
< | ; Usage | ||
: {{c|<nowiki>{{Resource | <type> | [count] | [icononly] | [nameonly] | [forceplural]}}</nowiki>}} | |||
< | : {{c|< ... >}} denotes mandatory parameters and {{c|[ ... ]}} denotes optional parameters. | ||
<templatedata> | |||
{ | |||
"description": "Display an action resource with its accompanying icon.", | |||
"format": "inline", | |||
"params": { | |||
"1": { | |||
"label": "Type", | |||
"aliases": ["type"], | |||
"description": "The name of the resource. For shorter aliases for these options, refer to the full list on the template page.", | |||
"suggestedvalues": ["action", "bonus", "reaction", "movement", "movement m", "spell1", "spell2", "spell3", "spell4", "spell5", "spell6", "arcane recovery", "bardic inspiration", "channel divinity", "channel oath", "fungal infestation", "ki", "lay on hands", "luck point", "natural recovery", "rage", "shadowspell3", "sorcery", "superiority die", "tides of chaos", "war priest", "wild shape"], | |||
"type": "string", | |||
"required": true | |||
}, | |||
"2": { | |||
"label": "Count", | |||
"aliases": ["count"], | |||
"description": "The number of the specified resources consumed.", | |||
"default": "1", | |||
"type": "string", | |||
== | "required": false | ||
}, | |||
"nameonly": { | |||
"label": "Name only", | |||
"description": "Hide the resource icon leaving just the name of resource and the count.", | |||
"type": "boolean" | |||
}, | |||
"icononly": { | |||
"label": "Icon only", | |||
"description": "Hide the resource name leaving just the resource icon and the count.", | |||
"type": "boolean" | |||
}, | |||
"forceplural": { | |||
"label": "Force plural", | |||
"description": "Force the output use the plural form even when count is 1.", | |||
"type": "boolean" | |||
} | |||
} | |||
} | |||
</templatedata> | |||
== 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. | |||
{| class="wikitable mw-collapsible" | {| class="wikitable mw-collapsible" | ||
|+ name parameter | |+ name parameter | ||
Line 216: | Line 239: | ||
|- | |- | ||
| {{Resource|bonus|forceplural=yes}} | | {{Resource|bonus|forceplural=yes}} | ||
| {{C|bonus}} | | {{C|bonus, bonus action, ba}} | ||
|- | |- | ||
| {{Resource|reaction|forceplural=yes}} | | {{Resource|reaction|forceplural=yes}} | ||
Line 247: | Line 270: | ||
|- | |- | ||
| {{Resource|fi|forceplural=yes}} | | {{Resource|fi|forceplural=yes}} | ||
| {{C|fi, fnginf}} | | {{C|fi, fnginf, fungal infestation}} | ||
|- | |- | ||
| {{Resource|ki|forceplural=yes}} | | {{Resource|ki|forceplural=yes}} | ||
Line 269: | Line 292: | ||
| {{Resource|l6|forceplural=yes}} | | {{Resource|l6|forceplural=yes}} | ||
| {{C|l6, s6, spell6, level6}} | | {{C|l6, s6, spell6, level6}} | ||
|- | |||
| {{Resource|shadowlevel3|forceplural=yes}} | |||
| {{C|shadowspell3, ss3, shadowlevel3, sl3}} | |||
|- | |- | ||
| {{Resource|lh|forceplural=yes}} | | {{Resource|lh|forceplural=yes}} | ||
Line 289: | Line 315: | ||
|- | |- | ||
| {{Resource|ws|forceplural=yes}} | | {{Resource|ws|forceplural=yes}} | ||
| {{C|ws, wldshp, wild shape}} | | {{C|ws, wldshp, wild shape, wildshape}} | ||
|- | |- | ||
| {{Resource|toc|forceplural=yes}} | | {{Resource|toc|forceplural=yes}} | ||
Line 295: | Line 321: | ||
|- | |- | ||
| {{Resource|lp|forceplural=yes}} | | {{Resource|lp|forceplural=yes}} | ||
| {{C|lp, lukpnt, luck point}} | | {{C|lp, lukpnt, luck, luck point}} | ||
|} | |} | ||
=Examples= | ==Examples== | ||
{{Template demo | |||
| style = table | |||
| <nowiki>{{Resource | invalid}}</nowiki> | |||
| <nowiki>{{Resource}}</nowiki> | |||
| <nowiki>{{Resource | supdie}}</nowiki> | |||
| < | | <nowiki>{{Resource | SuPdIe | 2}}</nowiki> | ||
| <nowiki>{{Resource | supdie| forceplural=yes}}</nowiki> | |||
| <nowiki>{{Resource | ki | count = 200}}</nowiki> | |||
| < | | <nowiki>{{Resource | lh | icononly = yes}}</nowiki> | ||
| <nowiki>{{Resource | movement m | count = 1.5}}</nowiki> | |||
| <nowiki>Costs: {{Resource | ki | count = 2 | icononly = yes}}</nowiki> | |||
| < | | <nowiki>Costs: {{Resource | l2 | count = 2 | nameonly = yes}}</nowiki> | ||
| <nowiki>Recover half of your max {{Resource | ki | forceplural = yes}}, once per short rest.</nowiki> | |||
| <nowiki>{{Resource | type = ar | 1 | forceplural = yes}}</nowiki> | |||
| < | | <nowiki>{{Resource | type = shadowspell3 | 1 }}</nowiki> | ||
| <nowiki>{{Resource | type = eyestalk | 1 }}</nowiki> | |||
| <nowiki>{{r|reaction}}s</nowiki> | |||
| < | }} | ||
[[Category:Templates]] | |||
[[Category:Icon templates]] | |||
| < | |||
| < | |||
| < | |||
| < | |||
| < | |||
| < | |||
| < | |||
| < | |||
| | |||
| < | |||
</noinclude> | </noinclude> |
Latest revision as of 19:34, 20 December 2024
- {{r}}
Display action resources, including specific class resources, in a standardized and consistent format. This template is intended to be inline.
Refer to the table below for all the supported resource types and their aliases.
Template data
- Usage
{{Resource | <type> | [count] | [icononly] | [nameonly] | [forceplural]}}
< ... >
denotes mandatory parameters and[ ... ]
denotes optional parameters.
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 |
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 |
---|---|
Actions | action
|
Bonus actions | bonus, bonus action, ba
|
Reactions | reaction
|
Movement | movement (no value)
|
Movement | movement m (value in meters)
|
Movement | movement ft (value in feet)
|
Movement (Half cost) | half movement
|
Arcane Recovery Charges | ar, arcrec, arcane recovery
|
Bardic Inspiration Charges | bi, bardin, bardic inspiration
|
Channel Divinity Charges | cd, chadiv, channel divinity
|
Channel Oath Charges | co, chaoat, channel oath
|
Fungal Infestation Charges | fi, fnginf, fungal infestation
|
Ki Points | ki
|
Level 1 Spell Slots | l1, s1, spell1, level1
|
Level 2 Spell Slots | l2, s2, spell2, level2
|
Level 3 Spell Slots | l3, s3, spell3, level3
|
Level 4 Spell Slots | l4, s4, spell4, level4
|
Level 5 Spell Slots | l5, s5, spell5, level5
|
Level 6 Spell Slots | l6, s6, spell6, level6
|
Level 3 Shadow Spell Slots | shadowspell3, ss3, shadowlevel3, sl3
|
Lay on Hands Charges | lh, layonh, lay on hands
|
Natural Recovery Charges | nr, natrec, natural recovery
|
Rage Charges | rg, rage
|
Sorcery Points | sp, srcpnt, sorcery
|
Superiority Dice | sd, supdie, superiority die
|
War Priest Charges | wp, warpri, war priest
|
Wild Shape Charges | ws, wldshp, wild shape, wildshape
|
Tides of Chaos Charges | toc, tides of chaos
|
Luck Points | lp, lukpnt, luck, luck point
|
Examples
Markup | Renders as |
---|---|
{{Resource | invalid}} | invalid |
{{Resource}} | UNDEFINED |
{{Resource | supdie}} | Superiority Die |
{{Resource | SuPdIe | 2}} | 2Superiority Dice |
{{Resource | supdie| forceplural=yes}} | Superiority Dice |
{{Resource | ki | count = 200}} | 200Ki Points |
{{Resource | lh | icononly = yes}} | |
{{Resource | movement m | count = 1.5}} | 1.5 m / 5 ftMovement |
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 Ki Points, once per short rest. |
{{Resource | type = ar | 1 | forceplural = yes}} | Arcane Recovery Charges |
{{Resource | type = shadowspell3 | 1 }} | Level 3 Shadow Spell Slot |
{{Resource | type = eyestalk | 1 }} | Eyestalk Action |
{{r|reaction}}s | Reactions |