Template:AbilityInteraction/doc: Difference between revisions

From The Deadlock Wiki
Jump to navigation Jump to search
Vergir (talk | contribs)
Rewrite for the interaction registry: three parameters, self-generating registry table, and a pointer to IconBox for custom boxes (with help from vergir-bot LLM)
Vergir (talk | contribs)
Restore original wording of the text param description (with help from vergir-bot LLM)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Usage ==
== Usage ==


{{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}}.
{{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 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.
To use this template, look at the list of possible Interactions and examples of usage below.
 
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 13: Line 9:
<templatedata>
<templatedata>
{
{
"description": "A boxed note describing how an ability interacts with an item or mechanic. Presentation comes from a registry in Module:AbilityInteraction.",
"description": "",
"params": {
"params": {
"interaction": {
"interaction": {
Line 20: Line 16:
"required": true,
"required": true,
"example": "debuff resist",
"example": "debuff resist",
"suggestedvalues": [ "debuff resist", "dispel", "indomitable", "slowing hex", "unstoppable" ]
"suggestedvalues": [ "(see full list below)" ]
},
},
"text": {
"text": {
Line 28: Line 24:
},
},
"state": {
"state": {
"description": "Omit when the interaction applies normally. Use partial when it applies only in part, or disabled when it does not apply at all.",
"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": [ "partial", "disabled" ]
"suggestedvalues": [ "partial", "disabled", "enhanced" ]
}
}
},
},
Line 37: Line 33:
}
}
</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 58: Line 40:
<pre>
<pre>
{{AbilityInteraction
{{AbilityInteraction
| interaction = dispel
| interaction = Ability Duration
| text =
| text =
* Any dispel immediately "drops" the target off the cart.
Affects the charge's duration and, consequently, distance the charge covers.
}}
}}
</pre>
</pre>
{{AbilityInteraction
{{AbilityInteraction
| interaction = dispel
| interaction = Ability Duration
| text =
| text =
* Any dispel immediately "drops" the target off the cart.
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.
}}
}}


Line 88: Line 85:
}}
}}


=== Interaction that does not apply ===
=== Disabled Interaction ===


<pre>
<pre>
Line 102: Line 99:
| text = This ability is '''not''' interrupted by [[Slowing Hex]].
| 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>

Latest revision as of 10:20, 2 August 2026

{{AbilityInteraction}} displays a boxed note describing how an ability interacts with an item or mechanic. Under the hood it is a fancy wrapper around {{IconBox}}.

To use this template, look at the list of possible Interactions and examples of usage below.

Parameters

[edit source]

Template parameters

This template prefers block formatting of parameters.

ParameterDescriptionTypeStatus
interactioninteraction

Name of the interaction in the registry. Case-insensitive, and aliases are accepted. The Interactions section of this page lists every available name.

Suggested values
(see full list below)
Example
debuff resist
Stringrequired
texttext

Wikitext shown in the box body. May contain wikilinks, templates such as AbilityIcon, and lists.

Contentrequired
statestate

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.

Suggested values
partial disabled enhanced
Stringoptional

Examples

[edit source]

Standard interaction

[edit source]
{{AbilityInteraction
| interaction = Ability Duration
| text =
Affects the charge's duration and, consequently, distance the charge covers.
}}
Ability Duration

Affects the charge's duration and, consequently, distance the charge covers.

Enhanced interaction

[edit source]
{{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.
}}
Ability Cooldown Reduction

Cooldown reduction applies to each charge separately, so it is far more effective here than on a single-charge ability.

Partial interaction

[edit source]
{{AbilityInteraction
| interaction = unstoppable
| state = partial
| text =
* Dispels and protects against [[Move Slow]].
* Does not dispel or protect against the accuracy debuff.
}}
Unstoppable
  • Dispels and protects against Move Slow.
  • Does not dispel or protect against the accuracy debuff.

Disabled Interaction

[edit source]
{{AbilityInteraction
| interaction = slowing hex
| state = disabled
| text = This ability is '''not''' interrupted by [[Slowing Hex]].
}}
Slowing Hex

This ability is not interrupted by Slowing Hex.

Interactions

[edit source]

This table is generated from the registry, so it always matches what the template accepts.

Interaction Example
ability duration / duration / duration extender
Ability Duration

Example text.

ability range / range / greater expansion
Ability Range

Example text.

cooldown / ability cooldown / superior cooldown
debuff resist / debuff reducer
Debuff Resist

Example text.

dispel / dispel magic / purge / cleanse
Dispel

Example text.

echo shard
Echo Shard

Example text.

heal / healing / healing booster
Healing

Example text.

heroic aura
Heroic Aura

Example text.

indomitable
Indomitable

Example text.

interrupt / knockdown / stun
Interrupt

Example text.

monster rounds
Monster Rounds

Example text.

plated armor
Plated Armor

Example text.

reactive barrier
Reactive Barrier

Example text.

slowing hex
Slowing Hex

Example text.

stealth / Veil Walker
Stealth

Example text.

unstoppable
Unstoppable

Example text.

Adding an interaction

[edit source]

Add an entry to the REGISTRY table at the top of Module:AbilityInteraction. An entry should contain title, type, iconfile, and link, which pass down to the underlying {{IconBox}}. The 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).