Template:AbilityInteraction/doc: Difference between revisions

Update docs for the file to iconfile parameter rename (with help from vergir-bot LLM)
Vergir (talk | contribs)
Restore original wording of the text param description (with help from vergir-bot LLM)
 
(4 intermediate revisions by the same user 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.
{{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}}.


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.
To use this template, look at the list of possible Interactions and examples of usage below.


== Parameters ==
== Parameters ==
Line 11: Line 11:
"description": "",
"description": "",
"params": {
"params": {
"title": {
"interaction": {
"description": "Text shown in the box header.",
"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
},
"type": {
"description": "Header colour: positive (green), negative (red), or info (blue).",
"type": "string",
"type": "string",
"required": true,
"required": true,
"suggestedvalues": [ "positive", "negative", "info" ]
"example": "debuff resist",
"suggestedvalues": [ "(see full list below)" ]
},
},
"iconfile": {
"text": {
"description": "File name of the icon image, without the File: prefix.",
"description": "Wikitext shown in the box body. May contain wikilinks, templates such as AbilityIcon, and lists.",
"type": "string",
"type": "content",
"example": "Healing Booster.png",
"required": true
"required": true
},
"link": {
"description": "Where the header and icon link. A bare page name (e.g. Healing Booster) or a full URL.",
"type": "string",
"example": "Healing Booster",
"required": true
},
"text": {
"description": "Wikitext shown in the box body. May contain wikilinks, templates such as AbilityIcon, and <br> for multiple lines.",
"type": "content"
},
},
"state": {
"state": {
"description": "Set to disabled to desaturate the icon.",
"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",
"type": "string",
"suggestedvalues": [ "disabled" ]
"suggestedvalues": [ "partial", "disabled", "enhanced" ]
}
}
},
},
"paramOrder": [ "title", "text", "type", "iconfile", "link", "state" ],
"paramOrder": [ "interaction", "text", "state" ],
"format": "block"
"format": "block"
}
}
Line 51: Line 36:
== Examples ==
== Examples ==


=== Positive Interaction ===
=== Standard interaction ===


<pre>
<pre>
{{AbilityInteraction
{{AbilityInteraction
| type    = positive
| interaction = Ability Duration
| iconfile = Melee Charge.png
| text =
| link    = Melee Charge
Affects the charge's duration and, consequently, distance the charge covers.
| title    = Melee
| text     =
* This ability benefits from Melee damage bonuses and triggers relevant item effects.
* Once a T3 upgrade is acquired it's considered a Heavy Melee attack.
}}
}}
</pre>
</pre>
{{AbilityInteraction
{{AbilityInteraction
| type    = positive
| interaction = Ability Duration
| iconfile = Melee Charge.png
| text =
| link    = Melee Charge
Affects the charge's duration and, consequently, distance the charge covers.
| title    = Melee
| text     =
* This ability benefits from Melee damage bonuses and triggers relevant item effects.
* Once a T3 upgrade is acquired it's considered a Heavy Melee attack.
}}
}}


=== Negative Interaction ===
=== Enhanced interaction ===
 
<pre>
<pre>
{{AbilityInteraction
{{AbilityInteraction
| type    = negative
| interaction = cooldown
| iconfile = Debuff Reducer.png
| state = enhanced
| link    = Debuff Reducer
| text = Cooldown reduction applies to each charge separately, so it is far more effective here than on a single-charge ability.
| title    = Debuff Resist
}}
| text     =
</pre>
[[Debuff Resist]] shortens the duration of movement slow and accuraccy debuff.
{{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 ===


The duration of damage-over-time effect is '''not''' shortened.
<pre>
{{AbilityInteraction
| interaction = unstoppable
| state = partial
| text =
* Dispels and protects against [[Move Slow]].
* Does not dispel or protect against the accuracy debuff.
}}
}}
</pre>
</pre>
{{AbilityInteraction
{{AbilityInteraction
| type    = negative
| interaction = unstoppable
| iconfile = Debuff Reducer.png
| state = partial
| link    = Debuff Reducer
| text =
| title    = Debuff Resist
* Dispels and protects against [[Move Slow]].
| text     =
* Does not dispel or protect against the accuracy debuff.
[[Debuff Resist]] shortens the duration of movement slow and accuraccy debuff.
 
The duration of damage-over-time effect is '''not''' shortened.
}}
}}


=== Neutral interaction with disabled state ===
=== Disabled Interaction ===


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


<noinclude>[[Category:Template documentation]]</noinclude>
<noinclude>[[Category:Template documentation]]</noinclude>