Editing Template:AbilityInteraction/docGive feedback
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
| Latest revision | Your text | ||
| Line 1: | Line 1: | ||
== Usage == | == Usage == | ||
{{tl|AbilityInteraction}} displays a boxed note describing how an ability interacts with an item or mechanic. | {{tl|AbilityInteraction}} displays a boxed note describing how an ability interacts with an item or mechanic. It is meant for the {{code|1=interactions}} parameter of {{tl|AbilitySection}}. | ||
The interaction is chosen by name from a registry in [[Module:AbilityInteraction]], which supplies the header text, color, icon, and link. Call sites supply only the body text and, where relevant, a state. | |||
Nothing else is customizable, and that is deliberate: it keeps a given mechanic looking identical everywhere it appears. A box that needs custom presentation should use {{tl|IconBox}} directly rather than adding parameters here. | |||
Setting {{code|1=state{{=}}disabled}} always produces a neutral (blue) header, whatever type the registry entry declares. A disabled box means the interaction does not apply, so it carries no positive or negative meaning. | |||
== Parameters == | == Parameters == | ||
| Line 9: | Line 13: | ||
<templatedata> | <templatedata> | ||
{ | { | ||
"description": "", | "description": "A boxed note describing how an ability interacts with an item or mechanic. Presentation comes from a registry in Module:AbilityInteraction.", | ||
"params": { | "params": { | ||
"interaction": { | "interaction": { | ||
| Line 16: | Line 20: | ||
"required": true, | "required": true, | ||
"example": "debuff resist", | "example": "debuff resist", | ||
"suggestedvalues": [ " | "suggestedvalues": [ "debuff resist", "dispel", "indomitable", "slowing hex", "unstoppable" ] | ||
}, | }, | ||
"text": { | "text": { | ||
| Line 24: | Line 28: | ||
}, | }, | ||
"state": { | "state": { | ||
"description": "Omit when the interaction applies normally. Use partial when it applies only in part, disabled when it does not apply at all | "description": "Omit when the interaction applies normally. Use partial when it applies only in part, or disabled when it does not apply at all.", | ||
"type": "string", | "type": "string", | ||
"suggestedvalues": [ "partial", "disabled | "suggestedvalues": [ "partial", "disabled" ] | ||
} | } | ||
}, | }, | ||
| Line 33: | Line 37: | ||
} | } | ||
</templatedata> | </templatedata> | ||
An unrecognized {{code|1=interaction}} renders a visible error in place of the box. An unrecognized {{code|1=state}} does not — it renders as though no state were given. | |||
== Interactions == | |||
This table is generated from the registry, so it always matches what the template accepts. | |||
{{#invoke:AbilityInteraction|list}} | |||
== Adding an interaction == | |||
Add an entry to the {{code|REGISTRY}} table at the top of [[Module:AbilityInteraction]]. Each entry sets {{code|aliases}}, {{code|title}}, {{code|type}}, {{code|iconfile}}, and {{code|link}}. The table above and the parameter suggestions update on their own. | |||
The registry key and its aliases are matched in lower case. Aliases are assumed not to collide with each other. | |||
== Examples == | == Examples == | ||
| Line 40: | Line 58: | ||
<pre> | <pre> | ||
{{AbilityInteraction | {{AbilityInteraction | ||
| interaction = | | interaction = dispel | ||
| text = | | text = | ||
* Any dispel immediately "drops" the target off the cart. | |||
}} | }} | ||
</pre> | </pre> | ||
{{AbilityInteraction | {{AbilityInteraction | ||
| interaction = | | interaction = dispel | ||
| text = | | text = | ||
* Any dispel immediately "drops" the target off the cart. | |||
}} | }} | ||
| Line 85: | Line 88: | ||
}} | }} | ||
=== | === Interaction that does not apply === | ||
<pre> | <pre> | ||
| Line 99: | Line 102: | ||
| text = This ability is '''not''' interrupted by [[Slowing Hex]]. | | text = This ability is '''not''' interrupted by [[Slowing Hex]]. | ||
}} | }} | ||
<noinclude>[[Category:Template documentation]]</noinclude> | <noinclude>[[Category:Template documentation]]</noinclude> | ||