Ad placeholder

Template:Resource: Difference between revisions

Jump to navigation Jump to search
m
no edit summary
m (Plural of superiority die is superiority dice)
mNo edit summary
(34 intermediate revisions by 9 users not shown)
Line 1: Line 1:
<includeonly>{{trim| {{#vardefine: name|UNDEFINED}} {{#vardefine: icon|Alert Icon.png}}{{#vardefine:isplural|0}}{{#vardefine:icononly|0}}
<includeonly>{{trim|
{{#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 |Dice|Die}}}} {{#vardefine: icon|Superiority Die d8 Icon.png}}
| ki = {{#vardefine: name|Ki Point{{#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!
{{#lvardef: type | UNDEFINED }}
=Quick Reference=
{{#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 =
{{#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]]
}}
 
| 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 =
{{#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 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 | 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 }}
 
| #default =
{{Main namespace only|[[Category:Pages with unknown resources]]}}
 
<!-- end switch -->
}}
 
<!-- end trim (variable definitions) -->
}}<span class="bg3wiki-resource-template">{{#ifexpr: {{#lvar: isplural}} > 0
| {{#if: {{{forceplural|}}} | | {{#lvar: count}} }}
}}{{#if: {{{nameonly|}}}
| {{Nbts}}
| {{SmallIcon | {{#lvar:icon}} }}
}}{{#if: {{{icononly|}}}
| <!-- blank -->
| {{#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!
==Usage==
<pre>{{Resource | <type> | [count] | [icononly] | [nameonly] | [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>nameonly</code>
** Show the name 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==
{| class="wikitable mw-collapsible"
{| class="wikitable mw-collapsible"
|+ name parameter
|+ name parameter
Line 35: Line 212:
! Input
! Input
|-
|-
| {{Resource|name=l1|forceplural=yes}}
| {{Resource|action|forceplural=yes}}
| {{C|l1, s1, spell1, level1}}
| {{C|action}}
|-
| {{Resource|bonus|forceplural=yes}}
| {{C|bonus}}
|-
| {{Resource|reaction|forceplural=yes}}
| {{C|reaction}}
|-
|-
| {{Resource|name=l2|forceplural=yes}}
| {{Resource|movement|forceplural=yes}}
| {{C|l2, s2, spell2, level2}}
| {{C|movement}} (no value)
|-
|-
| {{Resource|name=l3|forceplural=yes}}
| {{Resource|movement m|forceplural=yes}}
| {{C|l3, s3, spell3, level3}}
| {{C|movement m}} (value in meters)
|-
|-
| {{Resource|name=l4|forceplural=yes}}
| {{Resource|movement ft|forceplural=yes}}
| {{C|l4, s4, spell4, level4}}
| {{C|movement ft}} (value in feet)
|-
|-
| {{Resource|name=l5|forceplural=yes}}
| {{Resource|half movement|forceplural=yes}}
| {{C|l5, s5, spell5, level5}}
| {{C|half movement}}
|-
|-
| {{Resource|name=l6|forceplural=yes}}
| {{C|l6, s6, spell6, level6}}
|-
|-
| {{Resource|name=ar|forceplural=yes}}
| {{Resource|ar|forceplural=yes}}
| {{C|ar, arcrec, arcane recovery}}
| {{C|ar, arcrec, arcane recovery}}
|-
|-
| {{Resource|name=bi|forceplural=yes}}
| {{Resource|bi|forceplural=yes}}
| {{C|bi, bardin, bardic inspriation}}
| {{C|bi, bardin, bardic inspiration}}
|-
|-
| {{Resource|name=cd|forceplural=yes}}
| {{Resource|cd|forceplural=yes}}
| {{C|cd, chadiv, channel divinity}}
| {{C|cd, chadiv, channel divinity}}
|-
|-
| {{Resource|name=co|forceplural=yes}}
| {{Resource|co|forceplural=yes}}
| {{C|co, chaoat, channel oath}}
| {{C|co, chaoat, channel oath}}
|-
|-
| {{Resource|name=ki|forceplural=yes}}
| {{Resource|fi|forceplural=yes}}
| {{C|fi, fnginf}}
|-
| {{Resource|ki|forceplural=yes}}
| {{C|ki}}
| {{C|ki}}
|-
|-
| {{Resource|name=lh|forceplural=yes}}
| {{Resource|l1|forceplural=yes}}
| {{C|l1, s1, spell1, level1}}
|-
| {{Resource|l2|forceplural=yes}}
| {{C|l2, s2, spell2, level2}}
|-
| {{Resource|l3|forceplural=yes}}
| {{C|l3, s3, spell3, level3}}
|-
| {{Resource|l4|forceplural=yes}}
| {{C|l4, s4, spell4, level4}}
|-
| {{Resource|l5|forceplural=yes}}
| {{C|l5, s5, spell5, level5}}
|-
| {{Resource|l6|forceplural=yes}}
| {{C|l6, s6, spell6, level6}}
|-
| {{Resource|shadowlevel3|forceplural=yes}}
| {{C|shadowspell3, ss3, shadowlevel3, sl3}}
|-
| {{Resource|lh|forceplural=yes}}
| {{C|lh, layonh, lay on hands}}
| {{C|lh, layonh, lay on hands}}
|-
|-
| {{Resource|name=nr|forceplural=yes}}
| {{Resource|nr|forceplural=yes}}
| {{C|nr, natrec, natural recovery}}
| {{C|nr, natrec, natural recovery}}
|-
|-
| {{Resource|name=rg|forceplural=yes}}
| {{Resource|rg|forceplural=yes}}
| {{C|rg, rage}}
| {{C|rg, rage}}
|-
|-
| {{Resource|name=sp|forceplural=yes}}
| {{Resource|sp|forceplural=yes}}
| {{C|sp, srcpnt, sorcery}}
| {{C|sp, srcpnt, sorcery}}
|-
|-
| {{Resource|name=sd|forceplural=yes}}
| {{Resource|sd|forceplural=yes}}
| {{C|sd, supdie, superiority die}}
| {{C|sd, supdie, superiority die}}
|-
|-
| {{Resource|name=wp|forceplural=yes}}
| {{Resource|wp|forceplural=yes}}
| {{C|wp, warpri, war priest }}
| {{C|wp, warpri, war priest }}
|-
|-
| {{Resource|name=ws|forceplural=yes}}
| {{Resource|ws|forceplural=yes}}
| {{C|ws, wldshp, wild shape}}
| {{C|ws, wldshp, wild shape}}
|-
| {{Resource|toc|forceplural=yes}}
| {{C|toc, tides of chaos}}
|-
| {{Resource|lp|forceplural=yes}}
| {{C|lp, lukpnt, luck point}}
|}
|}
=Examples=
=Examples=
{| class="wikitable mw-collapsible"
{| class="wikitable mw-collapsible"
Line 94: Line 306:
! Input
! Input
|-
|-
| {{Resource | name = invalid}}
| {{Resource | invalid}}
| <pre>{{Resource | name = invalid}}</pre>
| <pre>{{Resource | invalid}}</pre>
|-
|-
| {{Resource}}
| {{Resource}}
| <pre>{{Resource}}</pre>
| <pre>{{Resource}}</pre>
|-
|-
| {{Resource | name = supdie}}
| {{Resource | supdie}}
| <pre>{{Resource | name = supdie}}</pre>
| <pre>{{Resource | supdie}}</pre>
|-
| {{Resource | SuPdIe | 2}}
| <pre>{{Resource | SuPdIe | 2}}</pre>
|-
| {{Resource | supdie| forceplural=yes}}
| <pre>{{Resource | supdie| forceplural=yes}}</pre>
|-
| {{Resource | ki | count = 200}}
| <pre>{{Resource | ki | count = 200}}</pre>
|-
|-
| {{Resource | name = SUPdie | count = 2}}
| {{Resource | lh | icononly = yes}}
| <pre>{{Resource | name = SUPdie | count = 2}}</pre>
| <pre>{{Resource | lh | icononly = yes}}</pre>
|-
|-
| {{Resource | name = supdie| forceplural=yes}}
| {{Resource | movement m | count = 1.5}}
| <pre>{{Resource | name = supdie | forceplural=yes}}</pre>
| <pre>{{Resource | movement m | count = 1.5}}</pre>
|-
|-
| {{Resource | name = ki | count = 200}}
| Costs: {{Resource | ki | count = 2 | icononly = yes}}
| <pre>{{Resource | name = ki | count = 200}}</pre>
| <pre>Costs: {{Resource | ki | count = 2 | icononly = yes}}</pre>
|-
|-
| {{Resource | name = ki | icononly = yes}}
| Restores: {{Resource | l2 | count = 2 | nameonly = yes}}
| <pre>{{Resource | name = ki | icononly = yes}}</pre>
| <pre>Costs: {{Resource | l2 | count = 2 | nameonly = yes}}</pre>
|-
|-
| Costs: {{Resource | name = ki | count = 3 | icononly = yes}}
| Recover half of your max {{Resource | ki | forceplural = yes}}, once per short rest.
| <pre>Costs: {{Resource | name = ki | count = 3 | icononly = yes}}</pre>
| <pre>Recover half of your max {{Resource | ki | forceplural = yes}}, once per short rest.</pre>
|-
|-
| Recover half of your max {{Resource | name = ki | forceplural = yes}}, once per short rest.
| {{Resource | type = ar | 1 | forceplural = yes}}
| <pre>Recover half of your max {{Resource | name = ki | forceplural = yes}}, once per short rest.</pre>
| <pre>{{Resource | type = ar | 1 | forceplural = yes}}</pre>
|-
|-
| {{Resource | name = ar | count = 1 | forceplural = yes}}
| {{Resource | type = shadowspell3 | 1 }}
| <pre>{{Resource | name = ar | count = 1 | forceplural = yes}}</pre>
| <pre>{{Resource | type = shadowspell3 | 1 }}</pre>
|-
|-
| 1 {{Resource | type = eyestalk | 1 }}
| <pre>{{Resource | type = eyestalk | 1 }}</pre>
|}
</noinclude>
</noinclude>

Navigation menu