Template:ResourceList: Difference between revisions

From bg3.wiki
Jump to navigation Jump to search
(Template to nicely handle resource cost for actions with multiple costs)
 
m (Use {{Template demo}})
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly>{{#replace:
<includeonly>{{#invoke: ParseList
  {{#invoke: ParseList
     | main  
     | main  
     | {{{1}}}
     | {{{1}}}
     | useTemplate = ResourceSimple
     | useTemplate = ResourceHelper
     | type = simpleList
     | textDelim = <nowiki> + </nowiki>
  }}
  | ,
  | <nowiki/> +
}}</includeonly><noinclude>
}}</includeonly><noinclude>
=What is this?=
=What is this?=
Line 14: Line 10:
This is intended for use in [[Template:Action_Page]] and similar.
This is intended for use in [[Template:Action_Page]] and similar.
=Usage=
=Usage=
<pre>{{ResourceList | [count] <type> [, [count] <type>]}}</pre>
<pre>{{ResourceList | <type>:[count] [, <type>:[count]]}}</pre>
----
----
<br/><code><></code> Denotes mandatory parameters, <code>[]</code> denotes optional parameters.
<br/><code><></code> Denotes mandatory parameters, <code>[]</code> denotes optional parameters.
Line 21: Line 17:


=Examples=
=Examples=
{| class="wikitable mw-collapsible"
{{Template demo
! Output
| style=table
! Input
|<nowiki>{{ResourceList|bonus, movement m:9}}</nowiki>
|-
|<nowiki>{{ResourceList|action, ki:3}}</nowiki>
|{{ResourceList|bonus, 30 movement}}||<pre>{{ResourceList|bonus, 30 movement}}</pre>
|<nowiki>{{ResourceList|action, bonus, level1}}</nowiki>
|-
}}
|{{ResourceList|action, 3 ki}}||<pre>{{ResourceList|action, 3 ki}}</pre>
|-
|{{ResourceList|action, bonus, level1}}||<pre>{{ResourceList|action, bonus, level1}}</pre>
|}
</noinclude>
</noinclude>

Latest revision as of 17:27, 2 October 2024

What is this?

This is a wrapper around Template:Resource that produces a formatted total resource cost from a list costs.

This is intended for use in Template:Action_Page and similar.

Usage

{{ResourceList | <type>:[count] [, <type>:[count]]}}


<> Denotes mandatory parameters, [] denotes optional parameters.

Refer to Template:Resource for a list of the handled resource types.

Examples

Markup Renders as
{{ResourceList|bonus, movement m:9}}
Bonus action + 9 m / 30 ftMovement
{{ResourceList|action, ki:3}}
Action + 3Ki Points
{{ResourceList|action, bonus, level1}}
Action + Bonus action + Level 1 Spell Slot