User:Vergir/AbilityInteraction: Difference between revisions

Vergir (talk | contribs)
Hardcode color per type, remove color param; update doc (with help from vergir-bot LLM)
Vergir (talk | contribs)
Darker header colors; fix Unstoppable icon; link Charges; add bullet_armor type; optional text with defaults (with help from vergir-bot LLM)
Line 3: Line 3:
   Parameters:
   Parameters:
     type - interaction type key (see valid values in doc)
     type - interaction type key (see valid values in doc)
     text - freeform wikitext description
     text - (optional) freeform wikitext description. Falls back to a default per type.


   Color is determined by type automatically:
   Color is determined automatically by type:
     vitality (#86c921) : unstoppable, counterspell, debuff_resist, dispel_magic
     vitality (#4a7a35) : unstoppable, counterspell, debuff_resist, dispel_magic, bullet_armor
     spirit  (#de80ff) : movement_restriction, ability_range, ability_duration, charges
     spirit  (#7a3fa8) : movement_restriction, ability_range, ability_duration, charges
     default  (#6b7280) : fallback for unknown types
     default  (#4a4e57) : unknown types
-->
-->
{{#if: {{{type|}}} |
{{#if: {{{type|}}} |
<div class="ability-interaction" style="margin-bottom:4px; border-radius:4px; overflow:hidden; font-family:'Open Sans','PT Serif',serif;">
<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|}}}
   <div style="background:{{#switch:{{{type|}}}
     | unstoppable          = #86c921
     | unstoppable          = #4a7a35
     | counterspell        = #86c921
     | counterspell        = #4a7a35
     | debuff_resist        = #86c921
     | debuff_resist        = #4a7a35
     | dispel_magic        = #86c921
     | dispel_magic        = #4a7a35
     | movement_restriction = #de80ff
    | bullet_armor        = #4a7a35
     | ability_range        = #de80ff
     | movement_restriction = #7a3fa8
     | ability_duration    = #de80ff
     | ability_range        = #7a3fa8
     | charges              = #de80ff
     | ability_duration    = #7a3fa8
     | #default            = #6b7280
     | charges              = #7a3fa8
     | #default            = #4a4e57
   }}; padding:4px 8px; font-weight:bold; font-size:0.85rem; display:flex; align-items:center; gap:6px; color:#FFEFD7;">[[File:{{#switch:{{{type|}}}
   }}; padding:4px 8px; font-weight:bold; font-size:0.85rem; display:flex; align-items:center; gap:6px; color:#FFEFD7;">[[File:{{#switch:{{{type|}}}
     | unstoppable          = Unstoppable Symbol.png
     | unstoppable          = Unstoppable.png
     | counterspell        = Counterspell.png
     | counterspell        = Counterspell.png
     | debuff_resist        = Debuff_Reducer.png
     | debuff_resist        = Debuff_Reducer.png
     | dispel_magic        = Dispel_Magic.png
     | dispel_magic        = Dispel_Magic.png
    | bullet_armor        = Plated_Armor.png
     | movement_restriction = Slowing_Hex.png
     | movement_restriction = Slowing_Hex.png
     | ability_range        = Greater_Expansion.png
     | ability_range        = Greater_Expansion.png
Line 33: Line 35:
     | #default            = GenericProperty.png
     | #default            = GenericProperty.png
   }}|20px|link=]] {{#switch:{{{type|}}}
   }}|20px|link=]] {{#switch:{{{type|}}}
     | unstoppable          = [[Status Effects#Unstoppable|Unstoppable]]
     | unstoppable          = [[Unstoppable]]
     | counterspell        = [[Counterspell]]
     | counterspell        = [[Counterspell]]
     | debuff_resist        = [[Debuff Resist]]
     | debuff_resist        = [[Debuff Resist]]
     | dispel_magic        = [[Dispel Magic]]
     | dispel_magic        = [[Dispel Magic]]
    | bullet_armor        = [[Plated Armor|Bullet Armor]]
     | movement_restriction = [[Slowing Hex|Movement Restriction]]
     | movement_restriction = [[Slowing Hex|Movement Restriction]]
     | ability_range        = [[Ability Range]]
     | ability_range        = [[Ability Range]]
     | ability_duration    = [[Ability Duration]]
     | ability_duration    = [[Ability Duration]]
     | charges              = Charges
     | charges              = [[Charges]]
     | #default            = <span style="color:red;">Unknown type: <code>{{{type}}}</code></span>
     | #default            = <span style="color:red;">Unknown type: <code>{{{type}}}</code></span>
   }}</div>
   }}</div>
   <div style="background:#1e1a22; padding:6px 10px; font-size:0.85rem; color:#FFEFD7;">{{{text|}}}</div>
   <div style="background:#1e1a22; padding:6px 10px; font-size:0.85rem; color:#FFEFD7;">{{#if:{{{text|}}}|{{{text}}}|{{#switch:{{{type|}}}
    | unstoppable          = [[Unstoppable]] does not prevent this ability's effects from applying.
    | counterspell        = [[Counterspell]] blocks debuffs applied by this ability, but not the damage.
    | debuff_resist        = [[Debuff Resist]] reduces the duration of debuffs applied by this ability.
    | dispel_magic        = [[Dispel Magic]] removes debuffs applied by this ability before they expire.
    | bullet_armor        = [[Plated Armor|Bullet armor]] does not reduce damage dealt by this ability.
    | movement_restriction = [[Slowing Hex|Movement restriction]] does not prevent casting this ability.
    | ability_range        = [[Ability Range]] items increase the range of this ability.
    | ability_duration    = [[Ability Duration]] items increase the duration of effects applied by this ability.
    | charges              = [[Charges]] items increase the number of charges available for this ability.
    | #default            =
  }}}}</div>
