Template:Resource: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
Crashaholic (talk | contribs) (you can now enter the type (previously named name) parameter without the whole "type=" bit, as well as count (should update docs for this behaviour but uhhhh yeahh)) |
||
Line 1: | Line 1: | ||
<includeonly>{{trim| {{#lvardef: | <includeonly>{{trim| {{#lvardef: type|UNDEFINED}} {{#lvardef: icon|Alert Icon.png}}{{#lvardef:isplural|0}}{{#lvardef:icononly|0}} | ||
{{#lvardef: | {{#lvardef: count | 1}}<!--if count is empty, set it to 1--> <!--this is at the front --> | ||
{{#lvardef: | {{#if: {{{type|}}} | {{#lvardef:type|{{{type|}}}}}|{{#if: {{{1|}}} | {{#lvardef:type|{{{1}}}}}}}}} | ||
{{#if: {{{ | {{#if: {{{count|}}}| {{#lvardef: count| {{{count|}}}}}|{{#if: {{{2|}}} | {{#lvardef:count|{{{2|}}}}}}}}} | ||
{{#ifexpr: {{#lvar: count}} > 1 | {{#lvardef:isplural|1}}}} <!--check if count is plural--> | |||
{{#if: {{{forceplural|}}} | {{#ifeq: {{{forceplural|}}} | yes | {{#lvardef:isplural|1}} | {{#lvardef:isplural|0}}}}}} <!--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}}}}}} <!--there may be special cases where you want to have plural forms without a count (i.e. explanations)--> | ||
{{#switch: {{lc:{{ | {{#switch: {{lc:{{#lvar: type}}}} <!-- lc is to make the input all lower case, so that case is not my biggest priority --> | ||
| sd | supdie | superiority die = {{#lvardef: | | sd | supdie | superiority die = {{#lvardef: type|Superiority {{#ifexpr: {{#lvar: isplural}} > 0 |Dice|Die}}}} {{#lvardef: icon|Superiority Die d8 Icon.png}} | ||
| ki = {{#lvardef: | | ki = {{#lvardef: type|Ki Point{{#ifexpr: {{#lvar: isplural}} > 0 |s}}}} {{#lvardef: icon|Monk Ki Icon.png}} | ||
| ws | wldshp | wild shape | = {{#lvardef: | | ws | wldshp | wild shape | = {{#lvardef: type|Wild Shape Charge{{#ifexpr: {{#lvar: isplural}} > 0 |s}}}} {{#lvardef: icon|Wild Shape Charges Icon.png}} | ||
| spell1 | s1 | level1 | l1 = {{#lvardef: | | 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: | | 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: | | 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: | | 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: | | 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: | | 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: | | ar | arcrec | arcane recovery = {{#lvardef: type|Arcane Recovery Charge{{#ifexpr: {{#lvar: isplural}} > 0 |s}}}} {{#lvardef: icon|Arcane Recovery Charges Icons.png}} | ||
| bi | bardin | bardic inspriation = {{#lvardef: | | bi | bardin | bardic inspriation = {{#lvardef: type|Bardic Inspiration Charge{{#ifexpr: {{#lvar: isplural}} > 0 |s}}}} {{#lvardef: icon|Bardic Inspiration Resource Icon.png}} | ||
| cd | chadiv | channel divinity = {{#lvardef: | | 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: | | co | chaoat | channel oath = {{#lvardef: type|Channel Oath Charge{{#ifexpr: {{#lvar: isplural}} > 0 |s}}}} {{#lvardef: icon|Channel Oath Icon.png}} | ||
| rg | rage = {{#lvardef: | | rg | rage = {{#lvardef: type|Rage Charge{{#ifexpr: {{#lvar: isplural}} > 0 |s}}}} {{#lvardef: icon|Rage Charges Icons.png}} | ||
| sp | srcpnt | sorcery = {{#lvardef: | | sp | srcpnt | sorcery = {{#lvardef: type|Sorcery Point{{#ifexpr: {{#lvar: isplural}} > 0 |s}}}} {{#lvardef: icon|Sorcery Points Icons.png}} | ||
| wp | warpri | war priest = {{#lvardef: | | wp | warpri | war priest = {{#lvardef: type|War Priest Charge Charge{{#ifexpr: {{#lvar: isplural}} > 0 |s}}}} {{#lvardef: icon|War Priest Charges Icon.png}} | ||
| lh | layonh | lay on hands = {{#lvardef: | | 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: | | nr | natrec | natural recovery = {{#lvardef: type|Natural Recovery Charge{{#ifexpr: {{#lvar: isplural}} > 0 |s}}}} {{#lvardef: icon|Natural Recovery Charges Icon.png}} | ||
}}{{#ifexpr: {{#lvar: isplural}} > 0 | }}{{#ifexpr: {{#lvar: isplural}} > 0 | {{#if: {{{forceplural|}}}||{{#lvar: count}}}}}}{{SmallIcon|{{#lvar:icon}}}}{{#if: {{{icononly|}}}||{{#lvar: type}}}}}}</includeonly><noinclude> | ||
| {{#if: {{{forceplural|}}}||{{#lvar: count}}}}}}{{SmallIcon|{{#lvar:icon}}}}{{# | |||
=What is this?= | =What is this?= | ||
This is a template for a quicker and more standardized manner of typing out the class-specific resource. | This is a template for a quicker and more standardized manner of typing out the class-specific resource. This template is intended to be ''inline''. | ||
If there are any missing | If there are any missing resources, don't hesitate to contribute! | ||
=Usage= | |||
<pre>{{Resource | <type> | [count] | [icononly] | [forceplural]}}</pre> | |||
---- | |||
<br/><code><></code> Denotes mandatory parameters. | |||
* <code>type</code> | |||
** See below for a table of what you can input here. | |||
** <code>type =</code> is optional; you may just type the type name as long as its the first parameter. | |||
*** <code>type = supdie</code> is the same as <code>supdie</code>, AS LONG AS THEY ARE IN THE FIRST PARAMETER. | |||
<br/> | |||
---- | |||
<br/><code>[]</code> Denotes optional parameters. | |||
* <code>count</code> | |||
** The number of resources. | |||
** Any number above 2 will be shown to the left of the icon, otherwise it will be hidden. (See [[#Examples|Examples]]) | |||
* <code>icononly</code> | |||
** Show the icon only, leaving the count there as well. | |||
** Can be used to just quickly get the icon without the text. | |||
* <code>forceplural</code> | |||
** Forces the text to be plural, changing some of the words to their plural form | |||
** The most obvious use of this is for Superiority Die (or Dices in plural). | |||
=Quick Reference= | =Quick Reference= | ||
{| class="wikitable mw-collapsible" | {| class="wikitable mw-collapsible" | ||
Line 35: | Line 55: | ||
! Input | ! Input | ||
|- | |- | ||
| {{Resource| | | {{Resource|ar|forceplural=yes}} | ||
| {{C|ar, arcrec, arcane recovery}} | |||
|- | |||
| {{Resource|bi|forceplural=yes}} | |||
| {{C|bi, bardin, bardic inspriation}} | |||
|- | |||
| {{Resource|cd|forceplural=yes}} | |||
| {{C|cd, chadiv, channel divinity}} | |||
|- | |||
| {{Resource|co|forceplural=yes}} | |||
| {{C|co, chaoat, channel oath}} | |||
|- | |||
| {{Resource|ki|forceplural=yes}} | |||
| {{C|ki}} | |||
|- | |||
| {{Resource|l1|forceplural=yes}} | |||
| {{C|l1, s1, spell1, level1}} | | {{C|l1, s1, spell1, level1}} | ||
|- | |- | ||
| {{Resource| | | {{Resource|l2|forceplural=yes}} | ||
| {{C|l2, s2, spell2, level2}} | | {{C|l2, s2, spell2, level2}} | ||
|- | |- | ||
| {{Resource| | | {{Resource|l3|forceplural=yes}} | ||
| {{C|l3, s3, spell3, level3}} | | {{C|l3, s3, spell3, level3}} | ||
|- | |- | ||
| {{Resource| | | {{Resource|l4|forceplural=yes}} | ||
| {{C|l4, s4, spell4, level4}} | | {{C|l4, s4, spell4, level4}} | ||
|- | |- | ||
| {{Resource| | | {{Resource|l5|forceplural=yes}} | ||
| {{C|l5, s5, spell5, level5}} | | {{C|l5, s5, spell5, level5}} | ||
|- | |- | ||
| {{Resource| | | {{Resource|l6|forceplural=yes}} | ||
| {{C|l6, s6, spell6, level6}} | | {{C|l6, s6, spell6, level6}} | ||
|- | |- | ||
| {{Resource| | | {{Resource|lh|forceplural=yes}} | ||
| {{C|lh, layonh, lay on hands}} | | {{C|lh, layonh, lay on hands}} | ||
|- | |- | ||
| {{Resource| | | {{Resource|nr|forceplural=yes}} | ||
| {{C|nr, natrec, natural recovery}} | | {{C|nr, natrec, natural recovery}} | ||
|- | |- | ||
| {{Resource| | | {{Resource|rg|forceplural=yes}} | ||
| {{C|rg, rage}} | | {{C|rg, rage}} | ||
|- | |- | ||
| {{Resource| | | {{Resource|sp|forceplural=yes}} | ||
| {{C|sp, srcpnt, sorcery}} | | {{C|sp, srcpnt, sorcery}} | ||
|- | |- | ||
| {{Resource| | | {{Resource|sd|forceplural=yes}} | ||
| {{C|sd, supdie, superiority die}} | | {{C|sd, supdie, superiority die}} | ||
|- | |- | ||
| {{Resource| | | {{Resource|wp|forceplural=yes}} | ||
| {{C|wp, warpri, war priest }} | | {{C|wp, warpri, war priest }} | ||
|- | |- | ||
| {{Resource| | | {{Resource|ws|forceplural=yes}} | ||
| {{C|ws, wldshp, wild shape}} | | {{C|ws, wldshp, wild shape}} | ||
|} | |} | ||
Line 94: | Line 114: | ||
! Input | ! Input | ||
|- | |- | ||
| {{Resource | | | {{Resource | invalid}} | ||
| <pre>{{Resource | | | <pre>{{Resource | invalid}}</pre> | ||
|- | |- | ||
| {{Resource}} | | {{Resource}} | ||
| <pre>{{Resource}}</pre> | | <pre>{{Resource}}</pre> | ||
|- | |- | ||
| {{Resource | | | {{Resource | supdie}} | ||
| <pre>{{Resource | | | <pre>{{Resource | supdie}}</pre> | ||
|- | |||
| {{Resource | SuPdIe | 2}} | |||
| <pre>{{Resource | SuPdIe | 2}}</pre> | |||
|- | |- | ||
| {{Resource | | | {{Resource | supdie| forceplural=yes}} | ||
| <pre>{{Resource | | | <pre>{{Resource | supdie| forceplural=yes}}</pre> | ||
|- | |- | ||
| {{Resource | | | {{Resource | ki | count = 200}} | ||
| <pre>{{Resource | | | <pre>{{Resource | ki | count = 200}}</pre> | ||
|- | |- | ||
| {{Resource | | | {{Resource | lh | icononly = yes}} | ||
| <pre>{{Resource | | | <pre>{{Resource | lh | icononly = yes}}</pre> | ||
|- | |- | ||
| {{Resource | | | Costs: {{Resource | ki | count = 2 | icononly = yes}} | ||
| <pre>{{Resource | | | <pre>Costs: {{Resource | ki | count = 2 | icononly = yes}}</pre> | ||
|- | |- | ||
| | | Restores: {{Resource | l2 | count = 2}} | ||
| <pre>Costs: {{Resource | | | <pre>Costs: {{Resource | l2 | count = 2}}</pre> | ||
|- | |- | ||
| Recover half of your max {{Resource | | | Recover half of your max {{Resource | ki | forceplural = yes}}, once per short rest. | ||
| <pre>Recover half of your max {{Resource | | | <pre>Recover half of your max {{Resource | ki | forceplural = yes}}, once per short rest.</pre> | ||
|- | |- | ||
| {{Resource | | | {{Resource | type = ar | 1 | forceplural = yes}} | ||
| <pre>{{Resource | | | <pre>{{Resource | type = ar | 1 | forceplural = yes}}</pre> | ||
|- | |- | ||
</noinclude> | </noinclude> |
Revision as of 10:02, 6 September 2023
What is this?
This is a template for a quicker and more standardized manner of typing out the class-specific resource. This template is intended to be inline.
If there are any missing resources, don't hesitate to contribute!
Usage
{{Resource | <type> | [count] | [icononly] | [forceplural]}}
<>
Denotes mandatory parameters.
type
- See below for a table of what you can input here.
type =
is optional; you may just type the type name as long as its the first parameter.type = supdie
is the same assupdie
, AS LONG AS THEY ARE IN THE FIRST PARAMETER.
[]
Denotes optional parameters.
count
- The number of resources.
- Any number above 2 will be shown to the left of the icon, otherwise it will be hidden. (See Examples)
icononly
- Show the icon only, leaving the count there as well.
- Can be used to just quickly get the icon without the text.
forceplural
- Forces the text to be plural, changing some of the words to their plural form
- The most obvious use of this is for Superiority Die (or Dices in plural).
Quick Reference
Resource | Input |
---|---|
Arcane Recovery Charges | ar, arcrec, arcane recovery
|
Bardic Inspiration Charges | bi, bardin, bardic inspriation
|
Channel Divinity Charges | cd, chadiv, channel divinity
|
Channel Oath Charges | co, chaoat, channel oath
|
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
|
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 Charge Charges | wp, warpri, war priest
|
Wild Shape Charges | ws, wldshp, wild shape
|
Examples
Output | Input |
---|---|
invalid | {{Resource | invalid}} |
UNDEFINED | {{Resource}} |
Superiority Die | {{Resource | supdie}} |
2Superiority Dice | {{Resource | SuPdIe | 2}} |
Superiority Dice | {{Resource | supdie| forceplural=yes}} |
200Ki Points | {{Resource | ki | count = 200}} |
{{Resource | lh | icononly = yes}} | |
Costs: 2 | Costs: {{Resource | ki | count = 2 | icononly = yes}} |
Restores: 2Level 2 Spell Slots | Costs: {{Resource | l2 | count = 2}} |
Recover half of your max Ki Points, once per short rest. | Recover half of your max {{Resource | ki | forceplural = yes}}, once per short rest. |
Arcane Recovery Charges | {{Resource | type = ar | 1 | forceplural = yes}} |