Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Resource: Difference between revisions

Template page
mNo edit summary
Changed acronym to cos, since co is already taken by channel oath
 
(39 intermediate revisions by 6 users not shown)
Line 1: Line 1:
<includeonly><span class="bg3wiki-resource-template">{{trim| {{#lvardef: type|UNDEFINED}} {{#lvardef: icon|Alert Icon.png}}{{#lvardef:isplural|0}}{{#lvardef:icononly|0}}
<includeonly>{{trim|
{{#lvardef: count | 1}}<!--if count is empty, set it to 1--> <!--this is at the front -->
{{#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}}}} <!--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)-->
{{#switch: {{lc:{{#lvar: type}}}} <!-- lc is to make the input all lower case, so that case is not my biggest priority -->
| action = {{#lvardef: type|[[Action]]{{#ifexpr: {{#lvar: isplural}} > 0 |s}}}} {{#lvardef: icon|Action Icon.png}}
| bonus = {{#lvardef: type|[[Bonus action]]{{#ifexpr: {{#lvar: isplural}} > 0 |s}}}} {{#lvardef: icon|Bonus Action Icon.png}}
| reaction = {{#lvardef: type|[[Reaction]]{{#ifexpr: {{#lvar: isplural}} > 0 |s}}}} {{#lvardef: icon|Reaction Icon.png}}
| movement = {{#lvardef: type|[[Movement speed|Movement]]}} {{#lvardef: icon|Movement Speed Icon.png}} {{#if: {{{count|}}}| {{#lvardef: count| {{Distance/Transform|{{{count|}}}}}}}|{{#if: {{{2|}}} | {{#lvardef:count|{{Distance/Transform|{{{2|}}}}}}}}}}}
| sd | supdie | superiority die = {{#lvardef: type|Superiority {{#ifexpr: {{#lvar: isplural}} > 0 |Dice|Die}}}} {{#lvardef: icon|Superiority Die d8 Icon.png}}
| fi = {{#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 | = {{#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 inspriation = {{#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 | lukpnt | luck point = {{#lvardef: type|Luck Point{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }}{{#lvardef:icon|Luck Point Resource Icon.png}}
#default = {{#lvardef: type|Unknown Resource}}[[Category:Pages with unknown resources]]
}}{{#ifexpr: {{#lvar: isplural}} > 0 | {{#if: {{{forceplural|}}}||{{#lvar: count}}}}}}{{SmallIcon|{{#lvar:icon}}}}{{#if: {{{icononly|}}}||{{#lvar: type}}}}}}</span></includeonly><noinclude>
=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!
{{#lvardef: type | UNDEFINED }}
=Usage=
{{#lvardef: icon | Alert Icon.png }}
<pre>{{Resource | <type> | [count] | [icononly] | [forceplural]}}</pre>
{{#lvardef: isplural | 0 }}
----
{{#lvardef: icononly | 0 }}
<br/><code><></code> Denotes mandatory parameters.
{{#lvardef: nameonly | 0 }}
* <code>type</code>
 
** See below for a table of what you can input here.
{{#lvardef: count | 1 }}
** <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.
{{#if: {{{type|}}}
<br/>
| {{#lvardef: type | {{{type|}}} }}
----
| {{#if: {{{1|}}} | {{#lvardef: type | {{{1}}} }} }}
<br/><code>[]</code> Denotes optional parameters.
}}
* <code>count</code>
 
** The number of resources.
{{#if: {{{count|}}}
** Any number above 2 will be shown to the left of the icon, otherwise it will be hidden. (See [[#Examples|Examples]])
| {{#lvardef: count | {{{count|}}} }}
* <code>icononly</code>
| {{#if: {{{2|}}} | {{#lvardef: count | {{{2|}}} }} }}
** 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>
{{#ifexpr: {{#lvar: count}} > 1 | {{#lvardef: isplural | 1 }} }}
** 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).
<!--there may be special cases where you want to have plural forms without a count (i.e. explanations)-->
=Quick Reference=
{{#if: {{{forceplural|}}}
{| class="wikitable mw-collapsible"
| {{#ifeq: {{{forceplural|}}} | yes | {{#lvardef:isplural|1}} | {{#lvardef:isplural|0}} }}
|+ name parameter
}}
! Resource
 
! Input
<!-- lc is to make the input all lower case, so that case is not my biggest priority -->
|-
{{#switch: {{lc: {{#lvar:type}} }}
| {{Resource|action|forceplural=yes}}
 
| {{C|action}}
| action =
|-
{{#lvardef: type | {{#if: {{{nameonly|}}}|Action|[[Action]]}}{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }}
| {{Resource|bonus|forceplural=yes}}
{{#lvardef: icon | Action Icon.png }}
| {{C|bonus}}
 
|-
| bonus | ba | bonus action =
| {{Resource|reaction|forceplural=yes}}
{{#lvardef: type | {{#if: {{{nameonly|}}}|Bonus action|[[Bonus action]]}}{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }}
| {{C|reaction}}
{{#lvardef: icon | Bonus Action Icon.png }}
|-
 
| {{Resource|movement|forceplural=yes}}
| reaction =
| {{C|movement}}
{{#lvardef: type | {{#if: {{{nameonly|}}}|Reaction|[[Reaction]]}}{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }}
|-
{{#lvardef: icon | Reaction Icon.png }}
| {{Resource|ar|forceplural=yes}}
 
| {{C|ar, arcrec, arcane recovery}}
| movement =
|-
{{#lvardef: type | {{#if: {{{nameonly|}}}|Movement|[[Movement speed|Movement]]}} }}
| {{Resource|bi|forceplural=yes}}
{{#lvardef: icon | Movement Speed Icon.png }}
| {{C|bi, bardin, bardic inspriation}}
{{#if: {{{count|}}} {{{2|}}}
|-
| {{#lvardef: count | {{color|red|(ERROR: Use <code>movement m</code> or <code>movement ft</code>.)}} }}
| {{Resource|cd|forceplural=yes}}
[[Category:Pages with errors]]
| {{C|cd, chadiv, channel divinity}}
}}
|-
 
| {{Resource|co|forceplural=yes}}
| movement m =
| {{C|co, chaoat, channel oath}}
{{#lvardef: type | {{#if: {{{nameonly|}}}|Movement|[[Movement speed|Movement]]}} }}
|-
{{#lvardef: icon | Movement Speed Icon.png }}
| {{Resource|fi|forceplural=yes}}
{{#if: {{{count|}}}
| {{C|fi}}
| {{#lvardef: count | {{Distance | m = {{{count|}}} }} }}
|-
| {{#if: {{{2|}}} | {{#lvardef: count | {{Distance | m = {{{2|}}} }} }} }}
| {{Resource|ki|forceplural=yes}}
}}
| {{C|ki}}
 
|-
| movement ft =
| {{Resource|l1|forceplural=yes}}
{{#lvardef: type | {{#if: {{{nameonly|}}}|Movement|[[Movement speed|Movement]]}} }}
| {{C|l1, s1, spell1, level1}}
{{#lvardef: icon | Movement Speed Icon.png }}
|-
<!-- Backwards compatibility only; this isn't meant to be used with a value -->
| {{Resource|l2|forceplural=yes}}
{{#if: {{{count|}}}
| {{C|l2, s2, spell2, level2}}
| {{#lvardef: count | {{Distance | ft = {{{count|}}} }} }}
|-
| {{#if: {{{2|}}} | {{#lvardef: count | {{Distance | ft = {{{2|}}} }} }} }}
| {{Resource|l3|forceplural=yes}}
}}
| {{C|l3, s3, spell3, level3}}
 
|-
| half movement =
| {{Resource|l4|forceplural=yes}}
{{#lvardef: type | {{#if: {{{nameonly|}}}|Movement (Half cost)|[[Movement speed|Movement]] (Half cost)}} }}
| {{C|l4, s4, spell4, level4}}
{{#lvardef: icon | Movement Speed Icon.png }}
|-
 
| {{Resource|l5|forceplural=yes}}
| sd | supdie | superiority die =
| {{C|l5, s5, spell5, level5}}
{{#lvardef: type | Superiority {{#ifexpr: {{#lvar: isplural}} > 0 |Dice|Die}} }}
|-
{{#lvardef: icon | Superiority Die d8 Icon.png }}
| {{Resource|l6|forceplural=yes}}
 
| {{C|l6, s6, spell6, level6}}
| fi | fnginf | fungal infestation =
|-
{{#lvardef: type |Fungal Infestation Charge{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }}
| {{Resource|lh|forceplural=yes}}
{{#lvardef: icon | Fungal Infestation Charge Icon.png }}
| {{C|lh, layonh, lay on hands}}
 
|-
| ki =
| {{Resource|nr|forceplural=yes}}
{{#lvardef: type | Ki Point{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }}
| {{C|nr, natrec, natural recovery}}
{{#lvardef: icon | Monk Ki Icon.png }}
|-
 
| {{Resource|rg|forceplural=yes}}
| ws | wldshp | wild shape | wildshape =
| {{C|rg, rage}}
{{#lvardef: type | Wild Shape Charge{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }}
|-
{{#lvardef: icon | Wild Shape Charges Icon.png
| {{Resource|sp|forceplural=yes}}
}}
| {{C|sp, srcpnt, sorcery}}
 
|-
| spell1 | s1 | level1 | l1 =
| {{Resource|sd|forceplural=yes}}
{{#lvardef: type | Level 1 Spell Slot{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }}
| {{C|sd, supdie, superiority die}}
{{#lvardef: icon | Spell Slot Icon.png }}
|-
 
| {{Resource|wp|forceplural=yes}}
| spell2 | s2 | level2 | l2 =
| {{C|wp, warpri, war priest }}
{{#lvardef: type | Level 2 Spell Slot{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }}
|-
{{#lvardef: icon | Spell Slot Icon.png }}
| {{Resource|ws|forceplural=yes}}
 
| {{C|ws, wldshp, wild shape}}
| spell3 | s3 | level3 | l3 =
|-
{{#lvardef: type | Level 3 Spell Slot{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }}
| {{Resource|toc|forceplural=yes}}
{{#lvardef: icon | Spell Slot Icon.png }}
| {{C|toc, tides of chaos}}
 
|-
| spell4 | s4 | level4 | l4 =
| {{Resource|lp|forceplural=yes}}
{{#lvardef: type | Level 4 Spell Slot{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }}
| {{C|lp, lukpnt, luck point}}
{{#lvardef: icon | Spell Slot Icon.png }}
|}
 
=Examples=
| spell5 | s5 | level5 | l5 =
{| class="wikitable mw-collapsible"
{{#lvardef: type | Level 5 Spell Slot{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }}
! Output
{{#lvardef: icon | Spell Slot Icon.png }}
! Input
 
|-
| spell6 | s6 | level6 | l6 =
| {{Resource | invalid}}
{{#lvardef: type | Level 6 Spell Slot{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }}
| <pre>{{Resource | invalid}}</pre>
{{#lvardef: icon | Spell Slot Icon.png }}
|-
 
| {{Resource}}
| ar | arcrec | arcane recovery =
| <pre>{{Resource}}</pre>
{{#lvardef: type | Arcane Recovery Charge{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }}
|-
{{#lvardef: icon | Arcane Recovery Charges Icons.png }}
| {{Resource | supdie}}
 
| <pre>{{Resource | supdie}}</pre>
| bi | bardin | bardic inspiration =
|-
{{#lvardef: type | Bardic Inspiration Charge{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }}
| {{Resource | SuPdIe | 2}}
{{#lvardef: icon | Bardic Inspiration Resource Icon.png }}
| <pre>{{Resource | SuPdIe | 2}}</pre>
 
|-
| cd | chadiv | channel divinity =
| {{Resource | supdie| forceplural=yes}}
{{#lvardef: type | Channel Divinity Charge{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }}
| <pre>{{Resource | supdie| forceplural=yes}}</pre>
{{#lvardef: icon | Channel Divinity Charges Icons.png }}
|-
 
| {{Resource | ki | count = 200}}
| co | chaoat | channel oath =
| <pre>{{Resource | ki | count = 200}}</pre>
{{#lvardef: type | Channel Oath Charge{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }}
|-
{{#lvardef: icon | Channel Oath Icon.png }}
| {{Resource | lh | icononly = yes}}
 
| <pre>{{Resource | lh | icononly = yes}}</pre>
| rg | rage =
|-
{{#lvardef: type | Rage Charge{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }}
| {{Resource | movement | count = 5}}
{{#lvardef: icon | Rage Charges Icons.png }}
| <pre>{{Resource | movement | count = 5}}</pre>
 
|-
| sp | srcpnt | sorcery =
| Costs: {{Resource | ki | count = 2 | icononly = yes}}
{{#lvardef: type | Sorcery Point{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }}
| <pre>Costs: {{Resource | ki | count = 2 | icononly = yes}}</pre>
{{#lvardef: icon | Sorcery Points Icons.png }}
|-
 
| Restores: {{Resource | l2 | count = 2}}
| wp | warpri | war priest =
| <pre>Costs: {{Resource | l2 | count = 2}}</pre>
{{#lvardef: type | War Priest Charge{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }}
|-
{{#lvardef: icon | War Priest Charges Icon.png}}
| Recover half of your max {{Resource | ki | forceplural = yes}}, once per short rest.
 
| <pre>Recover half of your max {{Resource | ki | forceplural = yes}}, once per short rest.</pre>
| lh | layonh | lay on hands =
|-
{{#lvardef: type | Lay on Hands Charge{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }}
| {{Resource | type = ar | 1 | forceplural = yes}}
{{#lvardef: icon | Lay on Hands Resource Icon.png }}
| <pre>{{Resource | type = ar | 1 | forceplural = yes}}</pre>
 
|-
| 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 | Eyestalk Action Icon.png }} <!-- TODO: Update this icon when patch releases -->
 
| bladesong power | bladesong | bsp =
{{#lvardef: type | Bladesong Power}}
{{#lvardef: icon | Eyestalk Action Icon.png }} <!-- TODO: Update this icon when patch releases -->
 
| cosmic omen | cosmic | cos =
{{#lvardef: type | Cosmic Omen{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }}
{{#lvardef: icon | Eyestalk Action Icon.png }}
 
| star map | starmap | sm =
{{#lvardef: type | Star Map{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }}
{{#lvardef: icon | Eyestalk Action 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 -->
| {{#lvar: type}}
}}</includeonly><noinclude>{{Documentation}}
[[Category:Templates]]
[[Category:Icon templates]]
[[Category:Link templates]]
</noinclude>
</noinclude>