Template:Spell action: Difference between revisions

From bg3.wiki
Jump to navigation Jump to search
(Created page with "<includeonly>{{#cargo_query: tables = spells | fields = _pageName = link, name, action_type, CONCAT("{{{recharge|}}}")=recharge, CONCAT("Cast as a level {{{level|}}} spell")=description, CONCAT("{{#replace:{{#replace:{{#replace:{{#replace:{{{1}}}|:|}}|/|<nowiki/> <nowiki/>}}|(|<nowiki/> <nowiki/>}}|)|<nowiki/> <nowiki/>}} Icon.webp")=icon | where = _pageName = "{{#replace: {{{1}}} | " | \" }}" | format = template | template = ClassAction/Format | named args = yes }}</inc...")
 
(Added support for alias using second parameter)
 
(18 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<includeonly>{{#cargo_query: tables = spells
<includeonly>{{#cargo_query: tables = spells
| fields = _pageName = link, name, action_type, CONCAT("{{{recharge|}}}")=recharge, CONCAT("Cast as a level {{{level|}}} spell")=description, CONCAT("{{#replace:{{#replace:{{#replace:{{#replace:{{{1}}}|:|}}|/|<nowiki/> <nowiki/>}}|(|<nowiki/> <nowiki/>}}|)|<nowiki/> <nowiki/>}} Icon.webp")=icon
| fields = _pageName = link, name, cost, hit_cost, description, {{#if: {{{2|}}} | CONCAT("{{{2}}}")=alias}}, {{#if: {{{recharge|}}} | CONCAT("{{{recharge}}}")=recharge | recharge}}, {{#if: {{{level|}}} | CONCAT("{{{level}}}")=level | spell_level=level}}, controller_icon=icon, {{#if: {{{cost|}}}{{{action type|}}} | CONCAT("{{{cost| {{{action type|}}} }}}")=cost }}
| where = _pageName = "{{#replace: {{{1}}} | " | \" }}"
| where = _pageName = "{{#replace: {{{1}}} | " | \" }}"
| format = template
| format = template
| template = ClassAction/Format
| template = Spell action/format
| named args = yes
| named args = yes
}}</includeonly><noinclude>
| default = [[{{{1}}}]]{{Main namespace only|[[Category:Pages with unknown abilities]]}}
}}</includeonly><noinclude>{{Documentation|content=
Use this to display a spell as a class action on an equipment page.  Examples follow.
Use this to display a spell as a class action on an equipment page.  Examples follow.


This template just runs the Cargo query; see [[Template:ClassAction/Format]] for the formatting.
This template just runs the Cargo query; see [[Template:Spell action/format]] for the formatting.


----
For displaying spells or actions in a more detailed format, see {{t link|Feature box}}.
 
Usage:
 
<pre>
{{SpellAction | Hunter's Mark | level=1 | recharge=Long Rest }}
</pre>
 
Result:
 
{{SpellAction | Hunter's Mark | level=1 | recharge=Long Rest }}
 
----
 
Usage:
 
<pre>
{{SpellAction | Haste | level=3 | recharge=Short Rest }}
</pre>
 
Result:
 
{{SpellAction | Haste | level=3 | recharge=Short Rest }}
 
[[Category:Templates]]


== Examples ==
{{Template demo
|<nowiki>{{SpellAction|Hunter's Mark|level=1|recharge=Long Rest}}</nowiki>
|<nowiki>{{SpellAction|Click Heels}}</nowiki>
|<nowiki>{{SpellAction|Click Heels|Bonus Dash}}</nowiki>
|<nowiki>{{SpellAction|True Strike|level=0|recharge=Short Rest|action type=Bonus}}</nowiki>
|<nowiki>{{SpellAction|Absorb Elements|recharge=Short Rest}}</nowiki>
|<nowiki>{{SpellAction|Fire Shield: Warm|recharge=Long Rest|cost=bonus}}</nowiki>
}}
== Template data ==
== Template data ==
<templatedata>
<templatedata>
Line 45: Line 31:
"type": "string",
"type": "string",
"required": true
"required": true
},
"2": {
"label": "alias",
"description": "If specified, replaces the name queried from the table",
"type": "string"
},
},
"level": {
"level": {
Line 61: Line 52:
"paramOrder": [
"paramOrder": [
"1",
"1",
        "2",
"level",
"level",
         "recharge"
         "recharge"
]
]
}
}
</templatedata></noinclude>
</templatedata>
}}
[[Category:Templates]]
[[Category:Cargo templates]]
</noinclude>

Latest revision as of 17:12, 12 February 2025

Template documentation

Use this to display a spell as a class action on an equipment page. Examples follow.

This template just runs the Cargo query; see Template:Spell action/format for the formatting.

For displaying spells or actions in a more detailed format, see {{Feature box}}.

Examples

Markup Renders as
{{SpellAction|Hunter's Mark|level=1|recharge=Long Rest}}
Hunter's Mark Hunter's Mark (+ )
Cast as a level 1 spell ( Recharge: Long rest.)
{{SpellAction|Click Heels}}
Click Heels Click Heels ()
Click the heels of your boots to gain speed and freedom of movement.
{{SpellAction|Click Heels|Bonus Dash}}
Bonus Dash Bonus Dash ()
Click the heels of your boots to gain speed and freedom of movement.
{{SpellAction|True Strike|level=0|recharge=Short Rest|action type=Bonus}}
True Strike True Strike ()
Cast as a cantrip ( Recharge: Short rest.)
{{SpellAction|Absorb Elements|recharge=Short Rest}}
Absorb Elements Absorb Elements ()
Absorb elemental damage once per Short Rest. Take half damage from the next elemental attack targeting you, and deal an additional 1d6 of that element type on your next attack. ( Recharge: Short rest.)
{{SpellAction|Fire Shield: Warm|recharge=Long Rest|cost=bonus}}
Fire Shield: Warm Fire Shield: Warm ()
Cast as a level 4 spell ( Recharge: Long rest.)

Template data

No description.

Template parameters

ParameterDescriptionTypeStatus
name1

The name of the spell

Stringrequired
alias2

If specified, replaces the name queried from the table

Stringoptional
levellevel

The level the spell is cast at.

Default
1
Numberoptional
rechargerecharge

How often this spell refreshes

Default
Stringoptional