Template:AbilityInteraction/doc: Difference between revisions

Vergir (talk | contribs)
Create documentation for AbilityInteraction template (with help from vergir-bot LLM)
 
Vergir (talk | contribs)
Restore original wording of the text param description (with help from vergir-bot LLM)
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Usage ==
== Usage ==
{{tl|AbilityInteraction}} displays a boxed note describing how a specific ability interacts with an item or mechanic. It is intended for hero and ability pages, where several boxes are usually stacked together. Each call renders one box: a coloured header and a body.


The header colour is set by the {{code|1=type}} parameter ({{code|positive}}, {{code|negative}}, or {{code|info}}). Setting {{code|1=state=disabled}} desaturates the icon to mark an interaction that does not apply. The {{code|1=link}} parameter accepts either a bare page name or a full URL.
{{tl|AbilityInteraction}} displays a boxed note describing how an ability interacts with an item or mechanic. Under the hood it is a fancy wrapper around {{tl|IconBox}}.
 
To use this template, look at the list of possible Interactions and examples of usage below.
 
== Parameters ==
 
<templatedata>
{
"description": "",
"params": {
"interaction": {
"description": "Name of the interaction in the registry. Case-insensitive, and aliases are accepted. The Interactions section of this page lists every available name.",
"type": "string",
"required": true,
"example": "debuff resist",
"suggestedvalues": [ "(see full list below)" ]
},
"text": {
"description": "Wikitext shown in the box body. May contain wikilinks, templates such as AbilityIcon, and lists.",
"type": "content",
"required": true
},
"state": {
"description": "Omit when the interaction applies normally. Use partial when it applies only in part, disabled when it does not apply at all, or enhanced when it applies more strongly than usual.",
"type": "string",
"suggestedvalues": [ "partial", "disabled", "enhanced" ]
}
},
"paramOrder": [ "interaction", "text", "state" ],
"format": "block"
}
</templatedata>


== Examples ==
== Examples ==
=== Standard interaction ===
<pre>
{{AbilityInteraction
| interaction = Ability Duration
| text =
Affects the charge's duration and, consequently, distance the charge covers.
}}
</pre>
{{AbilityInteraction
| interaction = Ability Duration
| text =
Affects the charge's duration and, consequently, distance the charge covers.
}}
=== Enhanced interaction ===
<pre>
{{AbilityInteraction
| interaction = cooldown
| state = enhanced
| text = Cooldown reduction applies to each charge separately, so it is far more effective here than on a single-charge ability.
}}
</pre>
{{AbilityInteraction
| interaction = cooldown
| state = enhanced
| text = Cooldown reduction applies to each charge separately, so it is far more effective here than on a single-charge ability.
}}
=== Partial interaction ===
<pre>
<pre>
{{AbilityInteraction
{{AbilityInteraction
| type  = positive
| interaction = unstoppable
| file  = Healing Booster.png
| state = partial
| link  = Healing Booster
| text =
| title = Healing Booster
* Dispels and protects against [[Move Slow]].
| text  = The [[Healing]] from this ability is amplified.
* Does not dispel or protect against the accuracy debuff.
}}
}}
</pre>
</pre>
{{AbilityInteraction
{{AbilityInteraction
| type  = positive
| interaction = unstoppable
| file  = Healing Booster.png
| state = partial
| link  = Healing Booster
| text =
| title = Healing Booster
* Dispels and protects against [[Move Slow]].
| text  = The [[Healing]] from this ability is amplified.
* Does not dispel or protect against the accuracy debuff.
}}
}}
=== Disabled Interaction ===


<pre>
<pre>
{{AbilityInteraction
{{AbilityInteraction
| type  = info
| interaction = slowing hex
| file  = Slowing Hex.png
| link  = Slowing Hex
| title = Slowing Hex
| text  = This ability is '''not''' interrupted by [[Slowing Hex]].
| state = disabled
| state = disabled
| text = This ability is '''not''' interrupted by [[Slowing Hex]].
}}
}}
</pre>
</pre>
{{AbilityInteraction
{{AbilityInteraction
| type  = info
| interaction = slowing hex
| file  = Slowing Hex.png
| link  = Slowing Hex
| title = Slowing Hex
| text  = This ability is '''not''' interrupted by [[Slowing Hex]].
| state = disabled
| state = disabled
| text = This ability is '''not''' interrupted by [[Slowing Hex]].
}}
}}


<templatedata>
== Interactions ==
{
 
"description": "Displays a boxed note describing how an ability interacts with an item or mechanic. One call renders one box.",
This table is generated from the registry, so it always matches what the template accepts.
"params": {
 
"title": {
{{#invoke:AbilityInteraction|list}}
"label": "Header title",
 
"description": "Text shown in the box header.",
=== Adding an interaction ===
"type": "string",
 
"required": true
Add an entry to the {{code|REGISTRY}} table at the top of [[Module:AbilityInteraction]]. An entry should contain {{code|title}}, {{code|type}}, {{code|iconfile}}, and {{code|link}}, which pass down to the underlying {{tl|IconBox}}. The {{code|aliases}} just specifies different ways to write an interaction.
},
 
"text": {
Note that the type of the interaction (positive/negative/info) should be chosen according to whether that interaction enhances the ability (positive) or hampers it (negative).
"label": "Body text",
 
"description": "Wikitext shown in the box body. May contain wikilinks, templates such as AbilityIcon, and <br> for multiple lines.",
<noinclude>[[Category:Template documentation]]</noinclude>
"type": "content",
"required": true
},
"type": {
"label": "Colour preset",
"description": "Header colour: positive (green), negative (red), or info (blue).",
"type": "line",
"suggestedvalues": [ "positive", "negative", "info" ]
},
"file": {
"label": "Icon file",
"description": "File name of the icon image, without the File: prefix.",
"type": "wiki-file-name",
"example": "Healing Booster.png"
},
"link": {
"label": "Link target",
"description": "Where the header and icon link. A bare page name (e.g. Healing Booster) or a full URL.",
"type": "string",
"example": "Healing Booster"
},
"state": {
"label": "State",
"description": "Set to disabled to desaturate the icon.",
"type": "line",
"suggestedvalues": [ "disabled" ]
}
},
"paramOrder": [ "title", "text", "type", "file", "link", "state" ],
"format": "block"
}
</templatedata><noinclude>[[Category:Template documentation]]</noinclude>