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)
 
(Changed the input format to "type:count" instead of "count type")
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 25: Line 21:
! Input
! Input
|-
|-
|{{ResourceList|bonus, 30 movement}}||<pre>{{ResourceList|bonus, 30 movement}}</pre>
|{{ResourceList|bonus, movement:30}}||<pre>{{ResourceList|bonus, movement:30}}</pre>
|-
|-
|{{ResourceList|action, 3 ki}}||<pre>{{ResourceList|action, 3 ki}}</pre>
|{{ResourceList|action, ki:3}}||<pre>{{ResourceList|action, ki:3}}</pre>
|-
|-
|{{ResourceList|action, bonus, level1}}||<pre>{{ResourceList|action, bonus, level1}}</pre>
|{{ResourceList|action, bonus, level1}}||<pre>{{ResourceList|action, bonus, level1}}</pre>
|}
|}
</noinclude>
</noinclude>

Revision as of 02:51, 14 November 2023

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

Output Input
Bonus action + (ERROR: Use movement m or movement ft.)Movement
{{ResourceList|bonus, movement:30}}
Action + 3Ki Points
{{ResourceList|action, ki:3}}
Action + Bonus action + Level 1 Spell Slot
{{ResourceList|action, bonus, level1}}