User:Vergir/AbilityInteraction: Difference between revisions

Vergir (talk | contribs)
Create AbilityInteraction sub-template for use inside AbilitySection interactions= param (with help from vergir-bot LLM)
 
Vergir (talk | contribs)
Rewrite as pure wikitext using #switch — removes Lua dependency since Module: namespace unavailable in userspace (with help from vergir-bot LLM)
Line 1: Line 1:
<includeonly>{{#invoke:User:Vergir/InteractionTypes|render_row|{{{type|}}}|{{{text|}}}}}</includeonly><noinclude>
<includeonly><!--
  AbilityInteraction: renders one styled interaction row.
  Parameters:
    type  - interaction type key (see valid values below)
    text  - freeform wikitext description
-->
{{#if: {{{type|}}} |
<div class="ability-interaction" style="margin-bottom:4px; border-radius:4px; overflow:hidden; font-family:'Open Sans','PT Serif',serif;">
  <div style="background:{{#switch:{{{type|}}}
    | debuff_immunity = #4a7fa5
    | unstoppable    = #a07830
    | silence        = #7a5a9a
    | stun            = #7a5a9a
    | disjoint        = #4a6a5a
    | invincibility  = #4a7fa5
    | sleep          = #5a6a8a
    | purge          = #4a7a6a
    | lifestealing    = #3a7a4a
    | barrier        = #3a7a4a
    | illusions      = #5a5a7a
    | phase          = #5a5a7a
    | #default        = #555555
  }}; padding:4px 8px; font-weight:bold; font-size:0.85rem; display:flex; align-items:center; gap:6px; color:#FFEFD7;">[[File:{{#switch:{{{type|}}}
    | debuff_immunity = Status_Debuff_Immune.png
    | unstoppable    = Unstoppable Symbol.png
    | silence        = Silence.png
    | stun            = Status_Stun.png
    | disjoint        = Status_Displacement.png
    | invincibility  = Metal Skin Old.png
    | sleep          = Status_Sleep.png
    | purge          = Debuff_Remover.png
    | lifestealing    = Healing.png
    | barrier        = Barrier.png
    | illusions      = Invisible.png
    | phase          = Status_Unstoppable.png
    | #default        = GenericProperty.png
  }}|20px|link=]] Interactions: {{#switch:{{{type|}}}
    | debuff_immunity = Debuff Immunity
    | unstoppable    = Unstoppable
    | silence        = Silence
    | stun            = Stun
    | disjoint        = Disjoint
    | invincibility  = Invincibility
    | sleep          = Sleep
    | purge          = Purge
    | lifestealing    = Lifestealing
    | barrier        = Barrier
    | illusions      = Illusions
    | phase          = Phased Units
    | #default        = {{#if:{{{type|}}}|Unknown type: {{{type}}}|''(no type provided)''}}
  }}</div>
  <div style="background:#1e1a22; padding:6px 10px; font-size:0.85rem; color:#FFEFD7;">{{{text|}}}</div>
</div>
}}</includeonly><noinclude>
== Overview ==
== Overview ==
Renders a single styled interaction row for use inside the <code>interactions=</code> parameter of [[User:Vergir/AbilitySection]].
Renders a single styled interaction row for use inside the <code>interactions=</code> parameter of [[User:Vergir/AbilitySection]].
Line 7: Line 60:
! Parameter !! Description !! Required
! Parameter !! Description !! Required
|-
|-
| <code>type</code> || Interaction type key. Must match an entry in [[User:Vergir/Module:InteractionTypes]]. || Yes
| <code>type</code> || Interaction type key. Must be one of the valid values below. || Yes
|-
|-
| <code>text</code> || Description of the interaction. Freeform wikitext; may span multiple lines and include links, templates, and bullet points. || Yes
| <code>text</code> || Description of the interaction. Freeform wikitext; may span multiple lines, include links, templates, and bullet points. || Yes
|}
|}


=== Valid type values ===
=== Valid type values ===
* <code>debuff_immunity</code>
The canonical list of types is documented in [[User:Vergir/Module:InteractionTypes]]. Adding a new type requires updating both this template's <code>#switch</code> blocks and that module.
* <code>unstoppable</code>
 
* <code>silence</code>
* <code>debuff_immunity</code> — [[Debuff Resist|Debuff Immunity]]
* <code>stun</code>
* <code>unstoppable</code> — [[Status Effects#Unstoppable|Unstoppable]]
* <code>disjoint</code>
* <code>silence</code> — [[Silence]]
* <code>invincibility</code>
* <code>stun</code> — [[Stun]]
* <code>sleep</code>
* <code>disjoint</code> — Disjoint
* <code>purge</code>
* <code>invincibility</code> — [[Status Effects#Invincibility|Invincibility]]
* <code>lifestealing</code>
* <code>sleep</code> — [[Status Effects#Sleep|Sleep]]
* <code>barrier</code>
* <code>purge</code> — Purge
* <code>illusions</code>
* <code>lifestealing</code> — Lifestealing
* <code>phase</code>
* <code>barrier</code> — [[Barrier]]
* <code>illusions</code> — Illusions
* <code>phase</code> — Phased Units


=== Example ===
=== Example ===
Line 32: Line 87:
| text =
| text =
The projectile can be disjointed before impact.
The projectile can be disjointed before impact.
Disjointing prevents the impact damage and the explosion.
Disjointing prevents both the impact damage and the explosion.
}}
}}
</pre>
</pre>
</noinclude>
</noinclude>