Editing Template:AbilityInteraction/doc

Warning: You are not logged in. Once you make an edit, a temporary account will be created for you. Learn more. Log in or create an account to continue receiving notifications after this account expires, and to access other features.
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. Under the hood it is a fancy wrapper around {{tl|IconBox}}.
{{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}}.


To use this template, look at the list of possible Interactions and examples of usage below.
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": [ "(see full list below)" ]
"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, or enhanced when it applies more strongly than usual.",
"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", "enhanced" ]
"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 = Ability Duration
| interaction = dispel
| text =
| text =
Affects the charge's duration and, consequently, distance the charge covers.
* Any dispel immediately "drops" the target off the cart.
}}
}}
</pre>
</pre>
{{AbilityInteraction
{{AbilityInteraction
| interaction = Ability Duration
| interaction = dispel
| text =
| text =
Affects the charge's duration and, consequently, distance the charge covers.
* Any dispel immediately "drops" the target off the cart.
}}
 
=== 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 85: Line 88:
}}
}}


=== Disabled Interaction ===
=== 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]].
}}
}}
== 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>
Please note that all contributions to The Deadlock Wiki are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see Deadlock:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)
Preview page with this template