Template:Feature box: Difference between revisions
(Examples use template demo) |
m (Fixed hit cost override) |
||
(15 intermediate revisions by 2 users not shown) | |||
Line 4: | Line 4: | ||
image, | image, | ||
controller_icon, | controller_icon, | ||
damage, | damage, | ||
damage_type, | damage_type, | ||
damage_modifier, | |||
extra_damage, | extra_damage, | ||
extra_damage_type, | extra_damage_type, | ||
extra_damage_modifier, | |||
extra_damage_2, | |||
extra_damage_type_2, | |||
extra_damage_modifier_2, | |||
extra_damage_3, | |||
extra_damage_type_3, | |||
extra_damage_modifier_3, | |||
description, | description, | ||
extra_description, | |||
save, | save, | ||
spell_range = range, | spell_range = range, | ||
aoe, | aoe, | ||
aoe_size = area, | aoe_size = area, | ||
recharge, | CONCAT("{{{item|{{{weapon|}}}}}}")=weapon, | ||
CONCAT("{{{ | |||
<!-- Overrides for various fields. These are useful since NPC-specific versions of spells will often differ slightly | |||
such as removal of spell slot cost --> | |||
<!-- The #ifeq: {{{var|+}}} | {{{var|-}}} pattern is used to distinguish between unspecified parameters and deliberately | |||
blank ones. See https://www.mediawiki.org/wiki/Help:Parser_functions_in_templates#Testing_and_passing_undefined_parameters --> | |||
{{#ifeq: {{{cost|+}}} | {{{cost|-}}} | CONCAT("{{{cost|}}}")=cost | cost }}, | |||
{{#ifeq: {{{hit cost|+}}} | {{{hit cost|-}}} | CONCAT("{{{hit cost|}}}")=hit cost | hit_cost }}, | |||
{{#ifeq: {{{recharge|+}}} | {{{recharge|-}}} | CONCAT("{{{recharge|}}}")=recharge | recharge }}, | |||
<!-- The character-str, etc. variables are set by {{Template:Infobox character}} and allow feature | |||
boxes included on character pages to use specific ability score values by default --> | |||
CONCAT("{{{str| {{#var: character-str}} }}}")=str, | |||
CONCAT("{{{dex| {{#var: character-dex}} }}}")=dex, | |||
CONCAT("{{{con| {{#var: character-con}} }}}")=con, | |||
CONCAT("{{{wis| {{#var: character-wis}} }}}")=wis, | |||
CONCAT("{{{int| {{#var: character-int}} }}}")=int, | |||
CONCAT("{{{cha| {{#var: character-cha}} }}}")=cha, | |||
CONCAT("{{{level| {{#var: character-level}} }}}")=level, | |||
CONCAT("{{{casting ability| {{#var: character-casting-ability}} }}}")=casting_ability, | |||
| where = _pageName = "{{#replace: {{{link|{{{name|{{{1}}}}}}}}} | " | \" }}" | | where = _pageName = "{{#replace: {{{link|{{{name|{{{1}}}}}}}}} | " | \" }}" | ||
| format = template | | format = template | ||
| template = Feature box/format | | template = Feature box/format | ||
| named args = yes | | named args = yes | ||
| limit = 1 | |||
| order by = _ID | |||
| more results text= | |||
| default = [[{{{1}}}]][[Category:Pages with unknown abilities]] | | default = [[{{{1}}}]][[Category:Pages with unknown abilities]] | ||
}}</includeonly><noinclude> | }}</includeonly><noinclude>{{Documentation|content= | ||
Creates a box to display a creature's special abilities, attacks, and spells. It is intended for use on creature pages, rather than being pages of their own. | Creates a box to display a creature's special abilities, attacks, and spells. It is intended for use on creature pages, rather than being pages of their own. | ||
You can use it with any weapon action, spell, or class action. | You can use it with any weapon action, spell, or class action. | ||
For a more compact, less detailed template, see {{t link|Spell action}}. | |||
== Examples == | == Examples == | ||
Line 35: | Line 66: | ||
| <nowiki>{{Feature box|Multiattack (Spaw)}}</nowiki> | | <nowiki>{{Feature box|Multiattack (Spaw)}}</nowiki> | ||
| caption 3 = Weapon action example. | | caption 3 = Weapon action example. | ||
| <nowiki> | | <nowiki>{{Feature box|Hellflame Cleave|item=Hellfire Greataxe}}</nowiki> | ||
| caption 4 = Example with many damage parameters | |||
| <nowiki>{{Feature box|Multiattack (Water Elemental)|str=18}}</nowiki> | |||
| caption 5 = Example with cost override | |||
| <nowiki>{{Feature box|Wrathful Smite|item=Deva Mace|hit cost=|str=18|recharge=Per turn}}</nowiki> | |||
}} | }} | ||
==Template data== | ==Template data== | ||
<templatedata> | <templatedata> | ||
{ | { | ||
"description": "Display a box containing information about a feature such as a spell or weapon action", | |||
"params": { | "params": { | ||
"1": { | "1": { | ||
"description": "The | "label": "Ability name", | ||
"type": " | "aliases": ["link", "name"], | ||
"description": "The name of the ability to display in the feature box.", | |||
"type": "wiki-page-name", | |||
"required": true | "required": true | ||
}, | |||
"cost": { | |||
"label": "Cost override", | |||
"description": "Override the cost of an action. This is a comma separated list of resources. See Template:ResourceList for details.", | |||
"type": "string", | |||
"required": false | |||
}, | |||
"hit cost": { | |||
"label": "Hit cost override", | |||
"description": "Override the on-hit cost of an action. This is a comma separated list of resources. See Template:ResourceList for details.", | |||
"type": "string", | |||
"required": false | |||
}, | |||
"recharge": { | |||
"label": "Recharge override", | |||
"description": "Override the recharge time of an action.", | |||
"type": "string", | |||
"required": false | |||
}, | |||
"weapon": { | |||
"label": "Weapon name", | |||
"aliases": ["item"], | |||
"description": "The weapon this ability is performed with. Specifying this replaces generic 'Normal weapon damage' text with specific values for that weapon.", | |||
"type": "string", | |||
"required": false | |||
}, | |||
"str": { | |||
"label": "Strength score", | |||
"description": "The strength score used for this ability. Specifying this replaces any 'Strength modifier' text with the specific value.", | |||
"type": "number", | |||
"required": false | |||
}, | |||
"dex": { | |||
"label": "Dexterity score", | |||
"description": "The dexterity score used for this ability. Specifying this replaces any 'Dexterity modifier' text with the specific value.", | |||
"type": "number", | |||
"required": false | |||
}, | |||
"con": { | |||
"label": "Constitution score", | |||
"description": "The constitution score used for this ability. Specifying this replaces any 'Constitution modifier' text with the specific value.", | |||
"type": "number", | |||
"required": false | |||
}, | |||
"wis": { | |||
"label": "Wisdom score", | |||
"description": "The wisdom score used for this ability. Specifying this replaces any 'Wisdom modifier' text with the specific value.", | |||
"type": "number", | |||
"required": false | |||
}, | |||
"int": { | |||
"label": "Intelligence score", | |||
"description": "The intelligence score used for this ability. Specifying this replaces any 'Intelligence modifier' text with the specific value.", | |||
"type": "number", | |||
"required": false | |||
}, | |||
"cha": { | |||
"label": "Charisma score", | |||
"description": "The charisma score used for this ability. Specifying this replaces any 'Charisma modifier' text with the specific value.", | |||
"type": "number", | |||
"required": false | |||
}, | |||
"casting ability": { | |||
"label": "Casting ability", | |||
"description": "The casting ability used. Specifying this replaces any 'Spellcasting modifier' text with the specific value. The corresponding ability score should also be specified.", | |||
"type": "string", | |||
"required": false | |||
}, | |||
"level": { | |||
"label": "Character level", | |||
"description": "The level of the character using this ability. Specifying this replaces any 'Proficiency bonus' text with the specific value.", | |||
"type": "number", | |||
"required": false | |||
} | } | ||
} | } | ||
} | } | ||
</templatedata></noinclude> | </templatedata> | ||
}} | |||
[[Category:Templates]] | |||
</noinclude> |
Latest revision as of 20:11, 23 March 2025
Creates a box to display a creature's special abilities, attacks, and spells. It is intended for use on creature pages, rather than being pages of their own.
You can use it with any weapon action, spell, or class action.
For a more compact, less detailed template, see {{Spell action}}.
Examples
Spell example.
Markup{{Feature box|Hypnotic Pattern}}Renders as
Class action example.
Markup{{Feature box|Multiattack (Spaw)}}Renders as
Weapon action example.
Markup{{Feature box|Hellflame Cleave|item=Hellfire Greataxe}}Renders as
Example with many damage parameters
Markup{{Feature box|Multiattack (Water Elemental)|str=18}}Renders as
Example with cost override
Markup{{Feature box|Wrathful Smite|item=Deva Mace|hit cost=|str=18|recharge=Per turn}}Renders as
Template data
Display a box containing information about a feature such as a spell or weapon action
Parameter | Description | Type | Status | |
---|---|---|---|---|
Ability name | 1 link name | The name of the ability to display in the feature box. | Page name | required |
Cost override | cost | Override the cost of an action. This is a comma separated list of resources. See Template:ResourceList for details. | String | optional |
Hit cost override | hit cost | Override the on-hit cost of an action. This is a comma separated list of resources. See Template:ResourceList for details. | String | optional |
Recharge override | recharge | Override the recharge time of an action. | String | optional |
Weapon name | weapon item | The weapon this ability is performed with. Specifying this replaces generic 'Normal weapon damage' text with specific values for that weapon. | String | optional |
Strength score | str | The strength score used for this ability. Specifying this replaces any 'Strength modifier' text with the specific value. | Number | optional |
Dexterity score | dex | The dexterity score used for this ability. Specifying this replaces any 'Dexterity modifier' text with the specific value. | Number | optional |
Constitution score | con | The constitution score used for this ability. Specifying this replaces any 'Constitution modifier' text with the specific value. | Number | optional |
Wisdom score | wis | The wisdom score used for this ability. Specifying this replaces any 'Wisdom modifier' text with the specific value. | Number | optional |
Intelligence score | int | The intelligence score used for this ability. Specifying this replaces any 'Intelligence modifier' text with the specific value. | Number | optional |
Charisma score | cha | The charisma score used for this ability. Specifying this replaces any 'Charisma modifier' text with the specific value. | Number | optional |
Casting ability | casting ability | The casting ability used. Specifying this replaces any 'Spellcasting modifier' text with the specific value. The corresponding ability score should also be specified. | String | optional |
Character level | level | The level of the character using this ability. Specifying this replaces any 'Proficiency bonus' text with the specific value. | Number | optional |