Template:Feature box: Difference between revisions

Jump to navigation Jump to search
(including the alias parameter into the template maker)
(Updated Feature box to now query from the spells cargo table.)
Line 1: Line 1:
<includeonly>{{TooltipBox|{{SAI|{{{link|{{{name}}}}}}|{{{name}}}|w=40}}|image={{{image name|{{#replace:{{#replace:{{#replace:{{#replace:{{{link|{{{name}}}}}}|:|}}|/|}}|(|}}|)|}}.webp}}}|w=100|
<includeonly>{{#cargo_query: tables = spells
{{{1}}}
| fields = _pageName = link,
  name,
  image,
  controller_icon,
  action_type,
  damage,
  damage_type,
  extra_damage,
  extra_damage_type,
  description,
  save,
  spell_range = range,
  aoe,
  aoe_size = area,
  recharge
| where = _pageName = "{{#replace: {{{1}}} | " | \" }}"
| format = template
| template = Feature box/format
| named args = yes
| default = [[{{{1}}}]]
}}</includeonly><noinclude>
}}</includeonly><noinclude>
Creates a box to display enemy features such as special abilities and attacks. It is intended for use on creature pages, rather than being pages of their own. For player features, use [[Template:ActionPage]].
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.  


The icon uses the [[Template:SAI|SAI]] template. The version without integrated SAI is [[Template:TooltipBox]]. If no image name is provided, the template will attempt to use {{c|NAME.webp}} as the righthand-side image.
You can use it with any weapon action, spell, or class action.


If the link name contains {{InfoBlob|:}}, {{InfoBlob|/}}, {{InfoBlob|(}} or {{InfoBlob|)}}, they will be removed in the icon name.
== Examples ==


Copy-ready example:<pre>
Spell:
{{Feature box
<pre>{{Feature box|Hypnotic Pattern}}</pre>
|name=
{{Feature box|Hypnotic Pattern}}
|link=
|image name=
|
}}
</pre>


Example:
Class action:
{{Feature box
<pre>{{Feature box|Multiattack (Spaw)}}</pre>
|name=Strengthened Shillelagh
{{Feature box|Multiattack (Spaw)}}
|image name=Strengthened Shillelagh.webp
|* The Dryad's [[Quarterstaff|staff]] or [[club]] deals {{DamageText|4d8|Bludgeoning}} damage, and uses your [[Ability Score Modifier|Spellcasting Ability]] for {{Attack Roll}}s.
}}


Example with alias link:
Weapon action:
{{Feature box|name=Death Burst|link=Death Burst (Mud)
<pre>{{Feature box|Hellflame Cleave}}</pre>
|{{DamageInfo|4d6|Bludgeoning}}
{{Feature box|Hellflame Cleave}}
* Explode in a burst of sticky mud. It dries instantly on any nearby creatures not made of mud, {{Cond|Muddy|Restraining}} and hurting them for {{DamageText|4d6|Bludgeoning}} damage.
}}
==Template data==
==Template data==


Line 40: Line 49:
"type": "content",
"type": "content",
"required": true
"required": true
},
"name": {
"description": "The name of the ability. ",
"type": "string",
"required": true
},
        "link": {
        "description": "The link to the ability, if different from the name you want to display.",
            "type": "string"
        },
"image name": {
"description": "An override for the image to use on the right-hand side.",
"default": "{{{name}}}.webp"
}
}
},
},
"paramOrder": [
"paramOrder": [
"name",
"image name",
        "link",
"1"
"1"
]
]
}
}
</templatedata></noinclude>
</templatedata></noinclude>