Template:Spell action: Difference between revisions

From bg3.wiki
Jump to navigation Jump to search
(Updated doc)
mNo edit summary
 
(20 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly>{{#cargo_query: tables = spells
<includeonly>{{#cargo_query: tables = spells
| fields = _pageName = link, name, action_type, description, CONCAT("{{{recharge|}}}")=recharge, CONCAT("{{{level|}}}")=level, CONCAT("{{#replace:{{#replace:{{#replace:{{#replace:{{{1}}}|:|}}|/|<nowiki/> <nowiki/>}}|(|<nowiki/> <nowiki/>}}|)|<nowiki/> <nowiki/>}} Icon.webp")=icon, {{#if: {{{action type|}}} | CONCAT("{{{action type|}}}")=action type }}
| fields = _pageName = link, name, cost, hit_cost, description, extra_description, {{#if: {{{2|}}} | CONCAT("{{{2}}}")=alias}}, {{#if: {{{nolist|}}} | CONCAT("{{{nolist}}}")=nolist}}, {{#if: {{{extra|}}} | CONCAT("{{{extra}}}")=extra}}, {{#if: {{{w|}}} | CONCAT("{{{w}}}")=size}}, {{#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 }}, {{#if: {{{hit cost|}}} | CONCAT("{{{hit cost|}}}")=hit 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}}.


== Examples ==
== Examples ==
{{Template demo
{{Template demo
|<nowiki>{{SpellAction|Hunter's Mark|level=1|recharge=Long Rest}}</nowiki>
|<nowiki>{{SpellAction|Hunter's Mark|level=1|recharge=Long Rest}}</nowiki>
|<nowiki>{{SpellAction|Haste|level=3|recharge=Short 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|True Strike|level=0|recharge=Short Rest|action type=Bonus}}</nowiki>
|<nowiki>{{SpellAction|Absorb Elements|recharge=Short Rest}}</nowiki>
|<nowiki>{{SpellAction|Absorb Elements|recharge=Short Rest}}</nowiki>
|<nowiki>{{SpellAction|Intimidating Presence|extra=y}}</nowiki>
|<nowiki>{{SpellAction|Fire Shield: Warm|recharge=Long Rest|cost=bonus}}</nowiki>
|<nowiki>{{SpellAction|Searing Smite|hit cost=bonus}}</nowiki>
}}
}}
[[Category:Templates]]
== Template data ==
== Template data ==
<templatedata>
<templatedata>
Line 30: Line 34:
"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 40: Line 49:
"label": "recharge",
"label": "recharge",
"description": "How often this spell refreshes",
"description": "How often this spell refreshes",
"type": "string",
"default": ""
},
"w": {
"label": "w",
"description": "Size of the icon. Defaults to 40 if empty",
"type": "number",
"default": ""
},
"extra": {
"label": "extra",
"description": "If specified, displays the extra description as well (if it has one)",
"type": "string",
"default": ""
},
"nolist": {
"label": "nolist",
"description": "If specified, does not wrap the definition in <dl> tags, allowing it to be embedded in other lists",
"type": "string",
"type": "string",
"default": ""
"default": ""
Line 46: Line 73:
"paramOrder": [
"paramOrder": [
"1",
"1",
        "2",
"level",
"level",
         "recharge"
         "recharge",
        "w",
        "extra",
        "nolist"
]
]
}
}
</templatedata></noinclude>
</templatedata>
}}
[[Category:Templates]]
[[Category:Cargo templates]]
</noinclude>

Latest revision as of 23:30, 21 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|Intimidating Presence|extra=y}}
Intimidating Presence Intimidating Presence ()
Menace an enemy and instill a terrible Fear Fear within them.
You can use Maintain Intimidating Presence Maintain Intimidating Presence to prolong the target's fear.
{{SpellAction|Fire Shield: Warm|recharge=Long Rest|cost=bonus}}
Fire Shield: Warm Fire Shield: Warm ()
Cast as a level 4 spell ( Recharge: Long rest.)
{{SpellAction|Searing Smite|hit cost=bonus}}
Searing Smite Searing Smite (+ )
Cast as a level 1 spell at will.

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
ww

Size of the icon. Defaults to 40 if empty

Default
Numberoptional
extraextra

If specified, displays the extra description as well (if it has one)

Default
Stringoptional
nolistnolist

If specified, does not wrap the definition in <dl> tags, allowing it to be embedded in other lists

Default
Stringoptional