Template:Resource: Difference between revisions

From bg3.wiki
Jump to navigation Jump to search
(Giganormous code cleanup. o_o)
mNo edit summary
 
(8 intermediate revisions by 2 users not shown)
Line 27: Line 27:


<!-- lc is to make the input all lower case, so that case is not my biggest priority -->
<!-- lc is to make the input all lower case, so that case is not my biggest priority -->
{{#switch: {{lc:{{#lvar:type}}}}
{{#switch: {{lc: {{#lvar:type}} }}


| action =
| action =
Line 43: Line 43:
| movement =
| movement =
{{#lvardef: type | {{#if: {{{nameonly|}}}|Movement|[[Movement speed|Movement]]}} }}
{{#lvardef: type | {{#if: {{{nameonly|}}}|Movement|[[Movement speed|Movement]]}} }}
{{#lvardef: icon | Movement Speed Icon.png}}
{{#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|}}}
{{#if: {{{count|}}}
| {{#lvardef: count | {{Distance/Transform|{{{count|}}}}} }}
| {{#lvardef: count | {{Distance | ft = {{{count|}}} }} }}
| {{#if: {{{2|}}} | {{#lvardef: count | {{Distance/Transform|{{{2|}}}}} }} }}
| {{#if: {{{2|}}} | {{#lvardef: count | {{Distance | ft = {{{2|}}} }} }} }}
}}
}}


Line 145: Line 162:
{{#lvardef: type | Level 3 Shadow Spell Slot{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }}
{{#lvardef: type | Level 3 Shadow Spell Slot{{#ifexpr: {{#lvar: isplural}} > 0 |s}} }}
{{#lvardef: icon | Shadow Spell Slot Icon.png }}
{{#lvardef: icon | Shadow Spell Slot Icon.png }}
| #default =
{{Main namespace only|[[Category:Pages with unknown resources]]}}


<!-- end switch -->
<!-- end switch -->
Line 158: Line 178:
| <!-- blank -->
| <!-- blank -->
| {{#lvar: type}}
| {{#lvar: type}}
}}</span>{{#ifeq: {{#lvar: icon}} | Alert Icon.png | [[Category:Pages with unknown resources]] }}</includeonly><noinclude>
}}</span></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''.
Line 202: Line 222:
|-
|-
| {{Resource|movement|forceplural=yes}}
| {{Resource|movement|forceplural=yes}}
| {{C|movement}}
| {{C|movement}} (no value)
|-
| {{Resource|movement m|forceplural=yes}}
| {{C|movement m}} (value in meters)
|-
| {{Resource|movement ft|forceplural=yes}}
| {{C|movement ft}} (value in feet)
|-
|-
| {{Resource|half movement|forceplural=yes}}
| {{Resource|half movement|forceplural=yes}}
Line 243: Line 269:
| {{Resource|l6|forceplural=yes}}
| {{Resource|l6|forceplural=yes}}
| {{C|l6, s6, spell6, level6}}
| {{C|l6, s6, spell6, level6}}
|-
| {{Resource|shadowlevel3|forceplural=yes}}
| {{C|shadowspell3, ss3, shadowlevel3, sl3}}
|-
|-
| {{Resource|lh|forceplural=yes}}
| {{Resource|lh|forceplural=yes}}
Line 298: Line 327:
| <pre>{{Resource | lh | icononly = yes}}</pre>
| <pre>{{Resource | lh | icononly = yes}}</pre>
|-
|-
| {{Resource | movement | count = 5}}
| {{Resource | movement m | count = 1.5}}
| <pre>{{Resource | movement | count = 5}}</pre>
| <pre>{{Resource | movement m | count = 1.5}}</pre>
|-
|-
| Costs: {{Resource | ki | count = 2 | icononly = yes}}
| Costs: {{Resource | ki | count = 2 | icononly = yes}}

Latest revision as of 05:23, 30 June 2024

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] | [nameonly] | [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 as supdie, 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.
  • nameonly
    • Show the name 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

name parameter
Resource Input
Actions action
Bonus actions bonus
Reactions reaction
Movement movement (no value)
Movement movement m (value in meters)
Movement movement ft (value in feet)
Movement (Half cost) half movement
Arcane Recovery Charges ar, arcrec, arcane recovery
Bardic Inspiration Charges bi, bardin, bardic inspiration
Channel Divinity Charges cd, chadiv, channel divinity
Channel Oath Charges co, chaoat, channel oath
Fungal Infestation Charges fi, fnginf
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
Level 3 Shadow Spell Slots shadowspell3, ss3, shadowlevel3, sl3
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 Charges wp, warpri, war priest
Wild Shape Charges ws, wldshp, wild shape
Tides of Chaos Charges toc, tides of chaos
Luck Points lp, lukpnt, luck point

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}}
1.5 m / 5 ftMovement
{{Resource | movement m | count = 1.5}}
Costs: 2
Costs: {{Resource | ki | count = 2 | icononly = yes}}
Restores: 2 Level 2 Spell Slots
Costs: {{Resource | l2 | count = 2 | nameonly = yes}}
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}}
Level 3 Shadow Spell Slot
{{Resource | type = shadowspell3 | 1 }}
1 Eyestalk Action
{{Resource | type = eyestalk | 1 }}