Template:Resource: Difference between revisions
Jump to navigation
Jump to search
Crashaholic (talk | contribs) (Created page with "<includeonly></includeonly><noinclude></noinclude>") |
Crashaholic (talk | contribs) (implemented the functionality) |
||
Line 1: | Line 1: | ||
<includeonly></includeonly><noinclude></noinclude> | <includeonly>{{trim| {{#vardefine: name|UNDEFINED}} {{#vardefine: icon|Alert Icon.png}}{{#vardefine:isplural|0}}{{#vardefine:icononly|0}} | ||
{{#vardefine: icononly | {{#if: {{{icononly|}}} | 1 | 0}}}} | |||
{{#vardefine: count| {{#if: {{{count|}}} | {{{count|}}} | 1}}}} <!--if count is empty, set it to 1--> | |||
{{#if: {{{count|}}}| {{#ifexpr: {{{count|}}} > 1 | {{#vardefine:isplural|1}}}}}} <!--if count is not empty, check if its plural--> | |||
{{#if: {{{forceplural|}}} | {{#ifeq: {{{forceplural|}}} | yes | {{#vardefine:isplural|1}} | {{#vardefine:isplural|0}}}}}} <!--there may be special cases where you want to have plural forms without a count (i.e. explanations)--> | |||
{{#switch: {{lc:{{{name}}}}} <!-- lc is to make the input all lower case, so that case is not my biggest priority --> | |||
| sd | supdie | superiority die = {{#vardefine: name|Superiority {{#ifexpr: {{#var: isplural}} > 0 |Dices|Die}}}} {{#vardefine: icon|Superiority Die d8 Icon.png}} | |||
| ki = {{#vardefine: name|Ki Charge{{#ifexpr: {{#var: isplural}} > 0 |s}}}} {{#vardefine: icon|Monk Ki Icon.png}} | |||
| ws | wldshp | wild shape | = {{#vardefine: name|Wild Shape Charge{{#ifexpr: {{#var: isplural}} > 0 |s}}}} {{#vardefine: icon|Wild Shape Charges Icon.png}} | |||
| spell1 | s1 | level1 | l1 = {{#vardefine: name|Level 1 Spell Slot{{#ifexpr: {{#var: isplural}} > 0 |s}}}} {{#vardefine: icon|Spell Slot Icon.png}} | |||
| spell2 | s2 | level2 | l2 = {{#vardefine: name|Level 2 Spell Slot{{#ifexpr: {{#var: isplural}} > 0 |s}}}} {{#vardefine: icon|Spell Slot Icon.png}} | |||
| spell3 | s3 | level3 | l3 = {{#vardefine: name|Level 3 Spell Slot{{#ifexpr: {{#var: isplural}} > 0 |s}}}} {{#vardefine: icon|Spell Slot Icon.png}} | |||
| spell4 | s4 | level4 | l4 = {{#vardefine: name|Level 4 Spell Slot{{#ifexpr: {{#var: isplural}} > 0 |s}}}} {{#vardefine: icon|Spell Slot Icon.png}} | |||
| spell5 | s5 | level5 | l5 = {{#vardefine: name|Level 5 Spell Slot{{#ifexpr: {{#var: isplural}} > 0 |s}}}} {{#vardefine: icon|Spell Slot Icon.png}} | |||
| spell6 | s6 | level6 | l6 = {{#vardefine: name|Level 6 Spell Slot{{#ifexpr: {{#var: isplural}} > 0 |s}}}} {{#vardefine: icon|Spell Slot Icon.png}} | |||
| ar | arcrec | arcane recovery = {{#vardefine: name|Arcane Recovery Charge{{#ifexpr: {{#var: isplural}} > 0 |s}}}} {{#vardefine: icon|Arcane Recovery Charges Icons.png}} | |||
| bi | bardin | bardic inspriation = {{#vardefine: name|Bardic Inspiration Charge{{#ifexpr: {{#var: isplural}} > 0 |s}}}} {{#vardefine: icon|Bardic Inspiration Resource Icon.png}} | |||
| cd | chadiv | channel divinity = {{#vardefine: name|Channel Divinity Charge{{#ifexpr: {{#var: isplural}} > 0 |s}}}} {{#vardefine: icon|Channel Divinity Charges Icons.png}} | |||
| co | chaoat | channel oath = {{#vardefine: name|Channel Oath Charge{{#ifexpr: {{#var: isplural}} > 0 |s}}}} {{#vardefine: icon|Channel Oath Icon.png}} | |||
| rg | rage = {{#vardefine: name|Rage Charge{{#ifexpr: {{#var: isplural}} > 0 |s}}}} {{#vardefine: icon|Rage Charges Icons.png}} | |||
| sp | srcpnt | sorcery = {{#vardefine: name|Sorcery Point{{#ifexpr: {{#var: isplural}} > 0 |s}}}} {{#vardefine: icon|Sorcery Points Icons.png}} | |||
| wp | warpri | war priest = {{#vardefine: name|War Priest Charge Charge{{#ifexpr: {{#var: isplural}} > 0 |s}}}} {{#vardefine: icon|War Priest Charges Icon.png}} | |||
| lh | layonh | lay on hands = {{#vardefine: name|Lay on Hands Charge{{#ifexpr: {{#var: isplural}} > 0 |s}}}} {{#vardefine: icon|Lay on Hands Resource Icon.png}} | |||
| nr | natrec | natural recovery = {{#vardefine: name|Natural Recovery Charge{{#ifexpr: {{#var: isplural}} > 0 |s}}}} {{#vardefine: icon|Natural Recovery Charges Icon.png}} | |||
}}{{#ifexpr: {{#var: isplural}} > 0 | |||
| {{#if: {{{forceplural|}}}||{{#var: count}}}}}}{{SmallIcon|{{#var:icon}}}}{{#ifexpr: {{#var: icononly}} < 1 |{{#var: name}}}}}}</includeonly><noinclude>[[Category:Templates]] | |||
=What is this?= | |||
This is a template for a quicker and more standardized manner of typing out the class-specific resource. | |||
If there are any missing ones, don't hesitate to contribute! | |||
=Quick Reference= | |||
{| class="wikitable mw-collapsible" | |||
|+ name parameter | |||
! Resource | |||
! Input | |||
|- | |||
| {{Resource|name=l1|forceplural=yes}} | |||
| {{C|l1, s1, spell1, level1}} | |||
|- | |||
| {{Resource|name=l2|forceplural=yes}} | |||
| {{C|l2, s2, spell2, level2}} | |||
|- | |||
| {{Resource|name=l3|forceplural=yes}} | |||
| {{C|l3, s3, spell3, level3}} | |||
|- | |||
| {{Resource|name=l4|forceplural=yes}} | |||
| {{C|l4, s4, spell4, level4}} | |||
|- | |||
| {{Resource|name=l5|forceplural=yes}} | |||
| {{C|l5, s5, spell5, level5}} | |||
|- | |||
| {{Resource|name=l6|forceplural=yes}} | |||
| {{C|l6, s6, spell6, level6}} | |||
|- | |||
| {{Resource|name=ar|forceplural=yes}} | |||
| {{C|ar, arcrec, arcane recovery}} | |||
|- | |||
| {{Resource|name=cd|forceplural=yes}} | |||
| {{C|cd, chadiv, channel divinity}} | |||
|- | |||
| {{Resource|name=co|forceplural=yes}} | |||
| {{C|co, chaoat, channel oath}} | |||
|- | |||
| {{Resource|name=ki|forceplural=yes}} | |||
| {{C|ki}} | |||
|- | |||
| {{Resource|name=lh|forceplural=yes}} | |||
| {{C|lh, layonh, lay on hands}} | |||
|- | |||
| {{Resource|name=nr|forceplural=yes}} | |||
| {{C|nr, natrec, natural recovery}} | |||
|- | |||
| {{Resource|name=rg|forceplural=yes}} | |||
| {{C|rg, rage}} | |||
|- | |||
| {{Resource|name=sp|forceplural=yes}} | |||
| {{C|sp, srcpnt, sorcery}} | |||
|- | |||
| {{Resource|name=sd|forceplural=yes}} | |||
| {{C|sd, supdie, superiority die}} | |||
|- | |||
| {{Resource|name=wp|forceplural=yes}} | |||
| {{C|wp, warpri, war priest }} | |||
|- | |||
| {{Resource|name=ws|forceplural=yes}} | |||
| {{C|ws, wldshp, wild shape}} | |||
|} | |||
=Examples= | |||
{| class="wikitable mw-collapsible" | |||
! Output | |||
! Input | |||
|- | |||
| {{Resource | name = invalid}} | |||
| <pre>{{Resource | name = invalid}}</pre> | |||
|- | |||
| {{Resource}} | |||
| <pre>{{Resource}}</pre> | |||
|- | |||
| {{Resource | name = supdie}} | |||
| <pre>{{Resource | name = supdie}}</pre> | |||
|- | |||
| {{Resource | name = SUPdie | count = 2}} | |||
| <pre>{{Resource | name = SUPdie | count = 2}}</pre> | |||
|- | |||
| {{Resource | name = supdie| forceplural=yes}} | |||
| <pre>{{Resource | name = supdie | forceplural=yes}}</pre> | |||
|- | |||
| {{Resource | name = ki | count = 200}} | |||
| <pre>{{Resource | name = ki | count = 200}}</pre> | |||
|- | |||
| {{Resource | name = ki | icononly = yes}} | |||
| <pre>{{Resource | name = ki | icononly = yes}}</pre> | |||
|- | |||
| Costs: {{Resource | name = ki | count = 3 | icononly = yes}} | |||
| <pre>Costs: {{Resource | name = ki | count = 3 | icononly = yes}}</pre> | |||
|- | |||
| Recover half of your max {{Resource | name = ki | forceplural = yes}}, once per short rest. | |||
| <pre>Recover half of your max {{Resource | name = ki | forceplural = yes}}, once per short rest.</pre> | |||
|- | |||
| {{Resource | name = ar | count = 1 | forceplural = yes}} | |||
| <pre>{{Resource | name = ar | count = 1 | forceplural = yes}}</pre> | |||
|- | |||
</noinclude> |
Revision as of 09:44, 19 August 2023
What is this?
This is a template for a quicker and more standardized manner of typing out the class-specific resource.
If there are any missing ones, don't hesitate to contribute!
Quick Reference
Resource | Input |
---|---|
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
|
Arcane Recovery Charges | ar, arcrec, arcane recovery
|
Channel Divinity Charges | cd, chadiv, channel divinity
|
Channel Oath Charges | co, chaoat, channel oath
|
Ki Charges | ki
|
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 Dices | sd, supdie, superiority die
|
War Priest Charge Charges | wp, warpri, war priest
|
Wild Shape Charges | ws, wldshp, wild shape
|
Examples
Output | Input |
---|---|
UNDEFINED | {{Resource | name = invalid}} |
UNDEFINED | {{Resource}} |
Superiority Die | {{Resource | name = supdie}} |
2Superiority Dices | {{Resource | name = SUPdie | count = 2}} |
Superiority Dices | {{Resource | name = supdie | forceplural=yes}} |
200Ki Charges | {{Resource | name = ki | count = 200}} |
{{Resource | name = ki | icononly = yes}} | |
Costs: 3 | Costs: {{Resource | name = ki | count = 3 | icononly = yes}} |
Recover half of your max Ki Charges, once per short rest. | Recover half of your max {{Resource | name = ki | forceplural = yes}}, once per short rest. |
Arcane Recovery Charges | {{Resource | name = ar | count = 1 | forceplural = yes}} |