Template:Resource: Difference between revisions

Jump to navigation Jump to search
Giganormous code cleanup. o_o
m (header levels)
(Giganormous code cleanup. o_o)
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}}{{#lvardef:nameonly|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}}}}}}}}}
{{#lvardef: type | UNDEFINED }}
{{#if: {{{count|}}}| {{#lvardef: count| {{{count|}}}}}|{{#if: {{{2|}}} | {{#lvardef:count|{{{2|}}}}}}}}}
{{#lvardef: icon | Alert Icon.png }}
{{#ifexpr: {{#lvar: count}} > 1 | {{#lvardef:isplural|1}}}} <!--check if count is plural-->
{{#lvardef: isplural | 0 }}
{{#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)-->
{{#lvardef: icononly | 0 }}
{{#switch: {{lc:{{#lvar: type}}}} <!-- lc is to make the input all lower case, so that case is not my biggest priority -->
{{#lvardef: nameonly | 0 }}
| 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}}
{{#lvardef: count | 1 }}
| 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|}}}| {{#lvardef: count| {{Distance/Transform|{{{count|}}}}}}}|{{#if: {{{2|}}} | {{#lvardef:count|{{Distance/Transform|{{{2|}}}}}}}}}}}
{{#if: {{{type|}}}
| half movement = {{#lvardef: type|{{#if: {{{nameonly|}}}|Movement (Half cost)|[[Movement speed|Movement]] (Half cost)}}}} {{#lvardef: icon|Movement Speed Icon.png}}
| {{#lvardef: type | {{{type|}}} }}
| sd | supdie | superiority die = {{#lvardef: type|Superiority {{#ifexpr: {{#lvar: isplural}} > 0 |Dice|Die}}}} {{#lvardef: icon|Superiority Die d8 Icon.png}}
| {{#if: {{{1|}}} | {{#lvardef: type | {{{1}}} }} }}
| 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}}
{{#if: {{{count|}}}
| spell1 | s1 | level1 | l1 = {{#lvardef: type|Level 1 Spell Slot{{#ifexpr: {{#lvar: isplural}} > 0 |s}}}} {{#lvardef: icon|Spell Slot Icon.png}}
| {{#lvardef: count | {{{count|}}} }}
| spell2 | s2 | level2 | l2 = {{#lvardef: type|Level 2 Spell Slot{{#ifexpr: {{#lvar: isplural}} > 0 |s}}}} {{#lvardef: icon|Spell Slot Icon.png}}
| {{#if: {{{2|}}} | {{#lvardef: count | {{{2|}}} }} }}
| 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}}
{{#ifexpr: {{#lvar: count}} > 1 | {{#lvardef: isplural | 1 }} }}
| 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}}
<!--there may be special cases where you want to have plural forms without a count (i.e. explanations)-->
| bi | bardin | bardic inspiration = {{#lvardef: type|Bardic Inspiration Charge{{#ifexpr: {{#lvar: isplural}} > 0 |s}}}} {{#lvardef: icon|Bardic Inspiration Resource Icon.png}}
{{#if: {{{forceplural|}}}
| cd | chadiv | channel divinity = {{#lvardef: type|Channel Divinity Charge{{#ifexpr: {{#lvar: isplural}} > 0 |s}}}} {{#lvardef: icon|Channel Divinity Charges Icons.png}}
| {{#ifeq: {{{forceplural|}}} | yes | {{#lvardef:isplural|1}} | {{#lvardef:isplural|0}} }}
| 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}}
<!-- lc is to make the input all lower case, so that case is not my biggest priority -->
| wp | warpri | war priest = {{#lvardef: type|War Priest Charge{{#ifexpr: {{#lvar: isplural}} > 0 |s}}}} {{#lvardef: icon|War Priest Charges Icon.png}}
{{#switch: {{lc:{{#lvar:type}}}}
| 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}}
| action =
| toc | tides of chaos = {{#lvardef: type|Tides of Chaos Charge{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }}{{#lvardef:icon|Tides of Chaos Resource Icon.png}}
{{#lvardef: type | {{#if: {{{nameonly|}}}|Action|[[Action]]}}{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }}
| lp | lukpnt | luck point = {{#lvardef: type|Luck Point{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }}{{#lvardef:icon|Luck Point Resource Icon.png}}
{{#lvardef: icon | Action 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}}
| bonus =
}}{{#ifexpr: {{#lvar: isplural}} > 0 | {{#if: {{{forceplural|}}}||{{#lvar: count}}}}}}{{#if: {{{nameonly|}}}|{{Nbts}}|{{SmallIcon|{{#lvar:icon}}}}}}{{#if: {{{icononly|}}}||{{#lvar: type}}}}}}{{#ifeq: {{#lvar: icon}}|Alert Icon.png|[[Category:Pages with unknown resources]]}}</span></includeonly><noinclude>
{{#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|}}}
| {{#lvardef: count | {{Distance/Transform|{{{count|}}}}} }}
| {{#if: {{{2|}}} | {{#lvardef: count | {{Distance/Transform|{{{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 }}
 
<!-- 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>{{#ifeq: {{#lvar: icon}} | Alert Icon.png | [[Category:Pages with unknown resources]] }}</includeonly><noinclude>
==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 template is intended to be ''inline''.
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''.

Navigation menu