User:Vergir/AbilityInteraction: Difference between revisionsGive feedback
Rewrite as pure wikitext using #switch — removes Lua dependency since Module: namespace unavailable in userspace (with help from vergir-bot LLM) |
Add new interaction types, drop "Interactions:" prefix from header label (with help from vergir-bot LLM) |
||
| Line 2: | Line 2: | ||
AbilityInteraction: renders one styled interaction row. | AbilityInteraction: renders one styled interaction row. | ||
Parameters: | Parameters: | ||
type - interaction type key (see valid values | type - interaction type key (see valid values in doc) | ||
text - freeform wikitext description | text - freeform wikitext description | ||
--> | --> | ||
| Line 8: | Line 8: | ||
<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|}}} | ||
| debuff_immunity = #4a7fa5 | | debuff_immunity = #4a7fa5 | ||
| unstoppable | | unstoppable = #a07830 | ||
| silence | | silence = #7a5a9a | ||
| stun | | stun = #7a5a9a | ||
| disjoint | | disjoint = #4a6a5a | ||
| invincibility | | invincibility = #4a7fa5 | ||
| sleep | | sleep = #5a6a8a | ||
| purge | | purge = #4a7a6a | ||
| lifestealing | | lifestealing = #3a7a4a | ||
| barrier | | barrier = #3a7a4a | ||
| illusions | | illusions = #5a5a7a | ||
| phase | | phase = #5a5a7a | ||
| #default | | counterspell = #4a5a7a | ||
| debuff_reduction = #4a6a7a | |||
| dispel_magic = #4a7a6a | |||
| slowing_hex = #6a5a7a | |||
| ability_range = #5a6a4a | |||
| ability_duration = #5a5a6a | |||
| charges = #7a5a4a | |||
| #default = #555555 | |||
}}; 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|}}} | ||
| debuff_immunity = Status_Debuff_Immune.png | | debuff_immunity = Status_Debuff_Immune.png | ||
| unstoppable | | unstoppable = Unstoppable Symbol.png | ||
| silence | | silence = Silence.png | ||
| stun | | stun = Status_Stun.png | ||
| disjoint | | disjoint = Status_Displacement.png | ||
| invincibility | | invincibility = Metal Skin Old.png | ||
| sleep | | sleep = Status_Sleep.png | ||
| purge | | purge = Debuff_Remover.png | ||
| lifestealing | | lifestealing = Healing.png | ||
| barrier | | barrier = Barrier.png | ||
| illusions | | illusions = Invisible.png | ||
| phase | | phase = Status_Unstoppable.png | ||
| #default | | counterspell = Counterspell.png | ||
}}|20px|link=]] | | debuff_reduction = Debuff_Reducer.png | ||
| debuff_immunity = Debuff Immunity | | dispel_magic = Dispel_Magic.png | ||
| unstoppable | | slowing_hex = Slowing_Hex.png | ||
| silence | | ability_range = Greater_Expansion.png | ||
| stun | | ability_duration = Duration_Extender.png | ||
| disjoint | | charges = Rapid_Recharge.png | ||
| invincibility | | #default = GenericProperty.png | ||
| sleep | }}|20px|link=]] {{#switch:{{{type|}}} | ||
| purge | | debuff_immunity = [[Debuff Resist|Debuff Immunity]] | ||
| lifestealing | | unstoppable = [[Status Effects#Unstoppable|Unstoppable]] | ||
| barrier | | silence = [[Silence]] | ||
| illusions | | stun = [[Stun]] | ||
| phase | | disjoint = Disjoint | ||
| #default | | invincibility = [[Status Effects#Invincibility|Invincibility]] | ||
| sleep = [[Status Effects#Sleep|Sleep]] | |||
| purge = Purge | |||
| lifestealing = Lifestealing | |||
| barrier = [[Barrier]] | |||
| illusions = Illusions | |||
| phase = Phased Units | |||
| counterspell = {{ItemIcon|Counterspell}} | |||
| debuff_reduction = [[Debuff Resist|Debuff Reduction]] | |||
| dispel_magic = {{ItemIcon|Dispel Magic}} | |||
| slowing_hex = {{ItemIcon|Slowing Hex}} | |||
| ability_range = [[Ability Range|Ability Range]] ({{ItemIcon|Greater Expansion}}) | |||
| ability_duration = [[Ability Duration|Ability Duration]] ({{ItemIcon|Duration Extender}}) | |||
| charges = Charges ({{ItemIcon|Rapid Recharge}}) | |||
| #default = {{#if:{{{type|}}}|<span style="color:red;">Unknown type: <code>{{{type}}}</code></span>|''(no type provided)''}} | |||
}}</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;">{{{text|}}}</div> | ||
| Line 66: | Line 87: | ||
=== Valid type values === | === Valid type values === | ||
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. | The canonical list of types is also documented in [[User:Vergir/Module:InteractionTypes]]. Adding a new type requires updating both this template's <code>#switch</code> blocks and that module. | ||
; Status effects | |||
* <code>debuff_immunity</code> — [[Debuff Resist|Debuff Immunity]] | * <code>debuff_immunity</code> — [[Debuff Resist|Debuff Immunity]] | ||
* <code>unstoppable</code> — [[Status Effects#Unstoppable|Unstoppable]] | * <code>unstoppable</code> — [[Status Effects#Unstoppable|Unstoppable]] | ||
| Line 80: | Line 102: | ||
* <code>illusions</code> — Illusions | * <code>illusions</code> — Illusions | ||
* <code>phase</code> — Phased Units | * <code>phase</code> — Phased Units | ||
; Items | |||
* <code>counterspell</code> — [[Counterspell]] | |||
* <code>debuff_reduction</code> — [[Debuff Resist|Debuff Reduction]] (icon: [[Debuff Reducer]]) | |||
* <code>dispel_magic</code> — [[Dispel Magic]] | |||
* <code>slowing_hex</code> — [[Slowing Hex]] | |||
* <code>ability_range</code> — [[Ability Range]] (icon: [[Greater Expansion]]) | |||
* <code>ability_duration</code> — [[Ability Duration]] (icon: [[Duration Extender]]) | |||
* <code>charges</code> — Charges (icon: [[Rapid Recharge]]) | |||
=== Example === | === Example === | ||