</div>
</div>
}}</includeonly><noinclude>
}}</includeonly><noinclude>
Line 55: Line 69:
| <code>type</code> || Interaction type key. Must be one of the valid values below. || 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, include links, templates, and bullet points. || Yes
| <code>text</code> || Description of the interaction. If omitted, a generic default text is used for the type. || No
|}
|}


Line 61: Line 75:


=== Valid type values ===
=== Valid type values ===
Adding a new type requires updating the three <code>#switch</code> blocks in this template (color, icon, label).
Adding a new type requires updating the four <code>#switch</code> blocks in this template (color, icon, label, default text).


; Vitality (green, #86c921)
; Vitality (dark green, #4a7a35)
* <code>unstoppable</code> — [[Status Effects#Unstoppable|Unstoppable]]
* <code>unstoppable</code> — [[Unstoppable]]
* <code>counterspell</code> — [[Counterspell]]
* <code>counterspell</code> — [[Counterspell]]
* <code>debuff_resist</code> — [[Debuff Resist]]
* <code>debuff_resist</code> — [[Debuff Resist]]
* <code>dispel_magic</code> — [[Dispel Magic]]
* <code>dispel_magic</code> — [[Dispel Magic]]
* <code>bullet_armor</code> — [[Plated Armor|Bullet Armor]]


; Spirit (purple, #de80ff)
; Spirit (dark purple, #7a3fa8)
* <code>movement_restriction</code> — [[Slowing Hex|Movement Restriction]]
* <code>movement_restriction</code> — [[Slowing Hex|Movement Restriction]]
* <code>ability_range</code> — [[Ability Range]]
* <code>ability_range</code> — [[Ability Range]]
* <code>ability_duration</code> — [[Ability Duration]]
* <code>ability_duration</code> — [[Ability Duration]]
* <code>charges</code> — Charges
* <code>charges</code> — [[Charges]]


=== Example ===
=== Example ===
Line 80: Line 95:
| type = counterspell
| type = counterspell
| text = [[Counterspell]] blocks the slow and accuracy debuff, but not the damage.
| text = [[Counterspell]] blocks the slow and accuracy debuff, but not the damage.
}}
{{User:Vergir/AbilityInteraction
| type = debuff_resist
}}
}}
</pre>
</pre>
</noinclude>
</noinclude>