Jump to content
Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:A: Difference between revisions

From Teriock
// via Wikitext Extension for VSCode
No edit summary
 
(171 intermediate revisions by the same user not shown)
Line 38: Line 38:
         },
         },
         executionTime = {
         executionTime = {
            'time',
             'executionTime',
             'executionTime',
             'et',
             'et',
Line 56: Line 55:
         --    'fr'
         --    'fr'
         -- },
         -- },
        flaw = {
            'flaw',
            'fl',
            'f'
        },
        special = {
            'special',
            'sp',
            's'
        },
         range = {
         range = {
             'range',
             'range',
Line 73: Line 82:
             'expansionRange',
             'expansionRange',
             'er'
             'er'
        },
        expansionCount = {
            'expansionCount',
            'ec'
        },
        expansionAttribute = {
            'expansionAttribute',
            'ea'
         },
         },
         sustained = {
         sustained = {
Line 138: Line 155:
             'magick pointsx',
             'magick pointsx',
             'magik pointsx',
             'magik pointsx',
        },
        gp = {
            'gp',
            'gold',
            'goldPieces',
            'gold pieces',
        },
        gpx = {
            'gpx',
            'goldx',
            'goldPiecesx',
            'gold piecesx',
         },
         },
         matx = {
         matx = {
Line 325: Line 354:
             'ab',
             'ab',
             'ability'
             'ability'
            },
            spell = {
                'spl',
                'spell',
             },
             },
             other = {
             other = {
Line 346: Line 379:
                 'area',
                 'area',
                 'ar'
                 'ar'
            },
            as = {
            'areaSpell'
             },
             },
             aci = {
             aci = {
Line 360: Line 396:
                 'creatureAreaItem',
                 'creatureAreaItem',
                 'AreaItemCreature',
                 'AreaItemCreature',
            },
            ac = {
                'ac',
                'ca',
                'areaCreature',
                'creatureArea',
            },
            al = {
            'al',
            'la',
            'armLeg',
            'legArm',
            },
            cs = {
                'cs',
                'sc',
                'creatureSelf',
                'selfCreature',
            },
            ari = {
                'ari',
                'areaItem',
                'itemArea',
            },
            arse = {
            'areaSelf'
            },
            si = {
            'selfItem',
            'itemSelf'
             }
             }
         },
         },
Line 374: Line 440:
                 '4',
                 '4',
                 'inf',
                 'inf',
            },
            noLimit = {
                'noLimit',
                '1',
                'nl',
             },
             },
             whileUp = {
             whileUp = {
Line 428: Line 499:
             },
             },
             timeParse = {
             timeParse = {
                 '^%d+[mhdwy]$'
                 '^%d+[mhdwys]$'
             }
             }
         },
         },
Line 577: Line 648:
                 'SNK',
                 'SNK',
                 's'
                 's'
            }
        },
        expansion = {
            detonate = {
                'det',
                'detonate',
                'd'
             },
             },
             ripple = {
             unp = {
                 'rip',
                 'unp',
                 'ripple',
                 'UNP',
                 'r'
                 'u'
             },
             },
             cascade = {
        },
                 'cas',
        expansionAttribute = {
                 'cascade',
            int = {
                 'c'
                'int',
                'INT',
                'i'
            },
            str = {
                'str',
                'STR',
                's'
            },
            mov = {
                'mov',
                'MOV',
                'm'
            },
            per = {
                'per',
                'PER',
                'p'
            },
            snk = {
                'snk',
                'SNK',
                's'
            },
             unp = {
                 'unp',
                 'UNP',
                 'u'
             },
             },
            fork = {
                'for',
                'fork',
                'f'
            }
        },
        expansionRange = {
            distParse = {
                '^%d+[fm]$'
            }
        },
        sustained = {
            sustained = {
                'sus',
                'sustained',
                's',
                '1',
            }
         },
         },
         verbal = {
         expansion = {
             verbal = {
             detonate = {
                 'ver',
                 'det',
                 'verbal',
                 'detonate',
                 'v',
                 'd'
                 '1',
            },
             }
            ripple = {
        },
                 'rip',
        somatic = {
                'ripple',
            somatic = {
                'r'
                 'som',
             },
                 'somatic',
            cascade = {
                 's',
                'cas',
                 '1',
                 'cascade',
                 'c'
            },
            fork = {
                 'for',
                 'fork',
                'f'
             }
             }
         },
         },
         material = {
         expansionRange = {
             material = {
             distParse = {
                 'mat',
                 '^%d+[fm]$'
                'material',
                'm',
                '1',
             }
             }
         },
         },
         magelore = {
         expansionCount = {
             magelore = {
             expansionCount = {
                 'mag',
                 'expansionCount',
                 'magelore',
                 'ec',
                'ml',
                '1',
             }
             }
         },
         },
         invoked = {
         sustained = {
             invoked = {
             sustained = {
                 'inv',
                 'sus',
                 'invoked',
                 'sustained',
                 'i',
                 's',
                 '1',
                 '1',
             }
             }
         }
         },
    }
}
 
local tags = {
    verbal = {
         verbal = {
         verbal = {
             text = 'Verbal',
             verbal = {
            link = 'Verbal component abilities',
                'ver',
            symbol = '🗣️',
                'verbal',
            color = '#f9f06b'
                'v',
                '1',
            }
         },
         },
    },
    somatic = {
         somatic = {
         somatic = {
             text = 'Somatic',
             somatic = {
            link = 'Somatic component abilities',
                'som',
            symbol = '👐',
                'somatic',
            color = '#f9f06b'
                's',
                '1',
            }
         },
         },
    },
    material = {
         material = {
         material = {
             text = 'Material',
             material = {
            link = 'Material component abilities',
                'mat',
            symbol = '💎',
                'material',
            color = '#ff7800'
                'm',
                '1',
            }
         },
         },
    },
    magelore = {
         magelore = {
         magelore = {
             text = 'Magelore',
             magelore = {
            link = 'Magelore component abilities',
                'mag',
            symbol = '🔮',
                'magelore',
            color = '#f9f06b'
                'ml',
                '1',
            }
         },
         },
    },
    invoked = {
         invoked = {
         invoked = {
             text = 'Invoked',
            invoked = {
             link = 'Invoked component abilities',
                'inv',
             symbol = '🪄',
                'invoked',
             color = '#f9f06b'
                'i',
                '1',
            }
        },
        class = {
            ber = {
                'ber',
            },
            due = {
                'due',
            },
            vet = {
                'vet',
            },
            kni = {
                'kni',
            },
            pal = {
                'pal',
            },
            ass = {
                'ass',
            },
            cor = {
                'cor',
            },
            arc = {
                'arc',
            },
            thi = {
                'thi',
            },
            ran = {
                'ran',
            },
            fla = {
                'fla',
            },
            sto = {
                'sto',
            },
            lif = {
                'lif',
            },
            nec = {
                'nec',
            },
            nat = {
                'nat',
            },
        }
    }
}
 
local tags = {
    verbal = {
        verbal = {
             text = 'Verbal',
             link = 'Verbal component abilities',
             symbol = '🗣️',
             color = '#f9f06b',
            class = 'component-tagged verbal'
         },
         },
     },
     },
     elements = {
     somatic = {
         life = {
         somatic = {
             text = 'Life',
             text = 'Somatic',
             link = 'Life element abilities',
             link = 'Somatic component abilities',
             symbol = '☀️',
             symbol = '👐',
             color = '#ffffff'
             color = '#f9f06b',
            class = 'component-tagged somatic'
         },
         },
         storm = {
    },
             text = 'Storm',
    material = {
             link = 'Storm element abilities',
         material = {
             symbol = '💧',
             text = 'Material',
             color = '#3584e4'
             link = 'Material component abilities',
             symbol = '💎',
             color = '#ff7800',
            class = 'component-tagged material'
         },
         },
         necro = {
    },
             text = 'Necro',
    magelore = {
             link = 'Necromancy element abilities',
         magelore = {
             symbol = '💀',
             text = 'Magelore',
             color = '#3d3846'
             link = 'Magelore component abilities',
             symbol = '🔮',
             color = '#f9f06b',
            class = 'component-tagged magelore'
         },
         },
         flame = {
    },
             text = 'Flame',
    invoked = {
             link = 'Flame element abilities',
         invoked = {
             symbol = '🔥',
             text = 'Invoked',
             color = '#e01b24'
             link = 'Invoked abilities',
             symbol = '🪄',
             color = '#f9f06b',
            class = 'component-tagged invoked'
         },
         },
         nature = {
    },
             text = 'Nature',
    flaw = {
             link = 'Nature element abilities',
         flaw = {
             symbol = '🌱',
             text = 'Flaw',
             color = '#33d17a'
             link = 'Flaw abilities',
             symbol = '❌',
             color = '#e01b24',
            class = 'flaw-tagged flaw'
         },
         },
     },
     },
     classes = {
     special = {
         ber = {
         special = {
             text = 'Berserker',
             text = 'Special',
             link = 'Berserker class abilities',
             link = 'Special abilities',
             symbol = '🪓',
             symbol = '✴️',
            color = '#9141AC',
            class = 'special-tagged special'
         },
         },
         due = {
    },
             text = 'Duelist',
    es = {
             link = 'Duelist class abilities',
         es = {
             symbol = '🤺',
             text = 'Elder Sorcery',
             link = 'Elder Sorcery abilities',
             symbol = '🌌',
            color = '#9141AC',
            class = 'elderSorcery-tagged elderSorcery'
         },
         },
         vet = {
    },
             text = 'Veteran',
    warded = {
             link = 'Veteran class abilities',
         warded = {
             symbol = '🪖',
             text = 'Warded',
             link = 'Warded abilities',
             symbol = '🏮',
            color = '#f9f06b',
            class = 'warded-tagged warded'
         },
         },
         kni = {
    },
             text = 'Knight',
    elements = {
             link = 'Knight class abilities',
         life = {
             symbol = '⚔️',
             text = 'Life',
             link = 'Life element abilities',
             symbol = '☀️',
            color = '#ffffff',
            class = 'element-tagged life'
         },
         },
         pal = {
         storm = {
             text = 'Paladin',
             text = 'Storm',
             link = 'Paladin class abilities',
             link = 'Storm element abilities',
             symbol = '🛡️',
             symbol = '💧',
            color = '#3584e4',
            class = 'element-tagged storm'
         },
         },
         ass = {
         necromancy = {
             text = 'Assassin',
             text = 'Necromancy',
             link = 'Assassin class abilities',
             link = 'Necromancy element abilities',
             symbol = '🗡️',
             symbol = '💀',
            color = '#3d3846',
            class = 'element-tagged necromancy'
         },
         },
         cor = {
         necro = {
             text = 'Corsair',
             text = 'Necromancy',
             link = 'Corsair class abilities',
             link = 'Necromancy element abilities',
             symbol = '🏴‍☠️',
             symbol = '💀',
            color = '#3d3846',
            class = 'element-tagged necromancy'
         },
         },
         arc = {
         flame = {
             text = 'Archer',
             text = 'Flame',
             link = 'Archer class abilities',
             link = 'Flame element abilities',
             symbol = '🏹',
             symbol = '🔥',
            color = '#e01b24',
            class = 'element-tagged flame'
         },
         },
         thi = {
         nature = {
             text = 'Thief',
             text = 'Nature',
             link = 'Thief class abilities',
             link = 'Nature element abilities',
             symbol = '💰️',
             symbol = '🌱',
            color = '#33d17a',
            class = 'element-tagged nature'
         },
         },
         ran = {
    },
             text = 'Ranger',
    class = {
             link = 'Ranger class abilities',
         ber = {
             symbol = '🐾',
             text = 'Berserker',
             link = 'Berserker class abilities',
             symbol = '🪓',
            class = 'class-tagged berserker'
         },
         },
         fla = {
         due = {
             text = 'Flame Mage',
             text = 'Duelist',
             link = 'Flame mage class abilities',
             link = 'Duelist class abilities',
             symbol = '🧙',
             symbol = '🤺',
            class = 'class-tagged duelist'
         },
         },
         sto = {
         vet = {
             text = 'Storm Mage',
             text = 'Veteran',
             link = 'Storm mage class abilities',
             link = 'Veteran class abilities',
             symbol = '🧙',
             symbol = '🪖',
            class = 'class-tagged veteran'
         },
         },
         lif = {
         kni = {
             text = 'Flame Mage',
             text = 'Knight',
             link = 'Flame mage class abilities',
             link = 'Knight class abilities',
             symbol = '🧙',
             symbol = '⚔️',
            class = 'class-tagged knight'
         },
         },
         nec = {
         pal = {
             text = 'Necromancer',
             text = 'Paladin',
             link = 'Necromancer class abilities',
             link = 'Paladin class abilities',
             symbol = '🧙',
             symbol = '🛡️',
            class = 'class-tagged paladin'
         },
         },
         nat = {
         ass = {
             text = 'Nature Mage',
             text = 'Assassin',
             link = 'Nature mage class abilities',
             link = 'Assassin class abilities',
             symbol = '🧙',
             symbol = '🗡️',
            class = 'class-tagged assassin'
         },
         },
    },
         cor = {
    power = {
             text = 'Corsair',
         divine = {
             link = 'Corsair class abilities',
             text = 'Divine',
             symbol = '🏴‍☠️',
             link = 'Divinely powered abilities',
             class = 'class-tagged corsair'
             symbol = '🪽',
             color = '#f9f06b'
         },
         },
         magic = {
         arc = {
             text = 'Magical',
             text = 'Archer',
             link = 'Magically powered abilities',
             link = 'Archer class abilities',
             symbol = '✨',
             symbol = '🏹',
             color = '#9141ac'
             class = 'class-tagged archer'
         },
         },
         spirit = {
         thi = {
             text = 'Spiritual',
             text = 'Thief',
             link = 'Spiritually powered abilities',
             link = 'Thief class abilities',
             symbol = '🪭',
             symbol = '💰️',
             color = '#9a9996'
             class = 'class-tagged thief'
         },
         },
         martial = {
         ran = {
             text = 'Martial',
             text = 'Ranger',
             link = 'Martially powered abilities',
             link = 'Ranger class abilities',
             symbol = '💪',
             symbol = '🐾',
             color = '#ff7800'
             class = 'class-tagged ranger'
         },
         },
         psionic = {
         fla = {
             text = 'Psionic',
             text = 'Flame Mage',
             link = 'Psionically powered abilities',
             link = 'Flame Mage class abilities',
             symbol = '🤯',
             symbol = '🧙',
             color = '#3584e4'
             class = 'class-tagged flameMage'
         },
         },
         primal = {
         sto = {
             text = 'Primal',
             text = 'Storm Mage',
             link = 'Primally powered abilities',
             link = 'Storm Mage class abilities',
             symbol = '⛰️',
             symbol = '🧙',
             color = '#986a44'
             class = 'class-tagged stormMage'
         },
         },
         techo = {
         lif = {
             text = 'Techno',
             text = 'Life Mage',
             link = 'Technologically powered abilities',
             link = 'Life Mage class abilities',
             symbol = '⚙️',
             symbol = '🧙',
             color = '#e01b24'
             class = 'class-tagged lifeMage'
         },
         },
         finance = {
         nec = {
             text = 'Financial',
             text = 'Necromancer',
             link = 'Financially powered abilities',
             link = 'Necromancer class abilities',
             symbol = '🪙',
             symbol = '🧙',
             color = '#fcc200'
             class = 'class-tagged necromancer'
         },
         },
         alchemy = {
         nat = {
             text = 'Alchemical',
             text = 'Nature Mage',
             link = 'Alchemically powered abilities',
             link = 'Nature Mage class abilities',
             symbol = '🧪',
             symbol = '🧙',
             color = '#33d17a'
             class = 'class-tagged natureMage'
         },
         },
     },
     },
     category = {
     gm = {
         skill = {
         warr = {
             text = 'Skill',
             text = 'Warrior',
             link = 'Skills',
             link = 'Warrior guildmaster abilities',
             symbol = '🤹'
             symbol = '⚔️',
            class = 'archetype-tagged warrior'
         },
         },
         spell = {
         semi = {
             text = 'Spell',
             text = 'Semi',
             link = 'Spells',
             link = 'Semi guildmaster abilities',
             symbol = '✨'
             symbol = '🤹',
            class = 'archetype-tagged semi'
        }
    },
    power = {
        divine = {
            text = 'Divine',
            link = 'Divinely powered abilities',
            symbol = '🪽',
            color = '#f9f06b',
            class = 'power-tagged divine'
         },
         },
         semblant = {
         magic = {
             text = 'Semblant',
             text = 'Magical',
             link = 'Semblant skills',
             link = 'Magically powered abilities',
             symbol = '🎭'
             symbol = '✨',
            color = '#9141ac',
            class = 'power-tagged magical'
         },
         },
         conjure = {
         spirit = {
             text = 'Conjured',
             text = 'Spiritual',
             link = 'Conjured spells',
             link = 'Spiritually powered abilities',
             symbol = '🔮'
             symbol = '🪭',
            color = '#9a9996',
            class = 'power-tagged spiritual'
         },
         },
         standard = {
         martial = {
             text = 'Standard',
             text = 'Martial',
             link = 'Standard abilities',
             link = 'Martially powered abilities',
             symbol = '🏁'
             symbol = '💪',
            color = '#ff7800',
            class = 'power-tagged martial'
         },
         },
    },
         psionic = {
    effects = {
             text = 'Psionic',
         mental = {
             link = 'Psionically powered abilities',
             text = 'Mental',
             symbol = '🤯',
             link = 'Mental effects',
            color = '#3584e4',
             symbol = '🧠'
            class = 'power-tagged psionic'
         },
         },
         truth = {
         primal = {
             text = 'Truth',
             text = 'Primal',
             link = 'Truth detecting effects',
             link = 'Primally powered abilities',
             symbol = '⚖️'
             symbol = '⛰️',
            color = '#986a44',
            class = 'power-tagged primal'
         },
         },
         duelMod = {
         techno = {
             text = 'Duel mod',
             text = 'Technological',
             link = 'Duel modifying effects',
             link = 'Technologically powered abilities',
             symbol = '🤺'
             symbol = '⚙️',
            color = '#e01b24',
            class = 'power-tagged technological'
         },
         },
         movement = {
         matpow = {
            text = 'Movement',
        text = 'Material',
            link = 'Movement effects',
        link = 'Materially powered abilities',
            symbol = '👣'
        symbol = '🪨️',
        color = 'ff7800',
        class = 'power-tagged material'
         },
         },
         displacement = {
         finance = {
             text = 'Displacement',
             text = 'Financial',
             link = 'Displacement effects',
             link = 'Financially powered abilities',
             symbol = '🌀'
             symbol = '🪙',
            color = '#fcc200',
            class = 'power-tagged financial'
         },
         },
         transformation = {
         alchemy = {
             text = 'Transformation',
             text = 'Alchemical',
             link = 'Transformation effects',
             link = 'Alchemically powered abilities',
             symbol = '🌳'
             symbol = '🧪',
            color = '#33d17a',
            class = 'power-tagged alchemical'
         },
         },
         control = {
         unknown = {
             text = 'Control',
             text = 'Unknown',
             link = 'Control effects',
             link = 'Unknown powered abilities',
             symbol = '⛓️'
             symbol = '❓',
            color = '#77767b',
            class = 'power-tagged unknown'
         },
         },
         resist = {
    },
             text = 'Resistance',
    category = {
             link = 'Resistance effects',
         skill = {
             symbol = '🚫'
             text = 'Skill',
             link = 'Skills',
             symbol = '🤹',
            class = 'skill'
         },
         },
         immune = {
         spell = {
             text = 'Immunity',
             text = 'Spell',
             link = 'Immunity effects',
             link = 'Spells',
             symbol = '🚫'
             symbol = '✨',
            class = 'spell'
         },
         },
         long = {
         semblant = {
             text = 'Long range',
             text = 'Semblant',
             link = 'Long range effects',
             link = 'Semblant skills',
             symbol = '📏'
             symbol = '🎭',
            class = 'standard-tagged semblant'
         },
         },
         sense = {
         conjure = {
             text = 'Sensory',
             text = 'Conjured',
             link = 'Sensory effects',
             link = 'Conjured spells',
             symbol = '👁️'
             symbol = '🔮',
            class = 'standard-tagged conjure'
         },
         },
         revive = {
         standard = {
             text = 'Revival',
             text = 'Standard',
             link = 'Revival effects',
             link = 'Standard abilities',
             symbol = '🤍'
             symbol = '🏁',
            class = 'standard-tagged normal'
         },
         },
         summon = {
         rotator = {
             text = 'Summoning',
             text = 'Rotator',
             link = 'Summoning effects',
             link = 'Rotator abilities',
             symbol = '🖤'
             symbol = '🔄',
            class = 'rotator'
         },
         },
         heal = {
         guildmaster = {
             text = 'Healing',
             text = 'Guildmaster',
             link = 'Healing effects',
             link = 'Guildmaster abilities',
             symbol = '❤️'
            symbol = '🏅',
            class = 'guildmaster'
        }
    },
    effects = {
        mental = {
            text = 'Mental',
            link = 'Mental effects',
             symbol = '🧠',
            class = 'effect-tagged mental'
         },
         },
         reanimate = {
         truth = {
             text = 'Reanimation',
             text = 'Truth detecting',
             link = 'Reanimation effects',
             link = 'Truth detecting effects',
             symbol = '🩶'
             symbol = '⚖️',
            class = 'effect-tagged truthDetecting'
         },
         },
         regenerate = {
         duelModifying = {
             text = 'Regeneration',
             text = 'Duel modifying',
             link = 'Regeneration effects',
             link = 'Duel modifying effects',
             symbol = '💚'
             symbol = '🤺',
            class = 'effect-tagged duelModifying'
         },
         },
         kill = {
         movement = {
             text = 'Killing',
             text = 'Movement',
             link = 'Killing effects',
             link = 'Movement effects',
             symbol = '☠️'
             symbol = '👣',
            class = 'effect-tagged movement'
         },
         },
         steal = {
         poison = {
             text = 'Stealing',
             text = 'Poison',
             link = 'Stealing effects',
             link = 'Poison effects',
             symbol = '💰'
             symbol = '☠️',
            class = 'effect-tagged poison'
         },
         },
    },
         displacement = {
    pre = {
             text = 'Displacement',
         strike = {
             link = 'Displacement effects',
             text = 'Strike',
             symbol = '🌀',
             link = 'Strike delivery abilities',
            class = 'effect-tagged displacement'
             symbol = '⚔️'
         },
         },
         ray = {
         transformation = {
             text = 'Ray',
             text = 'Transformation',
             link = 'Ray delivery abilities',
             link = 'Transformation effects',
             symbol = '⚡️'
             symbol = '🌳',
            class = 'effect-tagged transformation'
         },
         },
         ball = {
         illusion = {
             text = 'Ball',
             text = 'Illusion',
             link = 'Ball delivery abilities',
             link = 'Illusion effects',
             symbol = '🔥'
             symbol = '🫟',
            class = 'effect-tagged illusion'
         },
         },
         aura = {
         control = {
             text = 'Aura',
             text = 'Control',
             link = 'Aura delivery abilities',
             link = 'Control effects',
             symbol = '🌟'
             symbol = '⛓️',
            class = 'effect-tagged control'
         },
         },
         ritual = {
         resist = {
             text = 'Ritual',
             text = 'Resistance',
             link = 'Ritual delivery abilities',
             link = 'Resistance effects',
             symbol = '🕯️'
             symbol = '🚫',
            class = 'effect-tagged resistance'
         },
         },
         touch = {
         hexproof = {
             text = 'Touch',
             text = 'Hexproof',
             link = 'Touch delivery abilities',
             link = 'Hexproof effects',
             symbol = '👉️'
             symbol = '🚫',
            class = 'effect-tagged hexproof'
         },
         },
    },
         awaken = {
    maneuver = {
             text = 'Awakening',
         active = {
             link = 'Awakening effects',
             text = 'Active',
             symbol = '🌞',
             link = 'Active abilities',
            class = 'effect-tagged awakening'
             symbol = '➡️'
         },
         },
         reactive = {
         immune = {
             text = 'Reactive',
             text = 'Immunity',
             link = 'Reactive abilities',
             link = 'Immunity effects',
             symbol = '↩️'
             symbol = '🚫',
            class = 'effect-tagged immunity'
         },
         },
         passive = {
         hexseal = {
             text = 'Passive',
             text = 'Hexseal',
             link = 'Passive abilities',
             link = 'Hexseal effects',
             symbol = '🔁'
             symbol = '🚫',
            class = 'effect-tagged hexseal'
         },
         },
         slow = {
         long = {
             text = 'Slow',
             text = 'Long range',
             link = 'Slow abilities',
             link = 'Long range effects',
             symbol = '🐢'
             symbol = '📏',
            class = 'effect-tagged longRange'
         },
         },
    },
        sense = {
    interaction = {
            text = 'Sensory',
         attack = {
            link = 'Sensory effects',
             text = 'Attack',
            symbol = '👁️',
             link = 'Attack abilities',
            class = 'effect-tagged sensory'
             symbol = '⚔️',
        },
             color = '#ff7800'
         revive = {
             text = 'Revival',
             link = 'Revival effects',
             symbol = '🤍',
             class = 'effect-tagged revival'
         },
         },
         block = {
         summon = {
             text = 'Block',
             text = 'Summoning',
             link = 'Block abilities',
             link = 'Summoning effects',
             symbol = '🛡️',
             symbol = '🖤',
             color = '#ff7800'
             class = 'effect-tagged summoning'
         },
         },
         manifest = {
         heal = {
             text = 'Manifest',
             text = 'Healing',
             link = 'Manifest abilities',
             link = 'Healing effects',
             symbol = '✳️',
             symbol = '❤️',
             color = '#ff7800'
             class = 'effect-tagged healing'
         },
         },
         feat = {
         reanimate = {
             text = 'Feat',
             text = 'Reanimation',
             link = 'Feat abilities',
             link = 'Reanimation effects',
             symbol = '🎖️',
             symbol = '🩶',
             color = '#ff7800'
             class = 'effect-tagged reanimation'
        }
    },
    delivery = {
        self = {
            text = 'Self',
            link = 'Self delivery abilities',
            symbol = '🤲',
            color = '#f6d32d'
         },
         },
         missile = {
         regenerate = {
             text = 'Missile',
             text = 'Regeneration',
             link = 'Missile delivery abilities',
             link = 'Regeneration effects',
             symbol = '🏹',
             symbol = '💚',
             color = '#f6d32d'
             class = 'effect-tagged regeneration'
         },
         },
         hand = {
         revitalize = {
             text = 'Hand',
             text = 'Revitalization',
             link = 'Hand delivery abilities',
             link = 'Revitalization effects',
             symbol = '🤚',
             symbol = '🩵',
             color = '#f6d32d'
             class = 'effect-tagged revitalization'
         },
         },
         bite = {
         kill = {
             text = 'Bite',
             text = 'Killing',
             link = 'Bite delivery abilities',
             link = 'Killing effects',
             symbol = '🦷',
             symbol = '☠️',
             color = '#f6d32d'
             class = 'effect-tagged killing'
         },
         },
         item = {
         damage = {
             text = 'Item',
             text = 'Damaging',
             link = 'Item delivery abilities',
             link = 'Damaging effects',
             symbol = '📦',
             symbol = '💢',
             color = '#f6d32d'
             class = 'effect-tagged damaging'
         },
         },
         magelore = {
         drain = {
             text = 'Magelore',
             text = 'Draining',
             link = 'Magelore delivery abilities',
             link = 'Draining effects',
             symbol = '🔮',
             symbol = '🩸',
             color = '#f6d32d'
             class = 'effect-tagged draining'
         },
         },
         weapon = {
         destroy = {
             text = 'Weapon',
             text = 'Destruction',
             link = 'Weapon delivery abilities',
             link = 'Destruction effects',
             symbol = '🗡️',
             symbol = '💥',
             color = '#f6d32d'
             class = 'effect-tagged destruction'
        },
        contract = {
            text = 'Contract',
            link = 'Contract effects',
            symbol = '🤝',
            class = 'effect-tagged contract'
        },
        steal = {
            text = 'Stealing',
            link = 'Stealing effects',
            symbol = '💰',
            class = 'effect-tagged stealing'
         },
         },
         shield = {
         loud = {
             text = 'Shield',
             text = 'Loud',
             link = 'Shield delivery abilities',
             link = 'Loud effects',
             symbol = '🛡️',
             symbol = '🔊',
             color = '#f6d32d'
             class = 'effect-tagged loud'
         },
         },
         armor = {
         knockout = {
             text = 'Armor',
             text = 'Knockout',
             link = 'Armor delivery abilities',
             link = 'Knockout effects',
             symbol = '🪖',
             symbol = '💤',
             color = '#f6d32d'
             class = 'effect-tagged knockout'
         },
         },
         sight = {
         time = {
             text = 'Sight',
             text = 'Temporal',
             link = 'Sight delivery abilities',
             link = 'Temporal effects',
             symbol = '👁️',
             symbol = '🕰️',
             color = '#f6d32d'
             class = 'effect-tagged temporal'
         },
         },
         aura = {
         auto = {
             text = 'Aura',
             text = 'Automatic',
             link = 'Aura delivery abilities',
             link = 'Automatic effects',
             symbol = '🌟',
             symbol = '❗️',
             color = '#f6d32d'
             class = 'effect-tagged automatic'
         },
         },
         cone = {
         lightning = {
             text = 'Cone',
             text = 'Lightning',
             link = 'Cone delivery abilities',
             link = 'Lightning effects',
             symbol = '🐲',
             symbol = '⚡️',
             color = '#f6d32d'
             class = 'effect-tagged lightning'
         },
         },
         other = {
         disease = {
             text = 'Other',
             text = 'Disease',
             link = 'Other delivery abilities',
             link = 'Disease effects',
             symbol = '❓',
             symbol = '🦠',
             color = '#f6d32d'
             class = 'effect-tagged disease'
        },
        vision = {
        text = 'Vision',
        link = 'Vision effects',
        symbol = '🥠',
        class = 'effect-tagged vision'
        },
        morganti = {
        text = 'Morganti',
        link = 'Morganti effects',
        symbol = '⚫️',
        class = 'effect-tagged morganti'
        },
        construction = {
            text = 'Construction',
            link = 'Construction effects',
            symbol = '🔧',
            class = 'effect-tagged construction'
        },
        weather = {
            text = 'Weather',
            link = 'Weather effects',
            symbol = '🌧️',
            class = 'effect-tagged weather'
         }
         }
     },
     },
     target = {
     pre = {
         self = {
         strike = {
             text = 'Self',
             text = 'Strike',
             link = 'Self target abilities',
             link = 'Strike delivery abilities',
             symbol = '🤲',
             symbol = '⚔️',
             color = '#f6d32d'
             class = 'deliveryPackage-tagged strike'
         },
         },
         creature = {
         ray = {
             text = 'Creature',
             text = 'Ray',
             link = 'Creature target abilities',
             link = 'Ray delivery abilities',
             symbol = '👤',
             symbol = '⚡️',
             color = '#f6d32d'
             class = 'deliveryPackage-tagged ray'
         },
         },
         body = {
         ball = {
             text = 'Body',
             text = 'Ball',
             link = 'Body target abilities',
             link = 'Ball delivery abilities',
             symbol = '🧍',
             symbol = '🔥',
             color = '#f6d32d'
             class = 'deliveryPackage-tagged ball'
         },
         },
         vitals = {
         aura = {
             text = 'Vitals',
             text = 'Aura',
             link = 'Vitals target abilities',
             link = 'Aura delivery abilities',
             symbol = '🫀',
             symbol = '🌟',
             color = '#f6d32d'
             class = 'deliveryPackage-tagged aura'
         },
         },
         limb = {
         ritual = {
             text = 'Limb',
             text = 'Ritual',
             link = 'Limb target abilities',
             link = 'Ritual delivery abilities',
             symbol = '🦾',
             symbol = '🕯️',
             color = '#f6d32d'
             class = 'deliveryPackage-tagged ritual'
         },
         },
         arm = {
         touch = {
             text = 'Arm',
             text = 'Touch',
             link = 'Arm target abilities',
             link = 'Touch delivery abilities',
             symbol = '💪',
             symbol = '👉️',
             color = '#f6d32d'
             class = 'deliveryPackage-tagged touch'
         },
         },
         leg = {
    },
             text = 'Leg',
    maneuver = {
             link = 'Leg target abilities',
         active = {
             symbol = '🦵',
             text = 'Active',
             color = '#f6d32d'
             link = 'Active abilities',
             symbol = '➡️',
             class = 'maneuver-tagged active'
         },
         },
         item = {
         reactive = {
             text = 'Item',
             text = 'Reactive',
             link = 'Item target abilities',
             link = 'Reactive abilities',
             symbol = '📦',
             symbol = '↩️',
             color = '#f6d32d'
             class = 'maneuver-tagged reactive'
         },
         },
         weapon = {
         passive = {
             text = 'Weapon',
             text = 'Passive',
             link = 'Weapon target abilities',
             link = 'Passive abilities',
             symbol = '🗡️',
             symbol = '🔁',
             color = '#f6d32d'
             class = 'maneuver-tagged passive'
         },
         },
         shield = {
         slow = {
             text = 'Shield',
             text = 'Slow',
             link = 'Shield target abilities',
             link = 'Slow abilities',
             symbol = '🛡️',
             symbol = '🐢',
             color = '#f6d32d'
             class = 'maneuver-tagged slow'
        },
        armor = {
            text = 'Armor',
            link = 'Armor target abilities',
            symbol = '🪖',
            color = '#f6d32d'
        },
        ship = {
            text = 'Ship',
            link = 'Ship target abilities',
            symbol = '⛵️',
            color = '#f6d32d'
         },
         },
    },
    interaction = {
         attack = {
         attack = {
             text = 'Attack',
             text = 'Attack',
             link = 'Attack target abilities',
             link = 'Attack abilities',
             symbol = '⚔️',
             symbol = '⚔️',
             color = '#f6d32d'
             color = '#ff7800',
            class = 'interaction-tagged attack'
         },
         },
         ability = {
         block = {
        text = 'Ability',
            text = 'Block',
        link = 'Ability target abilities',
            link = 'Block abilities',
        symbol = '🅰',
            symbol = '🛡️',
        color = '#f6d32d'
            color = '#ff7800',
            class = 'interaction-tagged block'
         },
         },
         other = {
         manifest = {
             text = 'Other',
             text = 'Manifest',
             link = 'Other target abilities',
             link = 'Manifest abilities',
             symbol = '❓',
             symbol = '✳️',
             color = '#f6d32d'
             color = '#ff7800',
            class = 'interaction-tagged manifest'
         },
         },
         area = {
         feat = {
             text = 'Area',
             text = 'Feat',
             link = 'Area target abilities',
             link = 'Feat abilities',
             symbol = '🏕️',
             symbol = '🎖️',
             color = '#f6d32d',
            color = '#ff7800',
         },
            class = 'interaction-tagged feat'
         ci = {
        }
             tags = {
    },
                'creature',
    delivery = {
                'item'
        self = {
             }
            text = 'Self',
            link = 'Self delivery abilities',
            symbol = '🤲',
             color = '#f6d32d',
            class = 'delivery-tagged self'
         },
         missile = {
             text = 'Missile',
            link = 'Missile delivery abilities',
            symbol = '🏹',
            color = '#f6d32d',
             class = 'delivery-tagged missile'
         },
         },
         ai = {
         hand = {
             tags = {
             text = 'Hand',
                'attack',
            link = 'Hand delivery abilities',
                'item'
            symbol = '🤚',
             }
            color = '#f6d32d',
             class = 'delivery-tagged hand'
         },
         },
         aci = {
         bite = {
             tags = {
             text = 'Bite',
                'area',
            link = 'Bite delivery abilities',
                'creature',
            symbol = '🦷',
                'item',
             color = '#f6d32d',
             }
             class = 'delivery-tagged bite'
        }
    },
    upgrade = {
        warded = {
            text = 'Warded',
             link = 'Warded abilities',
         },
         },
         absolute = {
         item = {
             text = 'Absolute',
             text = 'Item',
             link = 'Absolute abilities',
             link = 'Item delivery abilities',
        }
             symbol = '📦',
    },
             color = '#f6d32d',
    executionTime = {
             class = 'delivery-tagged item'
        freeAction = {
             text = 'Free action',
             symbol = '0️⃣',
             link = 'Free action abilities',
         },
         },
         singleAction = {
         magelore = {
             text = 'Single action',
             text = 'Magelore',
             symbol = '1️⃣',
            link = 'Magelore delivery abilities',
             link = 'Single action abilities',
             symbol = '🔮',
             color = '#f6d32d',
            class = 'delivery-tagged magelore'
         },
         },
         doubleAction = {
         weapon = {
             text = 'Double action',
             text = 'Weapon',
             symbol = '2️⃣',
            link = 'Weapon delivery abilities',
             link = 'Double action abilities',
             symbol = '🗡️',
             color = '#f6d32d',
            class = 'delivery-tagged weapon'
         },
         },
         tripleAction = {
         shield = {
             text = 'Triple action',
             text = 'Shield',
             symbol = '3️⃣',
            link = 'Shield delivery abilities',
             link = 'Triple action abilities',
             symbol = '🛡️',
             color = '#f6d32d',
            class = 'delivery-tagged shield'
         },
         },
         freeReaction = {
         armor = {
             text = 'Free reaction',
             text = 'Armor',
             symbol = '0️⃣',
            link = 'Armor delivery abilities',
             link = 'Free reaction abilities',
             symbol = '🪖',
             color = '#f6d32d',
            class = 'delivery-tagged armor'
         },
         },
         reaction = {
         sight = {
             text = 'Reaction',
             text = 'Sight',
             symbol = '1️⃣',
            link = 'Sight delivery abilities',
             link = 'Reaction abilities',
             symbol = '👁️',
            color = '#f6d32d',
            class = 'delivery-tagged sight'
        },
        aura = {
            text = 'Aura',
             link = 'Aura delivery abilities',
            symbol = '🌟',
            color = '#f6d32d',
            class = 'delivery-tagged aura'
         },
         },
         shortRest = {
         cone = {
             text = 'Short rest',
             text = 'Cone',
             symbol = '🌙',
            link = 'Cone delivery abilities',
             link = 'Short rest abilities',
             symbol = '🐲',
             color = '#f6d32d',
            class = 'delivery-tagged cone'
         },
         },
         longRest = {
         other = {
             text = 'Long rest',
             text = 'Other',
             symbol = '🌙',
            link = 'Other delivery abilities',
             link = 'Long rest abilities',
             symbol = '❓',
             color = '#f6d32d',
            class = 'delivery-tagged other'
         }
         }
     },
     },
     piercing = {
     target = {
         av0 = {
         self = {
             text = 'AV0',
             text = 'Self',
             symbol = '🎯',
             link = 'Self target abilities',
             link = 'AV0 abilities',
             symbol = '🤲',
             color = '#33d17a'
             color = '#f6d32d',
            class = 'target-tagged self'
         },
         },
         unblockable = {
         creature = {
             text = 'UB',
             text = 'Creature',
             symbol = '🪨',
             link = 'Creature target abilities',
             link = 'UB abilities',
             symbol = '👤',
             color = '#33d17a'
             color = '#f6d32d',
        }
             class = 'target-tagged creature'
    },
    duration = {
        instant = {
             text = 'Instant',
            link = 'Instant duration abilities',
            no = true
         },
         },
         always = {
         body = {
             text = 'Always active',
             text = 'Body',
             link = 'Always active duration abilities',
             link = 'Body target abilities',
             no = true
             symbol = '🧍',
            color = '#f6d32d',
            class = 'target-tagged body'
         },
         },
         whileUp = {
         vitals = {
             text = 'While up',
             text = 'Vitals',
             link = 'While up duration abilities',
             link = 'Vitals target abilities',
             no = true
             symbol = '🫀',
            color = '#f6d32d',
            class = 'target-tagged vitals'
         },
         },
         whileDown = {
         limb = {
             text = 'While down',
             text = 'Limb',
             link = 'While down duration abilities',
             link = 'Limb target abilities',
             no = true
             symbol = '🦾',
            color = '#f6d32d',
            class = 'target-tagged limb'
         },
         },
         whileAlive = {
         arm = {
             text = 'While alive',
             text = 'Arm',
             link = 'While alive duration abilities',
             link = 'Arm target abilities',
             no = true
             symbol = '💪',
            color = '#f6d32d',
            class = 'target-tagged arm'
         },
         },
         whileDead = {
         leg = {
             text = 'While dead',
             text = 'Leg',
             link = 'While dead duration abilities',
             link = 'Leg target abilities',
             no = true
             symbol = '🦵',
            color = '#f6d32d',
            class = 'target-tagged leg'
         },
         },
         endOfTurn = {
         item = {
             text = 'Until the end of the turn',
             text = 'Item',
             link = 'Until end of turn duration abilities',
             link = 'Item target abilities',
             no = true
             symbol = '📦',
            color = '#f6d32d',
            class = 'target-tagged item'
         },
         },
         dawn = {
         weapon = {
             text = 'Until dawn',
             text = 'Weapon',
             link = 'Until dawn duration abilities',
             link = 'Weapon target abilities',
             no = true
             symbol = '🗡️',
            color = '#f6d32d',
            class = 'target-tagged weapon'
         },
         },
         startOfTargetNextTurn = {
         shield = {
             text = 'Until the start of target\'s next turn',
             text = 'Shield',
             link = 'Until start of target\'s next turn duration abilities',
             link = 'Shield target abilities',
             no = true
            symbol = '🛡️',
            color = '#f6d32d',
             class = 'target-tagged shield'
         },
         },
         endOfTargetNextTurn = {
         armor = {
             text = 'Until the end of target\'s next turn',
             text = 'Armor',
             link = 'Until end of target\'s next turn duration abilities',
             link = 'Armor target abilities',
             no = true
            symbol = '🪖',
            color = '#f6d32d',
             class = 'target-tagged armor'
         },
         },
         startOfYourNextTurn = {
         ship = {
             text = 'Until the start of your next turn',
             text = 'Ship',
             link = 'Until start of your next turn duration abilities',
             link = 'Ship target abilities',
             no = true
             symbol = '⛵️',
            color = '#f6d32d',
            class = 'target-tagged ship'
         },
         },
         endOfYourNextTurn = {
         attack = {
             text = 'Until the end of your next turn',
             text = 'Attack',
             link = 'Until end of your next turn duration abilities',
             link = 'Attack target abilities',
             no = true
             symbol = '⚔️',
            color = '#f6d32d',
            class = 'target-tagged attack'
         },
         },
         endOfCombat = {
         ability = {
            text = 'Until the end of combat',
        text = 'Ability',
            link = 'Until end of combat duration abilities',
        link = 'Ability target abilities',
            no = true
        symbol = '🅰',
        }
        color = '#f6d32d',
    },
             class = 'target-tagged ability'
    range = {
        melee = {
            text = 'Your melee range',
             -- link = 'Melee abilities',
            no = true
         },
         },
         weapon = {
         spell = {
             text = 'Your weapon\'s range',
             text = 'Spell',
             -- link = 'Weapon range abilities',
             link = 'Spell target abilities',
             no = true
             symbol = '💫',
            color = '#f6d32d',
            class = 'target-tagged spell'
         },
         },
         hand = {
         other = {
             text = 'Your hand\'s range',
             text = 'Other',
             -- link = 'Hand range abilities',
             link = 'Other target abilities',
             no = true
             symbol = '❓',
            color = '#f6d32d',
            class = 'target-tagged other'
         },
         },
         bite = {
         area = {
             text = 'Your bite\'s range',
             text = 'Area',
             -- link = 'Bite range abilities',
             link = 'Area target abilities',
             no = true
             symbol = '🏕️',
            color = '#f6d32d',
            class = 'target-tagged area'
        },
        ci = {
            tags = {
                'creature',
                'item'
            }
         },
         },
         item = {
         ai = {
             text = 'Your item\'s range',
             tags = {
            -- link = 'Item range abilities',
                'attack',
             no = true
                'item'
             }
         },
         },
         shield = {
         ari = {
             text = 'Your shield\'s range',
             tags = {
            -- link = 'Shield range abilities',
                'area',
             no = true
                'item'
             }
         },
         },
         armor = {
         as = {
            text = 'Your armor\'s range',
        tags = {
            -- link = 'Armor range abilities',
        'area',
            no = true
        'spell',
        }
         },
         },
    },
        arse = {
    attribute = {
        tags = {
        int = {
        'area',
            text = 'Intelligence',
        'self',
            symbol = 'INT',
        }
            link = 'INT save abilities',
         },
         },
         str = {
         si = {
            text = 'Strength',
        tags = {
            symbol = 'STR',
        'item',
            link = 'STR save abilities',
        'self'
        }
         },
         },
         mov = {
         aci = {
             text = 'Movement',
             tags = {
            symbol = 'MOV',
                'area',
            link = 'MOV save abilities',
                'creature',
                'item',
            }
         },
         },
         per = {
         ac = {
             text = 'Perception',
             tags = {
            symbol = 'PER',
                'area',
             link = 'PER save abilities',
                'creature',
             }
         },
         },
         snk = {
         al = {
            text = 'Sneak',
        tags = {
            symbol = 'SNK',
        'arm',
            link = 'SNK save abilities',
        'leg',
        }
        }
    },
    expansion = {
        detonate = {
            text = 'Detonate',
            symbol = '💥',
            link = 'Detonate abilities',
         },
         },
         ripple = {
         cs = {
             text = 'Ripple',
             tags = {
            symbol = '🌊',
                'creature',
             link = 'Ripple abilities',
                'self',
             }
         },
         },
         cascade = {
    },
             text = 'Cascade',
    upgrade = {
             symbol = '⚡️',
         warded = {
             link = 'Cascade abilities',
             text = 'Warded',
             link = 'Warded abilities',
             class = 'upgrade-tagged warded'
         },
         },
         fork = {
         absolute = {
             text = 'Fork',
             text = 'Absolute',
             symbol = '🔱',
             link = 'Absolute abilities',
             link = 'Fork abilities',
             class = 'upgrade-tagged absolute'
         }
         }
     },
     },
     sustained = {
     executionTime = {
         sustained = {
         freeAction = {
             text = 'Sustained',
             text = 'Free action',
             symbol = '⏳️',
             symbol = '0️⃣',
             link = 'Sustained abilities',
             link = 'Free action abilities',
         }
            class = 'executionTime-tagged a0'
    }
         },
}
        singleAction = {
 
            text = 'Single action',
local premades = {
            symbol = '1️⃣',
    strike = {
            link = 'Single action abilities',
        maneuver = 'active',
            class = 'executionTime-tagged a1'
        executionTime = '1a',
        },
        interaction = 'attack',
        doubleAction = {
        delivery = 'weapon',
            text = 'Double action',
         target = 'creature',
            symbol = '2️⃣',
        duration = 'instant',
            link = 'Double action abilities',
        range = 'weapon',
            class = 'executionTime-tagged a2'
    },
        },
    ray = {
        tripleAction = {
        maneuver = 'active',
            text = 'Triple action',
        executionTime = '1a',
            symbol = '3️⃣',
        interaction = 'attack',
            link = 'Triple action abilities',
        delivery = 'missile',
            class = 'executionTime-tagged a3'
         target = 'creature',
        },
        duration = 'instant',
        freeReaction = {
        range = '60f',
            text = 'Free reaction',
        piercing = 'av0',
            symbol = '0️⃣',
            link = 'Free reaction abilities',
            class = 'executionTime-tagged r0'
        },
         reaction = {
            text = 'Reaction',
            symbol = '1️⃣',
            link = 'Reaction abilities',
            class = 'executionTime-tagged r1'
        },
        shortRest = {
            text = 'Short rest',
            symbol = '🌙',
            link = 'Short rest abilities',
            class = 'executionTime-tagged shortRest'
        },
         longRest = {
            text = 'Long rest',
            symbol = '🌙',
            link = 'Long rest abilities',
            class = 'executionTime-tagged longRest'
        },
     },
     },
     ball = {
     piercing = {
         maneuver = 'active',
         av0 = {
        executionTime = '1a',
            text = 'AV0',
        interaction = 'attack',
            symbol = '🎯',
         delivery = 'missile',
            link = 'AV0 abilities',
        target = 'creature',
            color = '#33d17a',
        duration = 'instant',
            class = 'piercing-tagged av0'
        range = '30f',
         },
        piercing = 'ub',
        unblockable = {
            text = 'UB',
            symbol = '🪨',
            link = 'UB abilities',
            color = '#33d17a',
            class = 'piercing-tagged ub'
        }
     },
     },
     aura = {
     duration = {
         skip = true,
         instant = {
        maneuver = 'active',
            text = 'Instant',
        executionTime = '1a',
            link = 'Instant duration abilities',
         interaction = 'feat',
            no = true
         delivery = 'aura',
         },
        target = 'creature',
         always = {
         duration = 'instant',
            text = 'Always active',
         range = '10f',
            link = 'Always active duration abilities',
        attribute = 'mov',
            no = true
    },
         },
    ritual = {
         noLimit = {
        maneuver = 'slow',
            text = 'No limit',
        executionTime = '10m',
            link = 'No limit duration abilities',
         interaction = 'manifest',
            no = true
         delivery = 'sight',
        },
        target = 'creature',
        whileUp = {
        duration = 'instant',
            text = 'While up',
        range = '5f',
            link = 'While up duration abilities',
    },
            no = true
    touch = {
         },
        maneuver = 'active',
         whileDown = {
        executionTime = '1a',
            text = 'While down',
         interaction = 'attack',
            link = 'While down duration abilities',
         delivery = 'hand',
            no = true
        target = 'creature',
        },
         duration = 'instant',
        whileAlive = {
         range = 'hand',
            text = 'While alive',
        piercing = 'ub',
            link = 'While alive duration abilities',
    },
            no = true
    triumph = {
         },
        skip = true,
         whileDead = {
        maneuver = 'reactive',
            text = 'While dead',
         executionTime = '0r',
            link = 'While dead duration abilities',
         interaction = 'manifest',
            no = true
        delivery = 'self',
         },
        target = 'self',
         endOfTurn = {
        duration = 'instant',
            text = 'Until the end of the turn',
        range = 'self',
            link = 'Until end of turn duration abilities',
    },
            no = true
    self = {
        },
        skip = true,
        dawn = {
        maneuver = 'active',
            text = 'Until dawn',
        executionTime = '1a',
            link = 'Until dawn duration abilities',
         interaction = 'man',
            no = true
         delivery = 'self',
         },
        target = 'self',
         startOfTargetNextTurn = {
        duration = 'instant',
            text = 'Until the start of target\'s next turn',
        range = 'self',
            link = 'Until start of target\'s next turn duration abilities',
    },
            no = true
    passive = {
        },
        skip = true,
        endOfTargetNextTurn = {
        maneuver = 'passive',
            text = 'Until the end of target\'s next turn',
         interaction = 'man',
            link = 'Until end of target\'s next turn duration abilities',
         delivery = 'self',
            no = true
        target = 'self',
         },
        duration = '4',
         startOfYourNextTurn = {
         range = 'self',
            text = 'Until the start of your next turn',
            link = 'Until start of your next turn duration abilities',
            no = true
        },
        endOfYourNextTurn = {
            text = 'Until the end of your next turn',
            link = 'Until end of your next turn duration abilities',
            no = true
         },
         endOfCombat = {
            text = 'Until the end of combat',
            link = 'Until end of combat duration abilities',
            no = true
         }
     },
     },
     crown = {
     range = {
         skip = true,
         melee = {
        maneuver = 'active',
            text = 'Your melee range',
        executionTime = '1a',
            -- link = 'Melee abilities',
         interaction = 'man',
            no = true
        delivery = 'self',
         },
         target = 'self',
        weapon = {
        duration = '8h',
            text = 'Your [[:Category:Weapons|weapon\'s]] range',
         range = 'self',
            -- link = 'Weapon range abilities',
        sustained = 'sus',
            no = true
    }
         },
}
        hand = {
 
            text = 'Your [[:Category:Handy equipment|hand\'s]] range',
function noPlural(word)
            -- link = 'Hand range abilities',
    -- Common irregular plural forms
            no = true
    local irregulars = {
         },
         ["children"] = "child",
        bite = {
         ["men"] = "man",
            text = 'Your [[:Category:Biting equipment|bite\'s]] range',
         ["women"] = "woman",
            -- link = 'Bite range abilities',
         ["feet"] = "foot",
            no = true
        ["teeth"] = "tooth",
        },
        ["mice"] = "mouse",
        item = {
        ["geese"] = "goose"
            text = 'Your [[:Category:Items|item\'s]] range',
    }
            -- link = 'Item range abilities',
 
            no = true
     -- Check for irregular forms
         },
     if irregulars[word] then
         shield = {
         return irregulars[word]
            text = 'Your [[:Category:Shields|shield\'s]] range',
    end
            -- link = 'Shield range abilities',
 
            no = true
    -- Regular pluralization rules
         },
    if word:match("ies$") then
         armor = {
         -- Change words ending in 'ies' to 'y' (e.g., "parties" -> "party")
            text = 'Your [[:Category:Armor|armor\'s]] range',
         return word:sub(1, -4) .. "y"
            -- link = 'Armor range abilities',
    elseif word:match("ves$") then
            no = true
        -- Change words ending in 'ves' to 'f' or 'fe' (e.g., "wolves" -> "wolf")
        },
         return word:sub(1, -4) .. "f"
     },
    elseif word:match("s$") and not word:match("ss$") then
     attribute = {
        -- Remove trailing 's' (e.g., "cats" -> "cat", but keep "boss")
         int = {
        return word:sub(1, -2)
            text = 'Intelligence',
    else
            symbol = 'INT',
         -- Return the word unchanged if no pluralization rule applies
            link = 'INT save abilities',
         return word
            class = 'saveAttribute-tagged int'
    end
        },
end
         str = {
 
            text = 'Strength',
local function addCategory(category, key, val, skill, spell, addCats, noLower)
            symbol = 'STR',
    if addCats then
            link = 'STR save abilities',
        if not noLower then
            class = 'saveAttribute-tagged str'
             category = category:lower()
         },
         end
        mov = {
         if tags[key] and tags[key][val] then
            text = 'Movement',
             if tags[key][val].tags then
            symbol = 'MOV',
                out = ''
            link = 'MOV save abilities',
                for _, t in ipairs(tags[key][val].tags) do
            class = 'saveAttribute-tagged mov'
                    out = out .. addCategory(category, key, t, skill, spell, addCats, true)
         },
                end
        per = {
                return out
            text = 'Perception',
             else
            symbol = 'PER',
                category = tags[key][val].link
            link = 'PER save abilities',
             end
            class = 'saveAttribute-tagged per'
         end
         },
         if skill then
         snk = {
             skillCategory = category:gsub('ability', 'skill'):gsub('abilities', 'skills')
            text = 'Sneak',
             skillCategory = skillCategory:gsub("^%l", string.upper)
            symbol = 'SNK',
         end
            link = 'SNK save abilities',
         if spell then
             class = 'saveAttribute-tagged snk'
             spellCategory = category:gsub('ability', 'spell'):gsub('abilities', 'spells')
         },
             spellCategory = spellCategory:gsub("^%l", string.upper)
         unp = {
         end
             text = 'Unused Presence',
         category = category:gsub("^%l", string.upper)
            symbol = 'UNP',
       
            link = 'UNP save abilities',
        local c = '[[Category:' .. tostring(category) .. ']]'
            class = 'saveAttribute-tagged unp'
        if skill then
        },
             c = c .. '[[Category:' .. tostring(skillCategory) .. ']]'
    },
         end
    expansionAttribute = {
         if spell then
        int = {
             c = c .. '[[Category:' .. tostring(spellCategory) .. ']]'
             text = 'Intelligence',
        end
            symbol = 'INT',
        return c
            link = 'INT save abilities',
    else
             class = 'expansionAttribute-tagged int'
        return ''
         },
    end
         str = {
end
             text = 'Strength',
 
            symbol = 'STR',
local function makeTag(frame, key, value, makeCat, transparent)
            link = 'STR save abilities',
    if not tags[key] or not tags[key][value] then
             class = 'expansionAttribute-tagged str'
         if value then
         },
            local out = frame:preprocess("{{ucfirst:" .. tostring(value) .. "}}")
         mov = {
             if not ('.' == out:sub(-1)) then
             text = 'Movement',
                out = out .. '.'
            symbol = 'MOV',
             end
            link = 'MOV save abilities',
             return out
             class = 'expansionAttribute-tagged mov'
        else
         },
            return ''
         per = {
         end
            text = 'Perception',
     end
            symbol = 'PER',
     local tag = tags[key][value]
             link = 'PER save abilities',
    if tag.no then
            class = 'expansionAttribute-tagged per'
         local out = frame:preprocess("{{ucfirst:" .. tag.text .. "}}")
         },
        if not ('.' == out:sub(-1)) then
         snk = {
             out = out .. '.'
             text = 'Sneak',
         end
            symbol = 'SNK',
         return out
            link = 'SNK save abilities',
    end
            class = 'expansionAttribute-tagged snk'
    if tag.tags then
        },
        local out = ''
         unp = {
        for _, t in ipairs(tag.tags) do
             text = 'Unused Presence',
             out = out .. makeTag(frame, key, t, makeCat, transparent)
            symbol = 'UNP',
         end
             link = 'UNP save abilities',
         return out
             class = 'expansionAttribute-tagged unp'
    end
         },
    local tagText = "{{Tag|{{ucfirst:" .. tag.text .. "}}"
     },
    if tag.symbol then
     expansion = {
        tagText = tagText .. "|" .. tag.symbol
         detonate = {
    end
            text = 'Detonate',
    if tag.link then
            symbol = '💥',
         tagText = tagText .. "|l=:Category:{{ucfirst:" .. tag.link .. "}}"
            link = 'Detonate expansion abilities',
    end
             class = 'expansion-tagged detonate'
    if tag.color then
         },
        tagText = tagText .. "|c=" .. tag.color
         ripple = {
     end
            text = 'Ripple',
     if transparent then
            symbol = '🌊',
         tagText = tagText .. "|o=1"
            link = 'Ripple expansion abilities',
    end
             class = 'expansion-tagged ripple'
    tagText = tagText .. "}}"
         },
    -- out = frame:preprocess(tagText)
         cascade = {
    out = tagText
            text = 'Cascade',
     return out
            symbol = '➰',
end
            link = 'Cascade expansion abilities',
            class = 'expansion-tagged cascade'
        },
         fork = {
            text = 'Fork',
            symbol = '🔱',
            link = 'Fork expansion abilities',
            class = 'expansion-tagged fork'
        }
     },
     sustained = {
         sustained = {
            text = 'Sustained',
            symbol = '⏳️',
            link = 'Sustained abilities',
            class = 'sustained'
        }
     }
}


local function makeContent(frame, table, keys, makeCat)
local premades = {
     local content = ''
     strike = {
    local subContent = ''
        maneuver = 'active',
    local hasPre = false
        executionTime = '1a',
    for _, key in ipairs(keys) do
        interaction = 'attack',
         if ('pre' == key and table['pre']) or ('executionTime' == key and table['executionTime']) or ('target' == key) or ('duration' == key) or ('invoked' == key and table['invoked']) then
         delivery = 'weapon',
            hasPre = true
        target = 'creature',
            content = content .. frame:preprocess(makeTag(frame, key, table[key], makeCat))
        duration = 'instant',
         else
        range = 'weapon',
            if hasPre then
    },
                subContent = subContent .. makeTag(frame, key, table[key], makeCat)
    ray = {
            else
        maneuver = 'active',
                content = content .. frame:preprocess(makeTag(frame, key, table[key], makeCat))
        executionTime = '1a',
            end
        interaction = 'attack',
         end
        delivery = 'missile',
     end
        target = 'creature',
     if hasPre then
         duration = 'instant',
         content = content .. frame:preprocess('{{TagSub|' .. subContent .. '}}')
        range = '60f',
         -- content = content .. '{{TagSub|' .. subContent .. '}}'
         piercing = 'av0',
    end
     },
    if content == '' then
     ball = {
         for _, key in ipairs(keys) do
         maneuver = 'active',
            if table[key] then
        executionTime = '1a',
                content = frame:preprocess('{{ucfirst:' .. content .. table[key] .. '}}')
         interaction = 'attack',
            end
        delivery = 'missile',
        end
        target = 'creature',
     end
         duration = 'instant',
     return content
        range = '30f',
end
        piercing = 'ub',
 
     },
local function makeBar(frame, title, content, makeCat)
     aura = {
    if content == '' then
        skip = true,
         return ''
        maneuver = 'active',
    end
         executionTime = '1a',
    local barTitle = mw.html.create('span')
        interaction = 'feat',
    barTitle
         delivery = 'aura',
         :addClass('ability-bar-title')
         target = 'creature',
         :wikitext(frame:preprocess("{{ucfirst:" .. title .. "}}:"))
         duration = 'instant',
         :css('font-weight', 'bold')
        range = '10f',
         :css('margin-right', '0.5em')
         attribute = 'mov',
    local barContent = mw.html.create('span')
    },
    barContent
    ritual = {
         :addClass('ability-bar-content')
        maneuver = 'slow',
         :wikitext(content)
        executionTime = '10m',
    local output = mw.html.create('div')
         interaction = 'manifest',
    output
         delivery = 'sight',
         :addClass('ability-bar')
         target = 'creature',
         :node(barTitle)
         duration = 'instant',
         :node(barContent)
         range = '5f',
     return tostring(output)
     },
end
     touch = {
 
        maneuver = 'active',
local function resolveAlias(args, aliases)
        executionTime = '1a',
     local resolved = {}
        interaction = 'attack',
 
         delivery = 'hand',
    -- Resolve keys
        target = 'creature',
    for canonicalKey, keyAliasList in pairs(aliases.keys) do
        duration = 'instant',
         for _, alias in ipairs(keyAliasList) do
        range = 'hand',
            if args[alias] then
         piercing = 'ub',
                resolved[canonicalKey] = args[alias]
     },
                break
     triumph = {
            end
        skip = true,
         end
         maneuver = 'reactive',
     end
        executionTime = '0r',
 
         interaction = 'manifest',
     -- Resolve values
        delivery = 'self',
    for canonicalKey, canonicalValueTable in pairs(aliases.values) do
        target = 'self',
         local rawValue = resolved[canonicalKey]
        duration = 'instant',
 
        range = 'self',
         if rawValue then
    },
            for canonicalValue, valueAliasList in pairs(canonicalValueTable) do
    self = {
                for _, alias in ipairs(valueAliasList) do
        skip = true,
                    if rawValue == '' then
        maneuver = 'active',
                        resolved[canonicalKey] = false
        executionTime = '1a',
                        break
        interaction = 'man',
                    elseif rawValue == alias then
        delivery = 'self',
                        resolved[canonicalKey] = canonicalValue
        target = 'self',
                        break
        duration = 'instant',
                    -- Handle patterns like timeParse or distParse
        range = 'self',
                    elseif rawValue and type(valueAliasList) == "table" and valueAliasList[1] and rawValue:match(valueAliasList[1]) then
    },
                        if canonicalKey == "duration" or canonicalKey == "executionTime" then
    passive = {
                            -- Parse time duration (e.g., 5d -> "5 days")
        skip = true,
                            local num = tonumber(rawValue:match("^(%d+)"))
        maneuver = 'passive',
                            local unit = rawValue:match("[%a]+$")
        interaction = 'man',
                            local unitMap = {m = "minute", h = "hour", d = "day", w = "week", y = "year"}
        delivery = 'self',
                            local parsedValue = num .. " " .. (unitMap[unit] or "unit") .. (num > 1 and "s" or "")
        target = 'self',
                            resolved[canonicalKey] = parsedValue
        duration = '4',
                        elseif canonicalKey == "range" or canonicalKey == "expansionRange" then
        range = 'self',
                            -- Parse distance (e.g., 30f -> "30 feet")
    },
                            local num = tonumber(rawValue:match("^(%d+)"))
    crown = {
                            local unit = rawValue:match("[%a]+$")
        skip = true,
                            local unitMap = {f = "feet", m = "miles"}
        maneuver = 'active',
                            local parsedValue = num .. " " .. (unitMap[unit] or "unit")
        executionTime = '1a',
                            resolved[canonicalKey] = parsedValue
        interaction = 'man',
                        end
        delivery = 'self',
                    end
        target = 'self',
                end
        duration = '8h',
            end
        range = 'self',
         end
         sustained = 'sus',
     end
     }
}


     return resolved
function noPlural(word)
end
    -- Common irregular plural forms
     local irregulars = {
        ["children"] = "child",
        ["men"] = "man",
        ["women"] = "woman",
        ["feet"] = "foot",
        ["teeth"] = "tooth",
        ["mice"] = "mouse",
        ["geese"] = "goose"
    }


local classFixes = {
    -- Check for irregular forms
     bar = 'ber',
     if irregulars[word] then
    sam = 'due',
        return irregulars[word]
     ama = 'cor'
     end
}


local classArchetypes = {
    -- Regular pluralization rules
     ber = 'warr',
     if word:match("ies$") then
    due = 'warr',
        -- Change words ending in 'ies' to 'y' (e.g., "parties" -> "party")
    vet = 'warr',
        return word:sub(1, -4) .. "y"
     kni = 'warr',
     elseif word:match("ves$") then
    pal = 'warr',
        -- Change words ending in 'ves' to 'f' or 'fe' (e.g., "wolves" -> "wolf")
    ass = 'semi',
        return word:sub(1, -4) .. "f"
    cor = 'semi',
     elseif word:match("s$") and not word:match("ss$") then
     arc = 'semi',
        -- Remove trailing 's' (e.g., "cats" -> "cat", but keep "boss")
    thi = 'semi',
        return word:sub(1, -2)
    ran = 'semi',
     else
    fla = 'mage',
        -- Return the word unchanged if no pluralization rule applies
     sto = 'mage',
        return word
    lif = 'mage',
     end
    nec = 'mage',
end
     nat = 'mage'
}


local className = {
local function addCategory(category, key, val, skill, spell, addCats, noLower)
     ber = 'Berserker',
     if addCats then
    due = 'Duelist',
        if not noLower then
    vet = 'Veteran',
            category = category:lower()
    kni = 'Knight',
        end
    pal = 'Paladin',
        if tags[key] and tags[key][val] then
    ass = 'Assassin',
            if tags[key][val].tags then
    cor = 'Corsair',
                out = ''
    arc = 'Archer',
                for _, t in ipairs(tags[key][val].tags) do
    thi = 'Thief',
                    out = out .. addCategory(category, key, t, skill, spell, addCats, true)
    ran = 'Ranger',
                end
    fla = 'Flame Mage',
                return out
    sto = 'Storm Mage',
            else
    lif = 'Life Mage',
                category = tags[key][val].link
    nec = 'Necromancer',
            end
    nat = 'Nature Mage',
        end
}
        if skill then
 
            skillCategory = category:gsub('ability', 'skill'):gsub('abilities', 'skills')
local archetypeName = {
            skillCategory = skillCategory:gsub("^%l", string.upper)
    warr = 'Warrior',
        end
    semi = 'Semi',
        if spell then
    mage = 'Mage',
            spellCategory = category:gsub('ability', 'spell'):gsub('abilities', 'spells')
}
            spellCategory = spellCategory:gsub("^%l", string.upper)
 
        end
function p.a ( frame )
        category = category:gsub("^%l", string.upper)
 
       
    makeCat = true
        local c = '[[Category:' .. tostring(category) .. ']]'
 
        if skill then
    -- Figure out all the default values
            c = c .. '[[Category:' .. tostring(skillCategory) .. ']]'
    local args = frame.args
        end
    local resolved = {}
         if spell then
    if args['pre'] then
             c = c .. '[[Category:' .. tostring(spellCategory) .. ']]'
        local toResolve = resolveAlias(premades[args['pre']], aliases)
         for k, v in pairs(toResolve) do
             resolved[k] = v
         end
         end
        return c
    else
        return ''
     end
     end
    local userResolve = resolveAlias(args, aliases)
end
    for k, v in pairs(userResolve) do
 
        resolved[k] = v
local function makeTag(frame, key, value, makeCat, transparent)
    end
     if not tags[key] or not tags[key][value] then
     if resolved['pre'] and premades[args['pre']]['skip'] then
        if value then
         resolved['pre'] = nil
            local out = frame:preprocess("{{ucfirst:" .. tostring(value) .. "}}")
            if not ('.' == out:sub(-1)) then
                out = out .. '.'
            end
            return out
         else
            return ''
        end
     end
     end
 
    local tag = tags[key][value]
     if resolved['interaction'] == 'attack' then
     if tag.no then
         local dc = "Hit target's AC"
         local out = frame:preprocess("{{ucfirst:" .. tag.text .. "}}")
         if resolved['target'] == 'limb' then
         if not ('.' == out:sub(-1)) then
             dc = dc .. ' + 2'
             out = out .. '.'
         end
         end
         if resolved['target'] == 'arm' then
         return out
             dc = dc .. ' + 2'
    end
    if tag.tags then
        local out = ''
        for _, t in ipairs(tag.tags) do
             out = out .. makeTag(frame, key, t, makeCat, transparent)
         end
         end
         if resolved['target'] == 'leg' then
         return out
            dc = dc .. ' + 2'
    end
        end
    local tagText = "{{Tag|{{ucfirst:" .. tag.text .. "}}"
        if resolved['target'] == 'vitals' then
    if tag.symbol then
            dc = dc .. ' + 5'
        tagText = tagText .. "|" .. tag.symbol
        end
    end
        if resolved['target'] == 'item' then
    if tag.link then
            dc = "Hit user's AC - target's BV"
        tagText = tagText .. "|l=:Category:{{ucfirst:" .. tag.link .. "}}"
        end
    end
        if resolved['target'] == 'shield' then
    if tag.color then
            dc = "Hit user's AC - target's BV"
        tagText = tagText .. "|c=" .. tag.color
        end
    end
        if resolved['target'] == 'armor' then
    if tag.class then
            dc = "Hit user's AC - target's AV"
        tagText = tagText .. "|class=" .. tag.class
        end
        if resolved['target'] == 'weapon' then
            dc = "Hit user's AC - target's BV"
        end
        resolved['hitDC'] = dc
     end
     end
 
     if transparent then
     if resolved['invoked'] then
         tagText = tagText .. "|o=1"
         resolved['verbal'] = 'verbal'
        resolved['somatic'] = 'somatic'
        resolved['mage'] = 'magelore'
     end
     end
    tagText = tagText .. "}}"
    -- out = frame:preprocess(tagText)
    out = tagText
    return out
end


     local skill = false
local function makeContent(frame, table, keys, makeCat)
     local spell = false
     local content = ''
     local standard = false
     local subContent = ''
 
     local hasPre = false
    local class = nil
    for _, key in ipairs(keys) do
    local classFull = nil
        if ('pre' == key and table['pre']) or ('executionTime' == key and table['executionTime']) or ('target' == key) or ('duration' == key) or ('invoked' == key and table['invoked']) then
    local archetype = nil
            hasPre = true
    local archetypeFull = nil
            content = content .. frame:preprocess(makeTag(frame, key, table[key], makeCat))
    local rank = nil
         else
    if args['class'] then
            if hasPre then
        class = args['class']
                subContent = subContent .. makeTag(frame, key, table[key], makeCat)
         if classFixes[class] then
             else
             class = classFixes[class]
                content = content .. frame:preprocess(makeTag(frame, key, table[key], makeCat))
            end
         end
         end
     end
     end
     if args['class'] or args['arch'] then
     if hasPre then
         archetype = classArchetypes[class]
        content = content .. frame:preprocess('{{TagSub|' .. subContent .. '}}')
        if args['arch'] then
         -- content = content .. '{{TagSub|' .. subContent .. '}}'
            archetype = args['arch']
    end
        end
    if content == '' then
        classFull = className[class]
         for _, key in ipairs(keys) do
        archetypeFull = archetypeName[archetype]
            if table[key] then
        standard = true
                content = frame:preprocess('{{ucfirst:' .. content .. table[key] .. '}}')
        if archetype == 'warr' or archetype == 'semi' then
             end
            skill = true
         end
        if archetype == 'mage' then
             spell = true
         end
         end
     end
     end
     local costMP = nil
     return content
    local costHP = nil
end
     if args['pre'] == 'crown' then
 
         spell = true
local function makeBar(frame, title, content, link, flags, bottom)
        costMP = '1'
     if content == '' then
        rank = '2'
         return ''
     end
     end
     if args['rank'] then
     local barSpace = mw.html.create('span')
         rank = args['rank']
    barSpace
        :wikitext(frame:preprocess(' '))
        :css('display', 'none')
    local barTitle = mw.html.create('span')
    local barTitleClass = title:lower()
    barTitleClass = barTitleClass:gsub(' ', '-')
    barTitleClass = barTitleClass:gsub('\'', '')
    barTitleClass = barTitleClass:gsub('\"', '')
    local barText = "{{ucfirst:" .. title .. "}}"
    if link then
         barText = "[[" .. link .. "|" .. barText .. "]]"
     end
     end
      
     barText = barText .. ":"
     if args['skill'] then
     barTitle
         skill = true
        :addClass('ability-bar-title')
         if args['skill'] == '0' or args['skill'] == 'false' then
        :wikitext(frame:preprocess(barText))
            skill = false
         :css('font-weight', 'bold')
        end
         :css('margin-right', '0.5em')
    local barContent = mw.html.create('span')
    barContent
        :addClass('ability-bar-content')
        :wikitext(content)
    local output = mw.html.create('div')
    if bottom then
        output = mw.html.create('span')
     end
     end
     if args['spell'] then
     if not flags then
         spell = true
         flags = {}
        if args['spell'] == '0' or args['spell'] == 'false' then
            spell = false
        end
     end
     end
     if args['standard'] then
     for k, v in pairs(flags) do
        standard = true
         if type(v) == 'string' then
         if args['standard'] == '0' or args['standard'] == 'false' then
            output:addClass('flag-' .. k .. '-' .. v)
            standard = false
         end
         end
     end
     end
     if args['mp'] then
     output
         costMP = args['mp']
        :addClass('ability-bar')
    end
         :addClass('ability-bar-' .. barTitleClass)
    if args['hp'] then
        :attr(flags)
         costHP = args['hp']
        :attr('test', 'out')
     end
        :node(barSpace)
        :node(barTitle)
        :node(barSpace)
        :node(barContent)
         :css('display', 'block')
     -- if flags then
        -- for k, v in ipairs(flags) do
        --    output:attr(k, v)
        -- end
    -- end
    return tostring(output)
end
 
local function resolveAlias(args, aliases)
    local resolved = {}


     local basic = false
     -- Resolve keys
     local journeyman = false
     for canonicalKey, keyAliasList in pairs(aliases.keys) do
    if args['basic'] then
        for _, alias in ipairs(keyAliasList) do
        basic = true
            if args[alias] then
    end
                resolved[canonicalKey] = args[alias]
    if args['journeyman'] or args['jm'] then
                break
         journeyman = true
            end
         end
     end
     end


     -- Category string
     -- Resolve values
     local c = ''
     for canonicalKey, canonicalValueTable in pairs(aliases.values) do
        local rawValue = resolved[canonicalKey]


    local name = args['name']
        if rawValue then
    local page = mw.title.getCurrentTitle().text
            for canonicalValue, valueAliasList in pairs(canonicalValueTable) do
    local namespace = frame:preprocess('{{NAMESPACE}}')
                for _, alias in ipairs(valueAliasList) do
    local addCats = ((namespace == 'Ability') and (page == name))
                    if rawValue == '' then
    c = c .. addCategory('Abilities', nil, nil, skill, spell, addCats)
                        resolved[canonicalKey] = false
    if basic then
                        break
        c = c .. addCategory('Basic abilities', 'basic', nil, skill, spell, addCats)
                    elseif rawValue == alias then
                        resolved[canonicalKey] = canonicalValue
                        break
                    -- Handle patterns like timeParse or distParse
                    elseif rawValue and type(valueAliasList) == "table" and valueAliasList[1] and rawValue:match(valueAliasList[1]) then
                        if canonicalKey == "duration" or canonicalKey == "executionTime" then
                            -- Parse time duration (e.g., 5d -> "5 days")
                            local num = tonumber(rawValue:match("^(%d+)"))
                            local unit = rawValue:match("[%a]+$")
                            local unitMap = {m = "minute", h = "hour", d = "day", w = "week", y = "year", r = "round", s = "second"}
                            if unitMap[unit] then
                                local parsedValue = num .. " " .. unitMap[unit] .. (num > 1 and "s" or "")
                                resolved[canonicalKey] = parsedValue
                            else
                                resolved[canonicalKey] = rawValue
                            end
                        elseif canonicalKey == "range" or canonicalKey == "expansionRange" then
                            -- Parse distance (e.g., 30f -> "30 feet")
                            local num = tonumber(rawValue:match("^(%d+)"))
                            local unit = rawValue:match("[%a]+$")
                            local unitMap = {f = "feet", m = "miles"}
                            if unitMap[unit] then
                                local parsedValue = num .. " " .. unitMap[unit]
                                resolved[canonicalKey] = parsedValue
                            else
                                resolved[canonicalKey] = rawValue
                            end
                        end
                    end
                end
            end
        end
     end
     end
     if journeyman then
 
        c = c .. addCategory('Journeyman abilities', 'journeyman', nil, skill, spell, addCats)
     return resolved
    end
end
     if standard then
 
        c = c .. addCategory('Standard abilities', nil, nil, false, false, addCats)
local function exists(arg)
        if skill then
    return arg ~= nil and arg ~= '' and arg ~= false
            c = c .. addCategory('Semblant skills', nil, nil, skill, spell, addCats)
end
        end
 
        if spell then
local classFixes = {
            c = c .. addCategory('Conjured spells', nil, nil, skill, spell, addCats)
     bar = 'ber',
        end
    sam = 'due',
    end
    ama = 'cor'
     if args['ethereal'] then
}
        c = c .. addCategory('Ethereal abilities', nil, nil, skill, spell, addCats)
 
     end
local classArchetypes = {
    if (archetype and archetypeFull) then
     ber = 'warr',
        c = c .. addCategory(archetypeFull .. ' archetype abilities', 'archetype', archetype, skill, spell, addCats)
    due = 'warr',
    end
     vet = 'warr',
     if (class and classFull) then
    kni = 'warr',
        c = c .. addCategory(classFull .. ' class abilities', 'class', class, skill, spell, addCats, true)
     pal = 'warr',
     end
    ass = 'semi',
    if (rank and (class and classFull)) then
     cor = 'semi',
        if rank == '3' then
    arc = 'semi',
            rank = '3+'
    thi = 'semi',
        end
    ran = 'semi',
        c = c .. addCategory('Rank ' .. rank .. ' ' .. classFull .. ' abilities', 'rank', rank, skill, spell, addCats, true)
     fla = 'mage',
     end
    sto = 'mage',
    if resolved['pre'] then
    lif = 'mage',
        c = c .. addCategory(resolved['pre'] .. 'abilities', 'pre', resolved['pre'], skill, spell, addCats)
    nec = 'mage',
     end
     nat = 'mage'
    if resolved['interaction'] then
}
        c = c .. addCategory(resolved['interaction'] .. ' interaction abilities', 'interaction', resolved['interaction'], skill, spell, addCats)
 
     end
local className = {
    if resolved['delivery'] then
    ber = 'Berserker',
        c = c .. addCategory(resolved['delivery'] .. ' delivery abilities', 'delivery', resolved['delivery'], skill, spell, addCats)
    due = 'Duelist',
     end
    vet = 'Veteran',
    if resolved['target'] then
     kni = 'Knight',
        c = c .. addCategory(resolved['target'] .. ' target abilities', 'target', resolved['target'], skill, spell, addCats)
    pal = 'Paladin',
     end
    ass = 'Assassin',
    if resolved['duration'] then
    cor = 'Corsair',
        c = c .. addCategory(noPlural(resolved['duration']) .. ' duration abilities', 'duration', resolved['duration'], skill, spell, addCats)
     arc = 'Archer',
    end
    thi = 'Thief',
     -- if resolved['range'] then
    ran = 'Ranger',
     --    c = c .. addCategory(resolved['range'] .. ' range abilities', 'range', resolved['range'], skill, spell, addCats)
    fla = 'Flame Mage',
    -- end
     sto = 'Storm Mage',
    if resolved['expansion'] then
    lif = 'Life Mage',
        c = c .. addCategory(resolved['expansion'] .. ' expansion abilities', 'expansion', resolved['expansion'], skill, spell, addCats)
    nec = 'Necromancer',
     end
    nat = 'Nature Mage',
     -- if resolved['expansionRange'] then
}
     --    c = c .. addCategory(resolved['expansionRange'] .. ' expansion range abilities', 'expansionRange', resolved['expansionRange'], skill, spell, addCats)
 
     -- end
local archetypeName = {
     if resolved['attribute'] then
     warr = 'Warrior',
         c = c .. addCategory(resolved['attribute'] .. ' save abilities', 'attribute', resolved['attribute'], skill, spell, addCats)
     semi = 'Semi',
    mage = 'Mage',
}
 
function p.a ( frame )
 
     makeCat = true
 
     -- Figure out all the default values
     local args = frame.args
     local resolved = {}
     if args['pre'] then
         local toResolve = resolveAlias(premades[args['pre']], aliases)
        for k, v in pairs(toResolve) do
            resolved[k] = v
        end
     end
     end
     if resolved['piercing'] then
     local userResolve = resolveAlias(args, aliases)
        c = c .. addCategory(resolved['piercing'] .. ' abilities', 'piercing', resolved['piercing'], skill, spell, addCats)
    for k, v in pairs(userResolve) do
        resolved[k] = v
     end
     end
     if resolved['sustained'] then
     if resolved['pre'] and premades[args['pre']]['skip'] then
        c = c .. addCategory('Sustained abilities', 'sustained', resolved['sustained'], skill, spell, addCats)
        resolved['pre'] = nil
     end
     end
     if resolved['upgrade'] then
     if not resolved['duration'] then
         c = c .. addCategory(resolved['upgrade'] .. ' abilities', 'upgrade', resolved['upgrade'], skill, spell, addCats)
         resolved['duration'] = 'instant'
     end
     end
     if resolved['executionTime'] then
 
         c = c .. addCategory(noPlural(resolved['executionTime']) .. ' execution time abilities', 'executionTime', resolved['executionTime'], skill, spell, addCats)
     if resolved['interaction'] == 'attack' then
         local dc = "Hit target's {{AC}}"
        if resolved['target'] == 'limb' then
            dc = "Hit target's {{Var:ACLimb}}"
        end
        if resolved['target'] == 'al' then
        dc = "Hit target's {{Var:ACLimb}}"
    end
        if resolved['target'] == 'arm' then
            dc = "Hit target's {{Var:ACLimb}}"
        end
        if resolved['target'] == 'leg' then
            dc = "Hit target's {{Var:ACLimb}}"
        end
        if resolved['target'] == 'vitals' then
            dc = "Hit target's {{Var:ACVitals}}"
        end
        if resolved['target'] == 'item' or resolved['target'] == 'ari' then
            dc = "Hit {{DC}} [[Core:Item Target|depends on item]]"
        end
        if resolved['target'] == 'shield' then
            dc = "Hit user's {{Var:ACWielded}}"
        end
        if resolved['target'] == 'armor' then
            dc = "Hit user's {{Var:ACWorn}}"
        end
        if resolved['target'] == 'weapon' then
            dc = "Hit user's {{Var:ACWielded}}"
        end
        resolved['hitDC'] = dc
     end
     end
     if resolved['maneuver'] then
 
         c = c .. addCategory(resolved['maneuver'] .. ' abilities', 'maneuver', resolved['maneuver'], skill, spell, addCats)
     if resolved['expansionCount'] then
         if resolved['expansionCount'] == '1' then
            resolved['expansionCount'] = '{{Space}}' .. resolved['expansionCount'] .. ' extra execution.'
        else
            resolved['expansionCount'] = '{{Space}}' .. resolved['expansionCount'] .. ' extra executions.'
        end
     end
     end
     if resolved['verbal'] then
 
         c = c .. addCategory('Verbal component abilities', 'verbal', resolved['verbal'], skill, spell, addCats)
     if resolved['invoked'] then
    end
         resolved['verbal'] = 'verbal'
    if resolved['somatic'] then
         resolved['somatic'] = 'somatic'
         c = c .. addCategory('Somatic component abilities', 'somatic', resolved['somatic'], skill, spell, addCats)
         resolved['mage'] = 'magelore'
    end
    if resolved['material'] then
         c = c .. addCategory('Material component abilities', 'material', resolved['material'], skill, spell, addCats)
    end
    if resolved['magelore'] then
        c = c .. addCategory('Magelore component abilities', 'magelore', resolved['magelore'], skill, spell, addCats)
    end
    if resolved['invoked'] then
        c = c .. addCategory('Invoke component abilities', 'invoked', resolved['invoked'], skill, spell, addCats)
     end
     end


     local elementContent = ''
     local skill = false
     if args['life'] then
    local spell = false
         elementContent = elementContent .. makeTag(frame, 'elements', 'life', makeCat)
    local standard = false
         c = c .. addCategory('Life element abilities', 'elements', 'life', skill, spell, addCats)
 
    local class = nil
    local classFull = nil
    local archetype = nil
    local archetypeFull = nil
    local rank = nil
     if args['class'] then
         class = args['class']
         if classFixes[class] then
            class = classFixes[class]
        end
     end
     end
     if args['storm'] then
     if args['class'] or args['arch'] then
         elementContent = elementContent .. makeTag(frame, 'elements', 'storm', makeCat)
         archetype = classArchetypes[class]
         c = c .. addCategory('Storm element abilities', 'elements', 'storm', skill, spell, addCats)
        if args['arch'] then
            archetype = args['arch']
        end
        classFull = className[class]
         archetypeFull = archetypeName[archetype]
        standard = true
        if archetype == 'warr' or archetype == 'semi' then
            skill = true
        end
        if archetype == 'mage' then
            spell = true
        end
     end
     end
     if args['necro'] then
    local costMP = nil
         elementContent = elementContent .. makeTag(frame, 'elements', 'necro', makeCat)
    local costHP = nil
         c = c .. addCategory('Necromancy element abilities', 'elements', 'necro', skill, spell, addCats)
    local costGP = nil
     if args['pre'] == 'crown' then
         spell = true
        costMP = '1'
         rank = '2'
     end
     end
     if args['flame'] then
     if args['rank'] then
         elementContent = elementContent .. makeTag(frame, 'elements', 'flame', makeCat)
         rank = args['rank']
        c = c .. addCategory('Flame element abilities', 'elements', 'flame', skill, spell, addCats)
     end
     end
     if args['nature'] then
   
         elementContent = elementContent .. makeTag(frame, 'elements', 'nature', makeCat)
     if args['skill'] then
        c = c .. addCategory('Nature element abilities', 'elements', 'nature', skill, spell, addCats)
         skill = true
        if args['skill'] == '0' or args['skill'] == 'false' then
            skill = false
        end
     end
     end
 
     if args['spell'] then
    local powerContent = ''
         spell = true
     if args['magic'] then
         if args['spell'] == '0' or args['spell'] == 'false' then
         powerContent = powerContent .. makeTag(frame, 'power', 'magic', makeCat)
            spell = false
         c = c .. addCategory('Magically powered abilities', 'power', 'magic', skill, spell, addCats) .. addCategory('Magical effects', nil, nil, false, false, addCats)
        end
     end
     end
     if args['divine'] then
     if args['standard'] then
         powerContent = powerContent .. makeTag(frame, 'power', 'divine', makeCat)
         standard = true
         c = c .. addCategory('Divinely powered abilities', 'power', 'divine', skill, spell, addCats) .. addCategory('Divine effects', nil, nil, false, false, addCats)
         if args['standard'] == '0' or args['standard'] == 'false' then
            standard = false
        end
     end
     end
     if args['spirit'] then
     if args['mp'] and args['mp']:len() > 0 then
        powerContent = powerContent .. makeTag(frame, 'power', 'spirit', makeCat)
         costMP = args['mp']
         c = c .. addCategory('Spiritually powered abilities', 'power', 'spirit', skill, spell, addCats) .. addCategory('Spiritual effects', nil, nil, false, false, addCats)
     end
     end
     if args['primal'] then
     if args['hp'] and args['hp']:len() > 0 then
        powerContent = powerContent .. makeTag(frame, 'power', 'primal', makeCat)
         costHP = args['hp']
         c = c .. addCategory('Primally powered abilities', 'power', 'primal', skill, spell, addCats) .. addCategory('Primal effects', nil, nil, false, false, addCats)
     end
     end
     if args['martial'] then
     if args['gp'] and args['gp']:len() > 0 then
        powerContent = powerContent .. makeTag(frame, 'power', 'martial', makeCat)
         costGP = args['gp']
         c = c .. addCategory('Martially powered abilities', 'power', 'martial', skill, spell, addCats)
     end
     end
     if args['psionic'] then
     if exists(args['shatter']) then
        powerContent = powerContent .. makeTag(frame, 'power', 'psionic', makeCat)
    costShatter = args['shatter']
        c = c .. addCategory('Psionically powered abilities', 'power', 'psionic', skill, spell, addCats) .. addCategory('Mental effects', nil, nil, false, false, addCats)
     end
     end
     if args['techo'] then
 
         powerContent = powerContent .. makeTag(frame, 'power', 'techo', makeCat)
    local basic = false
        c = c .. addCategory('Technologically powered abilities', 'power', 'techo', skill, spell, addCats) .. addCategory('Technological effects', nil, nil, false, false, addCats)
    local journeyman = false
     if args['basic'] then
         basic = true
     end
     end
     if args['finance'] then
     if args['journeyman'] or args['jm'] then
        powerContent = powerContent .. makeTag(frame, 'power', 'finance', makeCat)
         journeyman = true
         c = c .. addCategory('Financially powered abilities', 'power', 'finance', skill, spell, addCats) .. addCategory('Financial effects', nil, nil, false, false, addCats)
     end
     end
     if args['alchemy'] then
 
        powerContent = powerContent .. makeTag(frame, 'power', 'alchemy', makeCat)
    -- Category string
        c = c .. addCategory('Alchemically powered abilities', 'power', 'alchemy', skill, spell, addCats) .. addCategory('Alchemical effects', nil, nil, false, false, addCats)
    local c = ''
 
     local name = args['name']
    local page = mw.title.getCurrentTitle().text
    local namespace = frame:preprocess('{{NAMESPACE}}')
    local addCats = ((namespace == 'Ability') and (page == name))
    c = c .. addCategory('Abilities', nil, nil, skill, spell, addCats)
    if basic then
        c = c .. addCategory('Basic abilities', 'basic', nil, skill, spell, addCats)
     end
     end
     if standard and skill then
     if journeyman then
         powerContent = powerContent .. makeTag(frame, 'category', 'semblant', makeCat)
         c = c .. addCategory('Journeyman abilities', 'journeyman', nil, skill, spell, addCats)
     end
     end
     powerContent = powerContent .. elementContent
     local esContent = ''
     if skill then
     if args['es'] and args['es']:len() > 0 then
         powerContent = powerContent .. makeTag(frame, 'category', 'skill', makeCat)
         esContent = esContent .. makeTag(frame, 'es', 'es', makeCat)
        c = c .. addCategory('Elder Sorcery abilities', 'es', 'es', skill, spell, addCats)
    else
    if spell then
    standard = '1'
end
     end
     end
     if standard and spell then
     if standard then
         powerContent = powerContent .. makeTag(frame, 'category', 'conjure', makeCat)
         c = c .. addCategory('Standard abilities', nil, nil, false, false, addCats)
        if skill then
            c = c .. addCategory('Semblant skills', nil, nil, skill, spell, addCats)
        end
        if spell then
            c = c .. addCategory('Conjured spells', nil, nil, skill, spell, addCats)
        end
    else
        c = c .. addCategory('Nonstandard abilities', nil, nil, skill, spell, addCats)
     end
     end
     if class then
     if args['ethereal'] then
         classContent = makeContent(frame, resolved, {'class'}, makeCat)
         c = c .. addCategory('Ethereal abilities', nil, nil, skill, spell, addCats)
        powerContent = powerContent .. classContent
     end
     end
     if spell then
     if args['av'] then
        powerContent = powerContent .. makeTag(frame, 'category', 'spell', makeCat)
    c = c .. addCategory('AV granting abilities', nil, nil, skill, spell, addCats, true)
    c = c .. addCategory('AV' .. args['av'] .. ' granting abilities', nil, nil, skill, spell, addCats, true)
     end
     end
 
     if (archetype and archetypeFull) then
    local effectContent = ''
         c = c .. addCategory(archetypeFull .. ' archetype abilities', 'archetype', archetype, skill, spell, addCats)
     if args['mental'] then
        effectContent = effectContent .. makeTag(frame, 'effects', 'mental', makeCat)
         c = c .. addCategory('Mental effects', 'effect', 'mental', skill, spell, addCats)
     end
     end
     if args['truth'] then
     if (class and classFull) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'truth', makeCat)
         c = c .. addCategory(classFull .. ' class abilities', 'class', class, skill, spell, addCats, true)
         c = c .. addCategory('Truth detecting effects', 'effect', 'truth', skill, spell, addCats)
     end
     end
     if args['duelMod'] then
     if (rank and (class and classFull)) then
         effectContent = effectContent .. makeTag(frame, 'effects', 'duelMod', makeCat)
         if rank == '3' then
         c = c .. addCategory('Duel modifying effects', 'effect', 'duelMod', skill, spell, addCats)
            rank = '3+'
        end
         c = c .. addCategory('Rank ' .. rank .. ' ' .. classFull .. ' abilities', 'rank', rank, skill, spell, addCats, true)
     end
     end
     if args['movement'] then
     if resolved['pre'] then
         effectContent = effectContent .. makeTag(frame, 'effects', 'movement', makeCat)
         c = c .. addCategory(resolved['pre'] .. 'abilities', 'pre', resolved['pre'], skill, spell, addCats)
        c = c .. addCategory('Movement effects', 'effect', 'movement', skill, spell, addCats)
     end
     end
     if args['displacement'] then
     if resolved['interaction'] then
         effectContent = effectContent .. makeTag(frame, 'effects', 'displacement', makeCat)
         c = c .. addCategory(resolved['interaction'] .. ' interaction abilities', 'interaction', resolved['interaction'], skill, spell, addCats)
        c = c .. addCategory('Displacement effects', 'effect', 'displacement', skill, spell, addCats)
     end
     end
     if args['transformation'] then
     if resolved['delivery'] then
         effectContent = effectContent .. makeTag(frame, 'effects', 'transformation', makeCat)
         c = c .. addCategory(resolved['delivery'] .. ' delivery abilities', 'delivery', resolved['delivery'], skill, spell, addCats)
        c = c .. addCategory('Transformation effects', 'effect', 'transformation', skill, spell, addCats)
     end
     end
     if args['control'] then
     if resolved['target'] then
         effectContent = effectContent .. makeTag(frame, 'effects', 'control', makeCat)
         c = c .. addCategory(resolved['target'] .. ' target abilities', 'target', resolved['target'], skill, spell, addCats)
        c = c .. addCategory('Control effects', 'effect', 'control', skill, spell, addCats)
     end
     end
     if args['resist'] then
     if resolved['duration'] then
         effectContent = effectContent .. makeTag(frame, 'effects', 'resist', makeCat)
         c = c .. addCategory(noPlural(resolved['duration']) .. ' duration abilities', 'duration', resolved['duration'], skill, spell, addCats)
        c = c .. addCategory('Resistance effects', 'effect', 'resist', skill, spell, addCats)
     end
     end
     if args['immune'] then
     -- if resolved['range'] then
        effectContent = effectContent .. makeTag(frame, 'effects', 'immune', makeCat)
    --    c = c .. addCategory(resolved['range'] .. ' range abilities', 'range', resolved['range'], skill, spell, addCats)
         c = c .. addCategory('Immunity effects', 'effect', 'immune', skill, spell, addCats)
    -- end
    if resolved['expansion'] then
         c = c .. addCategory(resolved['expansion'] .. ' expansion abilities', 'expansion', resolved['expansion'], skill, spell, addCats)
     end
     end
     if args['long'] then
     -- if resolved['expansionRange'] then
        effectContent = effectContent .. makeTag(frame, 'effects', 'long', makeCat)
    --    c = c .. addCategory(resolved['expansionRange'] .. ' expansion range abilities', 'expansionRange', resolved['expansionRange'], skill, spell, addCats)
         c = c .. addCategory('Long range effects', 'effect', 'long', skill, spell, addCats)
    -- end
    if resolved['attribute'] then
         c = c .. addCategory(resolved['attribute'] .. ' save abilities', 'attribute', resolved['attribute'], skill, spell, addCats)
     end
     end
     if args['sense'] then
     if resolved['piercing'] then
         effectContent = effectContent .. makeTag(frame, 'effects', 'sense', makeCat)
         c = c .. addCategory(resolved['piercing'] .. ' abilities', 'piercing', resolved['piercing'], skill, spell, addCats)
        c = c .. addCategory('Sensory effects', 'effect', 'sense', skill, spell, addCats)
     end
     end
     if args['revive'] or args['rev'] then
     if resolved['sustained'] then
        effectContent = effectContent .. makeTag(frame, 'effects', 'revive', makeCat)
         c = c .. addCategory('Sustained abilities', 'sustained', resolved['sustained'], skill, spell, addCats)
         c = c .. addCategory('Revival effects', 'effect', 'revive', skill, spell, addCats)
     end
     end
     if args['summon'] then
     if resolved['upgrade'] then
         effectContent = effectContent .. makeTag(frame, 'effects', 'summon', makeCat)
         c = c .. addCategory(resolved['upgrade'] .. ' abilities', 'upgrade', resolved['upgrade'], skill, spell, addCats)
        c = c .. addCategory('Summoning effects', 'effect', 'summon', skill, spell, addCats)
     end
     end
     if args['heal'] then
     if resolved['executionTime'] then
         effectContent = effectContent .. makeTag(frame, 'effects', 'heal', makeCat)
         c = c .. addCategory(noPlural(resolved['executionTime']) .. ' execution time abilities', 'executionTime', resolved['executionTime'], skill, spell, addCats)
         c = c .. addCategory('Healing effects', 'effect', 'heal', skill, spell, addCats)
    end
    if resolved['maneuver'] then
        c = c .. addCategory(resolved['maneuver'] .. ' abilities', 'maneuver', resolved['maneuver'], skill, spell, addCats)
    end
    if resolved['verbal'] then
         c = c .. addCategory('Verbal component abilities', 'verbal', resolved['verbal'], skill, spell, addCats)
     end
     end
     if args['reanimate'] or args['rean'] then
     if resolved['somatic'] then
        effectContent = effectContent .. makeTag(frame, 'effects', 'reanimate', makeCat)
         c = c .. addCategory('Somatic component abilities', 'somatic', resolved['somatic'], skill, spell, addCats)
         c = c .. addCategory('Reanimation effects', 'effect', 'reanimate', skill, spell, addCats)
     end
     end
     if args['regenerate'] or args['regen'] then
     if resolved['material'] then
        effectContent = effectContent .. makeTag(frame, 'effects', 'regenerate', makeCat)
         c = c .. addCategory('Material component abilities', 'material', resolved['material'], skill, spell, addCats)
         c = c .. addCategory('Regeneration effects', 'effect', 'regenerate', skill, spell, addCats)
     end
     end
     if args['kill'] then
     if resolved['magelore'] then
        effectContent = effectContent .. makeTag(frame, 'effects', 'kill', makeCat)
         c = c .. addCategory('Magelore component abilities', 'magelore', resolved['magelore'], skill, spell, addCats)
         c = c .. addCategory('Killing effects', 'effect', 'kill', skill, spell, addCats)
     end
     end
     if args['steal'] then
     if resolved['invoked'] then
        effectContent = effectContent .. makeTag(frame, 'effects', 'steal', makeCat)
         c = c .. addCategory('Invoke abilities', 'invoked', resolved['invoked'], skill, spell, addCats)
         c = c .. addCategory('Stealing effects', 'effect', 'steal', skill, spell, addCats)
     end
     end


     local costContent = ''
     local flawContent = ''
     if costMP then
     if args['flaw'] or args['f'] or args['fl'] then
        c = c .. addCategory('MP cost abilities', 'costMP', costMP, skill, spell, addCats, true)
        flawContent = flawContent .. makeTag(frame, 'flaw', 'flaw', makeCat)
        if costMP == 'x' then
         c = c .. addCategory('Flaw abilities', 'flaw', 'flaw', skill, spell, addCats)
            costContent = costContent .. frame:preprocess("{{Tag|X MP|🩵|l=:Category:MP cost abilities|c=#3584e4}}")
            c = c .. addCategory('Variable MP cost abilities', 'costMP', 'x', skill, spell, addCats, true)
         else
            costContent = costContent .. frame:preprocess("{{Tag|" .. costMP .. " MP|🩵|l=:Category:MP cost abilities|c=#3584e4}}")
            c = c .. addCategory(costMP .. ' MP cost abilities', 'costMP', costMP, skill, spell, addCats, true)
        end
     end
     end
     if costHP then
    local specialContent = ''
        c = c .. addCategory('HP cost abilities', 'costHP', costHP, skill, spell, addCats, true)
     if args['special'] or args['s'] or args['sp'] and ((args['special']:len() > 0) or (args['s']:len() > 0) or (args['sp']:len() > 0)) then
        if costHP == 'x' then
        specialContent = specialContent .. makeTag(frame, 'special', 'special', makeCat)
            costContent = costContent .. frame:preprocess("{{Tag|X HP|❤️|l=:Category:HP cost abilities|c=#e01b24}}")
         c = c .. addCategory('Special abilities', 'special', 'special', skill, spell, addCats)
            c = c .. addCategory('Variable HP cost abilities', 'costHP', 'x', skill, spell, addCats, true)
         else
            costContent = costContent .. frame:preprocess("{{Tag|" .. costHP .. " HP|❤️|l=:Category:HP cost abilities|c=#e01b24}}")
            c = c .. addCategory(costHP .. ' HP cost abilities', 'costHP', costHP, skill, spell, addCats, true)
        end
     end
     end
     if args['cost'] then
    local wardedContent = ''
         costContent = costContent .. frame:preprocess(args['cost'])
     if args['warded'] and args['warded']:len() > 0 then
         wardedContent = wardedContent .. makeTag(frame, 'warded', 'warded', makeCat)
        c = c .. addCategory('Warded abilities', 'warded', 'warded', skill, spell, addCats)
     end
     end


     local executionTimeTitle = 'Execution time'
     local elementContent = ''
     if spell then
     if args['life'] and args['life']:len() > 0 then
         executionTimeTitle = 'Casting time'
        elementContent = elementContent .. makeTag(frame, 'elements', 'life', makeCat)
        c = c .. addCategory('Life element abilities', 'elements', 'life', skill, spell, addCats)
    end
    if args['storm'] and args['storm']:len() > 0 then
         elementContent = elementContent .. makeTag(frame, 'elements', 'storm', makeCat)
        c = c .. addCategory('Storm element abilities', 'elements', 'storm', skill, spell, addCats)
    end
    if (args['necro'] and args['necro']:len() > 0) or (args['necromancy'] and args['necromancy']:len() > 0) then
        elementContent = elementContent .. makeTag(frame, 'elements', 'necro', makeCat)
        c = c .. addCategory('Necromancy element abilities', 'elements', 'necro', skill, spell, addCats)
     end
     end
 
     if args['flame'] and args['flame']:len() > 0 then
     local heightenedContent = ''
         elementContent = elementContent .. makeTag(frame, 'elements', 'flame', makeCat)
    if args['heightened'] then
         c = c .. addCategory('Flame element abilities', 'elements', 'flame', skill, spell, addCats)
         heightenedContent = heightenedContent .. 'For each additional {{L|Core|MP}} spent, ' .. args['heightened'] .. ' You can only {{L|Core|Heightening|Heighten}} if you are {{L|Core|Proficiency Bonus|Proficient}} or {{L|Core|Fluency Bonus|Fluent}} in ' .. args['name'] .. ' and only up to the corresponding bonus.'
         c = c .. addCategory('Heightened abilities', 'heightened', args['heightened'], skill, spell, addCats, true)
     end
     end
 
     if args['nature'] and args['nature']:len() > 0 then
     local proficiencyContent = ''
         elementContent = elementContent .. makeTag(frame, 'elements', 'nature', makeCat)
    if args['pro'] then
        c = c .. addCategory('Nature element abilities', 'elements', 'nature', skill, spell, addCats)
         proficiencyContent = proficiencyContent .. frame:preprocess(args['pro'])
     end
     end


     local fluencyContent = ''
     local powerContent = ''
     if args['flu'] then
    local martial = true
         fluencyContent = fluencyContent .. frame:preprocess(args['flu'])
     if args['magic'] and args['magic']:len() > 0 then
         martial = false
        powerContent = powerContent .. makeTag(frame, 'power', 'magic', makeCat)
        c = c .. addCategory('Magically powered abilities', 'power', 'magic', skill, spell, addCats) .. addCategory('Magical effects', nil, nil, false, false, addCats)
     end
     end
 
     if args['divine'] and args['divine']:len() > 0 then
     local restrictionContent = ''
         martial = false
    if args['restrict'] then
        powerContent = powerContent .. makeTag(frame, 'power', 'divine', makeCat)
         restrictionContent = restrictionContent .. frame:preprocess(args['restrict'])
        c = c .. addCategory('Divinely powered abilities', 'power', 'divine', skill, spell, addCats) .. addCategory('Divine effects', nil, nil, false, false, addCats)
     end
     end
 
     if args['spirit'] and args['spirit']:len() > 0 then
    local statValContent = ''
         martial = false
    local statFeatContent = ''
         powerContent = powerContent .. makeTag(frame, 'power', 'spirit', makeCat)
     if args['vstat'] and args['val'] then
         c = c .. addCategory('Spiritually powered abilities', 'power', 'spirit', skill, spell, addCats) .. addCategory('Spiritual effects', nil, nil, false, false, addCats)
        local vstat = frame:preprocess("{{uc:" .. args['vstat'] .. "}}")
         statValContent = 'This ability sets your {{L|Core|' .. vstat .. '}}' .. ' score to a minimum of ' .. args['val'] .. '.'
         c = c .. addCategory('Attribute setting abilities', 'val', args['val'], skill, spell, addCats, true)
         c = c .. addCategory(vstat .. ' setting abilities', 'vstat', args['vstat'], skill, spell, addCats, true)
        c = c .. addCategory(vstat .. ' value of ' .. args['val'] .. ' setting abilities', 'val', args['val'], skill, spell, addCats, true)
     end
     end
     if args['fstat'] and (args['fflu'] or args['fpro']) then
     if args['primal'] and args['primal']:len() > 0 then
        local f = 'Proficiency'
         martial = false
        local fstat = frame:preprocess("{{uc:" .. args['fstat'] .. "}}")
         powerContent = powerContent .. makeTag(frame, 'power', 'primal', makeCat)
        if args['fflu'] then
         c = c .. addCategory('Primally powered abilities', 'power', 'primal', skill, spell, addCats) .. addCategory('Primal effects', nil, nil, false, false, addCats)
            f = 'Fluency'
         end
        statFeatContent = 'This ability gives {{L|Core|' .. f .. ' Bonus|' .. f .. '}} in {{L|Core|' .. fstat .. '}} {{L|Core|Feat Interaction|Feat Saves}}.'
         c = c .. addCategory('Feat Save improvement abilities', 'flu', args['fflu'], skill, spell, addCats)
         c = c .. addCategory('Feat Save ' .. f .. ' granting abilities', 'fstat', args['fstat'], skill, spell, addCats, true)
        c = c .. addCategory(fstat .. ' Feat Save ' .. f .. ' granting abilities', 'fstat', args['fstat'], skill, spell, addCats, true)
     end
     end
 
    if args['psionic'] and args['psionic']:len() > 0 then
     -- Remove range from self targeted abilities
        martial = false
     if resolved['target'] == 'self' or resolved['range'] == 'self' then
        powerContent = powerContent .. makeTag(frame, 'power', 'psionic', makeCat)
         resolved['range'] = nil
        c = c .. addCategory('Psionically powered abilities', 'power', 'psionic', skill, spell, addCats) .. addCategory('Mental effects', nil, nil, false, false, addCats)
    end
    if args['techno'] and args['techno']:len() > 0 then
        martial = false
        powerContent = powerContent .. makeTag(frame, 'power', 'techno', makeCat)
        c = c .. addCategory('Technologically powered abilities', 'power', 'techno', skill, spell, addCats) .. addCategory('Technological effects', nil, nil, false, false, addCats)
     end
    if args['finance'] and args['finance']:len() > 0 then
        martial = false
        powerContent = powerContent .. makeTag(frame, 'power', 'finance', makeCat)
        c = c .. addCategory('Financially powered abilities', 'power', 'finance', skill, spell, addCats) .. addCategory('Financial effects', nil, nil, false, false, addCats)
    end
    if args['matpow'] and args['matpow']:len() > 0 then
        martial = false
        powerContent = powerContent .. makeTag(frame, 'power', 'matpow', makeCat)
        c = c .. addCategory('Financially powered abilities', 'power', 'matpow', skill, spell, addCats) .. addCategory('Material effects', nil, nil, false, false, addCats)
    end
    if args['alchemy'] and args['alchemy']:len() > 0 then
        martial = false
        powerContent = powerContent .. makeTag(frame, 'power', 'alchemy', makeCat)
        c = c .. addCategory('Alchemically powered abilities', 'power', 'alchemy', skill, spell, addCats) .. addCategory('Alchemical effects', nil, nil, false, false, addCats)
    end
     if args['unknown'] and args['unknown']:len() > 0 then
        martial = false
        powerContent = powerContent .. makeTag(frame, 'power', 'unknown', makeCat)
        c = c .. addCategory('Unknown powered abilities', 'power', 'unknown', skill, spell, addCats)
    end
    if args['martial'] and args['martial']:len() > 0 then
        martial = true
    end
    if martial then
        powerContent = powerContent .. makeTag(frame, 'power', 'martial', makeCat)
        c = c .. addCategory('Martially powered abilities', 'power', 'martial', skill, spell, addCats)
    end
    if class then
         classContent = makeContent(frame, resolved, {'class'}, makeCat)
        powerContent = powerContent .. classContent
    end
    if args['rotator'] and args['rotator']:len() > 0 then
        powerContent = powerContent .. makeTag(frame, 'category', 'rotator', makeCat)
    end
    if args['gm'] and args['gm']:len() > 0 then
        powerContent = powerContent .. makeTag(frame, 'gm', args['gm'], makeCat)
    end
    if args['guildmaster'] and args['guildmaster']:len() > 0 then
        powerContent = powerContent .. makeTag(frame, 'category', 'guildmaster', makeCat)
    end
    powerContent = powerContent .. elementContent
    if skill then
        powerContent = powerContent .. makeTag(frame, 'category', 'skill', makeCat)
    end
    if spell then
        powerContent = powerContent .. makeTag(frame, 'category', 'spell', makeCat)
     end
     end


     local barsTop = {
     local deliveryContent = ''
         -- {
    if standard and skill then
         --     title = 'elements',
         deliveryContent = deliveryContent .. makeTag(frame, 'category', 'semblant', makeCat)
         --     content = frame:preprocess(elementContent)
    end
         -- },
    if standard and spell then
         {
         deliveryContent = deliveryContent .. makeTag(frame, 'category', 'conjure', makeCat)
            title = 'power sources',
    end
            content = frame:preprocess(powerContent)
 
         },
     local effectContent = ''
         {
    if exists(args['mental']) then
            title = 'effect types',
        effectContent = effectContent .. makeTag(frame, 'effects', 'mental', makeCat)
            content = frame:preprocess(effectContent)
         c = c .. addCategory('Mental effects', 'effect', 'mental', skill, spell, addCats)
         },
    end
         {
     if exists(args['truth']) then
            title = 'delivery',
        effectContent = effectContent .. makeTag(frame, 'effects', 'truth', makeCat)
            content = makeContent(frame, resolved, {'pre', 'upgrade', 'piercing', 'delivery', 'interaction'}, makeCat)
        c = c .. addCategory('Truth detecting effects', 'effect', 'truthDetecting', skill, spell, addCats)
         },
    end
         {
    if exists(args['duelMod']) then
            title = 'saving feature',
        effectContent = effectContent .. makeTag(frame, 'effects', 'duelModifying', makeCat)
            content = makeContent(frame, resolved, {'attribute'}, makeCat)
         c = c .. addCategory('Duel modifying effects', 'effect', 'duelModifying', skill, spell, addCats)
         },
    end
         {
    if exists(args['movement']) then
            title = 'target',
         effectContent = effectContent .. makeTag(frame, 'effects', 'movement', makeCat)
            content = makeContent(frame, resolved, {'target', 'hitDC'}, makeCat)
        c = c .. addCategory('Movement effects', 'effect', 'movement', skill, spell, addCats)
         },
    end
         {
    if exists(args['poison']) then
            title = executionTimeTitle,
        effectContent = effectContent .. makeTag(frame, 'effects', 'poison', makeCat)
            content = makeContent(frame, resolved, {'executionTime', 'maneuver'}, makeCat)
        c = c .. addCategory('Poison effects', 'effect', 'poison', skill, spell, addCats)
         },
    end
         {
    if exists(args['illusion']) then
            title = 'trigger',
         effectContent = effectContent .. makeTag(frame, 'effects', 'illusion', makeCat)
            content = args['trigger'] or ''
         c = c .. addCategory('Illusion effects', 'effect', 'illusion', skill, spell, addCats)
         },
    end
         {
    if exists(args['displacement']) then
            title = 'cost and components',
        effectContent = effectContent .. makeTag(frame, 'effects', 'displacement', makeCat)
            content = frame:preprocess(costContent) .. makeContent(frame, resolved, {'material', 'invoked', 'verbal', 'somatic', 'magelore'}, makeCat)
        c = c .. addCategory('Displacement effects', 'effect', 'displacement', skill, spell, addCats)
         },
    end
         {
    if exists(args['transformation']) then
            title = 'Mana cost',
        effectContent = effectContent .. makeTag(frame, 'effects', 'transformation', makeCat)
            content = args['mpx'] or ''
        c = c .. addCategory('Transformation effects', 'effect', 'transformation', skill, spell, addCats)
         },
    end
         {
    if exists(args['control']) then
            title = 'Hit cost',
        effectContent = effectContent .. makeTag(frame, 'effects', 'control', makeCat)
            content = args['hpx'] or ''
         c = c .. addCategory('Control effects', 'effect', 'control', skill, spell, addCats)
         },
    end
         {
    if exists(args['resist']) then
            title = 'Material cost',
         effectContent = effectContent .. makeTag(frame, 'effects', 'resist', makeCat)
            content = makeContent(frame, resolved, {'matx'}, makeCat)
        c = c .. addCategory('Resistance effects', 'effect', 'resist', skill, spell, addCats)
         },
    end
         {
    if exists(args['hexproof']) then
            title = 'duration',
        effectContent = effectContent .. makeTag(frame, 'effects', 'hexproof', makeCat)
            content = makeContent(frame, resolved, {'duration', 'sustained'}, makeCat)
        c = c .. addCategory('Hexproof effects', 'effect', 'hexproof', skill, spell, addCats)
         },
    end
         {
    if exists(args['awaken']) then
            title = 'range',
        effectContent = effectContent .. makeTag(frame, 'effects', 'awaken', makeCat)
            content = makeContent(frame, resolved, {'range'}, makeCat)
         c = c .. addCategory('Awakening effects', 'effect', 'awaken', skill, spell, addCats)
         },
    end
         {
    if exists(args['immune']) then
            title = 'expansion',
         effectContent = effectContent .. makeTag(frame, 'effects', 'immune', makeCat)
            content = makeContent(frame, resolved, {'expansion'}, makeCat)
        c = c .. addCategory('Immunity effects', 'effect', 'immune', skill, spell, addCats)
         },
    end
         {
    if exists(args['hexseal']) then
            title = 'expansion range',
        effectContent = effectContent .. makeTag(frame, 'effects', 'hexseal', makeCat)
            content = makeContent(frame, resolved, {'expansionRange'}, makeCat)
         c = c .. addCategory('Hexseal effects', 'effect', 'hexseal', skill, spell, addCats)
         },
    end
     }
    if exists(args['long']) then
         effectContent = effectContent .. makeTag(frame, 'effects', 'long', makeCat)
        c = c .. addCategory('Long range effects', 'effect', 'long', skill, spell, addCats)
    end
    if exists(args['sense']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'sense', makeCat)
        c = c .. addCategory('Sensory effects', 'effect', 'sense', skill, spell, addCats)
    end
    if exists(args['revive'] or args['rev']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'revive', makeCat)
         c = c .. addCategory('Revival effects', 'effect', 'revive', skill, spell, addCats)
    end
    if exists(args['summon']) then
         effectContent = effectContent .. makeTag(frame, 'effects', 'summon', makeCat)
        c = c .. addCategory('Summoning effects', 'effect', 'summon', skill, spell, addCats)
    end
    if exists(args['heal']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'heal', makeCat)
         c = c .. addCategory('Healing effects', 'effect', 'heal', skill, spell, addCats)
    end
    if exists(args['reanimate'] or args['rean']) then
         effectContent = effectContent .. makeTag(frame, 'effects', 'reanimate', makeCat)
        c = c .. addCategory('Reanimation effects', 'effect', 'reanimate', skill, spell, addCats)
    end
    if exists(args['regenerate'] or args['regen']) then
         effectContent = effectContent .. makeTag(frame, 'effects', 'regenerate', makeCat)
         c = c .. addCategory('Regeneration effects', 'effect', 'regenerate', skill, spell, addCats)
    end
    if exists(args['revitalize'] or args['revit']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'revitalize', makeCat)
        c = c .. addCategory('Revitalization effects', 'effect', 'revitalize', skill, spell, addCats)
    end
    if exists(args['kill']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'kill', makeCat)
        c = c .. addCategory('Killing effects', 'effect', 'kill', skill, spell, addCats)
    end
    if exists(args['damage']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'damage', makeCat)
         c = c .. addCategory('Damaging effects', 'effect', 'damage', skill, spell, addCats)
    end
    if exists(args['drain']) then
         effectContent = effectContent .. makeTag(frame, 'effects', 'drain', makeCat)
        c = c .. addCategory('Draining effects', 'effect', 'drain', skill, spell, addCats)
    end
    if exists(args['destroy']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'destroy', makeCat)
         c = c .. addCategory('Destruction effects', 'effect', 'destroy', skill, spell, addCats)
    end
    if exists(args['contract']) then
         effectContent = effectContent .. makeTag(frame, 'effects', 'contract', makeCat)
        c = c .. addCategory('Contract effects', 'effect', 'contract', skill, spell, addCats)
    end
    if exists(args['steal']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'steal', makeCat)
         c = c .. addCategory('Stealing effects', 'effect', 'steal', skill, spell, addCats)
    end
    if exists(args['loud']) then
         effectContent = effectContent .. makeTag(frame, 'effects', 'loud', makeCat)
        c = c .. addCategory('Loud effects', 'effect', 'loud', skill, spell, addCats)
    end
    if exists(args['knockout']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'knockout', makeCat)
         c = c .. addCategory('Knockout effects', 'effect', 'knockout', skill, spell, addCats)
    end
    if exists(args['time']) then
         effectContent = effectContent .. makeTag(frame, 'effects', 'time', makeCat)
        c = c .. addCategory('Temporal effects', 'effect', 'time', skill, spell, addCats)
    end
    if exists(args['lightning']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'lightning', makeCat)
         c = c .. addCategory('Lightning effects', 'effect', 'lightning', skill, spell, addCats)
    end
    if exists(args['disease']) then
         effectContent = effectContent .. makeTag(frame, 'effects', 'disease', makeCat)
        c = c .. addCategory('Disease effects', 'effect', 'disease', skill, spell, addCats)
    end
    if exists(args['vision']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'vision', makeCat)
         c = c .. addCategory('Vision effects', 'effect', 'vision', skill, spell, addCats)
    end
    if exists(args['morganti']) then
         effectContent = effectContent .. makeTag(frame, 'effects', 'morganti', makeCat)
        c = c .. addCategory('Morganti effects', 'effect', 'morganti', skill, spell, addCats)
    end
    if exists(args['construction']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'construction', makeCat)
         c = c .. addCategory('Construction effects', 'effect', 'construction', skill, spell, addCats)
    end
    if exists(args['weather']) then
         effectContent = effectContent .. makeTag(frame, 'effects', 'weather', makeCat)
        c = c .. addCategory('Weather effects', 'effect', 'weather', skill, spell, addCats)
    end
 
    local autoContent = ''
    if exists(args['auto']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'auto', makeCat)
         c = c .. addCategory('Automatic effects', 'effect', 'auto', skill, spell, addCats)
        autoContent = autoContent .. ' This triggers automatically. You cannot choose to not use it if you are able to.'
     end


     local barsBottom = {
     local costContent = ''
         {
    if costMP then
             title = 'Requirements',
        c = c .. addCategory('MP cost abilities', 'costMP', costMP, skill, spell, addCats, true)
             content = makeContent(frame, resolved, {'requirement'}, makeCat)
        if costMP == 'x' then
         },
            costContent = costContent .. frame:preprocess("{{Tag|X MP|🩵|l=:Category:MP cost abilities|c=#3584e4|class=cost-tagged mpx}}")
         {
            c = c .. addCategory('Variable MP cost abilities', 'costMP', 'x', skill, spell, addCats, true)
             title = 'End condition',
         else
            content = args['end'] or ''
            costContent = costContent .. frame:preprocess("{{Tag|" .. costMP .. " MP|🩵|l=:Category:MP cost abilities|c=#3584e4|class=cost-tagged mp" .. costMP .. "}}")
         },
             c = c .. addCategory(costMP .. ' MP cost abilities', 'costMP', costMP, skill, spell, addCats, true)
         {
        end
            title = 'On critical hit',
    end
            content = args['crithit'] or ''
    if costHP then
         },
        c = c .. addCategory('HP cost abilities', 'costHP', costHP, skill, spell, addCats, true)
         {
        if costHP == 'x' then
            title = 'On hit',
             costContent = costContent .. frame:preprocess("{{Tag|X HP|❤️|l=:Category:HP cost abilities|c=#e01b24|class=cost-tagged hpx}}")
            content = args['hit'] or ''
            c = c .. addCategory('Variable HP cost abilities', 'costHP', 'x', skill, spell, addCats, true)
         },
        else
         {
            costContent = costContent .. frame:preprocess("{{Tag|" .. costHP .. " HP|❤️|l=:Category:HP cost abilities|c=#e01b24|class=cost-tagged hp" .. costHP .. "}}")
            title = 'On miss',
            c = c .. addCategory(costHP .. ' HP cost abilities', 'costHP', costHP, skill, spell, addCats, true)
            content = args['miss'] or ''
        end
         },
    end
         {
    if costGP then
            title = 'On critically miss',
        c = c .. addCategory('GP cost abilities', 'costGP', costGP, skill, spell, addCats, true)
            content = args['critmiss'] or ''
         if costGP == 'x' then
         },
            costContent = costContent .. frame:preprocess("{{Tag|X GP|🪙|l=:Category:GP cost abilities|c=#F6D32D|class=cost-tagged gpx}}")
         {
            c = c .. addCategory('Variable GP cost abilities', 'costGP', 'x', skill, spell, addCats, true)
             title = 'On critical fail',
         else
             content = args['critfail'] or ''
            costContent = costContent .. frame:preprocess("{{Tag|" .. costGP .. " GP|🪙|l=:Category:GP cost abilities|c=#F6D32D|class=cost-tagged gp" .. costGP .. "}}")
         },
             c = c .. addCategory(costGP .. ' GP cost abilities', 'costGP', costGP, skill, spell, addCats, true)
         {
        end
             title = 'On fail',
    end
             content = args['fail'] or ''
    if costShatter then
         },
        c = c .. addCategory('Shatter cost abilities', 'costShatter', costShatter, skill, spell, addCats)
         {
        costContent = costContent .. frame:preprocess("{{Tag|Shatter|💥|l=:Category:Shatter cost abilities|class=cost-tagged shatter}}")
             title = 'On success',
    end
             content = args['success'] or ''
    if args['cost'] then
        costContent = costContent .. frame:preprocess(args['cost'])
    end
 
    local executionTimeTitle = 'Execution time'
    if spell then
        executionTimeTitle = 'Casting time'
    end
 
    local expansionContent = 'TEST'
    -- if args['ec'] or args['expCount'] or args['expansionCount'] then
    --    -- local ec = args['ec'] or args['expCount'] or args['expansionCount']
    --    -- ec = tostring(ec)
    --    local ec = '1'
    --    expansionContent = 'This ability expands ' .. ec .. ' time' .. (tonumber(ec) > 1 and 's' or '') .. '.'
    -- end
 
    local heightenedContent = ''
    if args['heightened'] and args['heightened']:len() > 0 then
         heightenedContent = heightenedContent .. 'For each additional {{MP}} spent, ' .. args['heightened']
         -- heightenedContent = heightenedContent .. ' You can only {{L|Core|Heightening|Heighten}} if you are {{L|Core|Proficiency Bonus|Proficient}} or {{L|Core|Fluency Bonus|Fluent}} in ' .. args['name'] .. ' and only up to the corresponding bonus.'
        c = c .. addCategory('Heightened abilities', 'heightened', args['heightened'], skill, spell, addCats, true)
    end
 
    local proficiencyContent = ''
    if args['pro'] then
        proficiencyContent = proficiencyContent .. frame:preprocess(args['pro'])
    end
 
    local fluencyContent = ''
    if args['flu'] then
        fluencyContent = fluencyContent .. frame:preprocess(args['flu'])
    end
 
    local restrictionContent = ''
    if args['restrict'] then
        restrictionContent = restrictionContent .. frame:preprocess(args['restrict'])
    end
 
    local statValContent = ''
    local statFeatContent = ''
    if args['vstat'] and args['val'] then
        local vstat = frame:preprocess("{{uc:" .. args['vstat'] .. "}}")
         statValContent = 'This ability sets your {{L|Core|' .. vstat .. '}}' .. ' score to a minimum of ' .. args['val'] .. '.'
        c = c .. addCategory('Attribute setting abilities', 'val', args['val'], skill, spell, addCats, true)
         c = c .. addCategory(vstat .. ' setting abilities', 'vstat', args['vstat'], skill, spell, addCats, true)
        c = c .. addCategory(vstat .. ' value of ' .. args['val'] .. ' setting abilities', 'val', args['val'], skill, spell, addCats, true)
    end
    local f = 'proficiency'
    if args['fflu'] then
        f = 'fluency'
    end
    if args['fstat'] and (args['fflu'] or args['fpro']) then
        local fstat = frame:preprocess("{{uc:" .. args['fstat'] .. "}}")
         statFeatContent = 'This ability gives {{L|Core|' .. f .. ' Bonus|' .. f .. '}} in {{L|Core|' .. fstat .. '}} {{L|Core|Feat Interaction|Feat Saves}}.'
        c = c .. addCategory('Feat save improvement abilities', 'flu', args['fflu'], skill, spell, addCats)
         c = c .. addCategory('Feat save ' .. f .. ' granting abilities', 'fstat', args['fstat'], skill, spell, addCats, true)
        c = c .. addCategory(fstat .. ' feat save ' .. f .. ' granting abilities', 'fstat', args['fstat'], skill, spell, addCats, true)
    end
    if args['rotator'] and args['rotator']:len() > 0 then
        c = c .. addCategory('Rotator abilities', 'rotator', args['rotator'], skill, spell, addCats)
    end
    if args['gm'] then
         c = c .. addCategory(tags['gm'][args['gm']]['link'], 'gm', args['gm'], skill, spell, addCats)
    end
    if args['guildmaster'] then
         c = c .. addCategory('Guildmaster abilities', 'guildmaster', args['guildmaster'], skill, spell, addCats)
    end
    if args['style'] then
        c = c .. addCategory('Casting style abilities', 'style', args['style'], skill, spell, addCats)
    end
    if args['weapon'] then
        c = c .. addCategory('Weapon fighting style abilities', 'weapon', args['weapon'], skill, spell, addCats)
    end
 
    -- Remove range from self targeted abilities
    if resolved['target'] == 'self' or resolved['range'] == 'self' then
        resolved['range'] = nil
    end
 
    local barsTop = {
        -- {
        --    title = 'elements',
         --    content = frame:preprocess(elementContent)
        -- },
         {
             title = 'power sources',
             content = frame:preprocess(esContent .. powerContent),
            link = ':Category:Powered abilities'
        },
        {
            title = 'effect types',
            content = frame:preprocess(flawContent .. specialContent .. effectContent),
            link = ':Category:Effects'
         },
         {
             title = 'delivery',
             content = frame:preprocess(wardedContent .. deliveryContent) .. makeContent(frame, resolved, {'expansion', 'pre', 'upgrade', 'piercing', 'delivery', 'interaction'}, makeCat),
            link = ':Category:Delivery abilities'
         },
         {
             title = 'save attribute',
             content = makeContent(frame, resolved, {'attribute'}, makeCat),
            link = 'Core:Feat Interaction'
         },
         },
         {
         {
             title = 'On critical success',
             title = 'expansion save attribute',
             content = args['critsuccess'] or ''
             content = makeContent(frame, resolved, {'expansionAttribute'}, makeCat),
         },
         },
         {
        {
             title = 'Heightened',
            title = 'target',
             content = frame:preprocess(heightenedContent)
            content = makeContent(frame, resolved, {'target', 'hitDC'}, makeCat),
         },
            link = ':Category:Target abilities'
         {
        },
             title = 'If proficient',
        {
             content = proficiencyContent
            title = executionTimeTitle,
         },
            content = makeContent(frame, resolved, {'executionTime', 'maneuver'}, makeCat),
         {
            link = 'Core:Maneuvers'
             title = 'If fluent',
        },
             content = fluencyContent
        {
         },
            title = 'trigger',
         {
            content = (args['trigger'] or '') .. autoContent,
             title = 'Attribute improvement',
            link = 'Core:Reactive Maneuvers'
             content = frame:preprocess(statValContent)
        },
         },
        {
         {
            title = 'cost and components',
             title = 'Feat save improvement',
            content = frame:preprocess(costContent) .. makeContent(frame, resolved, {'material', 'invoked', 'verbal', 'somatic', 'magelore'}, makeCat),
             content = frame:preprocess(statFeatContent)
            link = ':Category:Cost abilities'
         }
        },
     }
        {
 
            title = 'Mana cost',
     local outputTop = ''
            content = args['mpx'] or '',
     for _, bar in ipairs(barsTop) do
            link = ':Category:MP cost abilities'
         outputTop = outputTop .. makeBar(frame, bar['title'], bar['content'])
        },
     end
        {
     local outputBottom = ''
            title = 'Hit cost',
 
            content = args['hpx'] or '',
     for _, bar in ipairs(barsBottom) do
            link = ':Category:HP cost abilities'
         outputBottom = outputBottom .. makeBar(frame, bar['title'], bar['content'])
        },
     end
        {
 
            title = 'Gold cost',
     local outputMiddle = ''
            content = args['gpx'] or '',
     if args['e'] then
            link = ':Category:GP cost abilities'
         outputMiddle = frame:preprocess(args['e'])
        },
        {
            title = 'Material cost',
            content = makeContent(frame, resolved, {'matx'}, makeCat),
            link = ':Category:Material component abilities'
        },
        {
            title = 'duration',
            content = makeContent(frame, resolved, {'duration', 'sustained'}, makeCat),
            link = ':Category:Duration abilities'
        },
        {
            title = 'range',
            content = makeContent(frame, resolved, {'range'}, makeCat),
            link = 'Core:Range'
        },
        -- {
        --    title = 'expansion',
        --    content = makeContent(frame, resolved, {'expansion'}, makeCat)
        -- },
        {
            title = 'expansion range',
            content = makeContent(frame, resolved, {'expansionRange'}, makeCat),
            link = 'Core:Expansions'
        },
        {
            title = 'expansion cap',
            content = makeContent(frame, resolved, {'expansionCount'}, makeCat),
            link = 'Core:Expansions'
        },
        {
            title = 'Requirements',
            content = makeContent(frame, resolved, {'requirement'}, makeCat)
        },
    }
 
    local barsBottom = {
        {
            title = 'End condition',
            content = args['end'] or ''
        },
        {
            title = 'On critical hit',
            content = args['crithit'] or ''
        },
        {
            title = 'On hit',
            content = args['hit'] or ''
        },
        {
            title = 'On miss',
            content = args['miss'] or ''
        },
        {
            title = 'On critically miss',
            content = args['critmiss'] or ''
        },
        {
            title = 'On critical fail',
            content = args['critfail'] or ''
        },
        {
            title = 'On fail',
            content = args['fail'] or ''
        },
        {
            title = 'On success',
            content = args['success'] or ''
        },
        {
            title = 'On critical success',
            content = args['critsuccess'] or ''
        },
         {
             title = 'Heightened',
             content = frame:preprocess(heightenedContent),
            link = ':Category:Heightened abilities'
         },
         {
             title = 'If proficient',
             content = proficiencyContent,
            link = 'Core:Proficiency Bonus'
         },
         {
             title = 'If fluent',
             content = fluencyContent,
            link = 'Core:Fluency Bonus'
         },
         {
             title = 'Attribute improvement',
             content = frame:preprocess(statValContent),
            link = 'Core:Attributes',
            flags = {
                attribute = args['vstat'] and frame:preprocess('{{lc:' .. args['vstat'] .. '}}') or "",
                value = args['val']
            }
         },
         {
             title = 'Feat save improvement',
             content = frame:preprocess(statFeatContent),
            link = 'Core:Feat Interaction',
            flags = {
                attribute = args['fstat'] and frame:preprocess('{{lc:' .. args['fstat'] .. '}}'),
                value = f
            }
         },
     }
 
     local outputTop = ''
     for _, bar in ipairs(barsTop) do
         outputTop = outputTop .. makeBar(frame, bar['title'], bar['content'], bar['link'], bar['flags'], false)
     end
     local outputBottom = ''
 
     for _, bar in ipairs(barsBottom) do
         outputBottom = outputBottom .. makeBar(frame, bar['title'], bar['content'], bar['link'], bar['flags'], true)
     end
 
     local outputMiddle = ''
     if args['e'] then
         outputMiddle = frame:preprocess(args['e'])
    end
 
    local output = mw.html.create('span')
    output
        :addClass('ability-variables')
    if args['basic'] then
        output
            :addClass('ability-basic')
     end
     end
 
     output:wikitext(outputTop)
     local output = mw.html.create('div')
    output
        :addClass('ability-variables')
        :wikitext(outputTop)
      
      
     if outputMiddle ~= '' then
     if outputMiddle ~= '' then
         output
         output
             :wikitext('<hr>')
             :wikitext('<hr>')
             :wikitext(outputMiddle)
             :wikitext('<span class="ability-overview-base">' .. outputMiddle .. '</span>')
     end
     end


Line 2,477: Line 3,362:


     output = tostring(output) .. c
     output = tostring(output) .. c
    output = output .. frame:preprocess('<templatestyles src="Template:Ability/styles.css" />')
     if not name then
     if not name then
         output = output .. '<span style="color: red;>NO NAME PROVIDED VERY BAD EVERY ABILITY NEEDS A NAME OKAY</span>'
         output = output .. '<span style="color: red;>NO NAME PROVIDED VERY BAD EVERY ABILITY NEEDS A NAME OKAY</span>'

Latest revision as of 22:51, 23 September 2026

Module:A Parameter Documentation

This page details all the parameters and their aliases accepted by the Module:A Scribunto module for formatting TTRPG abilities. Call the module using:

{{#invoke:A|a|name=Example Ability|<other parameters>}}

Core Parameters

Basic Information

  • name - The name of the ability (required)
  • e - The effect/description of the ability
  • trigger - What triggers the ability to activate

Type Flags

  • skill - Flag to mark this as a skill ability
    • Setting a warrior or semi class will automatically set this flag to true. This can be overridden by setting it to 0 or false.
  • spell - Flag to mark this as a spell ability
    • Setting a mage class will automatically set this flag to true. This can be overridden by setting it to 0 or false.
  • standard - Flag to mark this as a standard ability
    • Setting a class will automatically set this flag to true. This can be overridden by setting it to 0 or false.
    • Note that abilities that are provided by other class abilities are not always considered standard abilities nor abilities of that class. The main exceptions are crowns and other mage rotators.

Class Information

  • class - The class this ability belongs to
    Supported values:
    • bar/ber (Berserker)
    • sam/due (Duelist)
    • vet (Veteran)
    • kni (Knight)
    • pal (Paladin)
    • ass (Assassin)
    • ama/cor (Corsair)
    • arc (Archer)
    • thi (Thief)
    • ran (Ranger)
    • fla (Flame Mage)
    • sto (Storm Mage)
    • lif (Life Mage)
    • nec (Necromancer)
    • nat (Nature Mage)
  • arch - Override the default archetype for a class
    Supported values:
    • warr (Warrior)
    • semi (Semi)
    • mage (Mage)
  • rank - The rank requirement for the ability
    Supported values:
    • 1 (Rank 1)
    • 2 (Rank 2)
    • 3 (Rank 3+)

Ability Properties

Maneuver Type (maneuver/man/m)

  • active/ac/a - Active maneuver
  • reactive/re/r - Reactive maneuver
  • passive/ps/p - Passive maneuver
  • slow/sl/s - Slow maneuver
Execution Time (executionTime/time/et/x)
  • 0a/freeAction/fa - Free action
  • 1a/a/singleAction/sa - Single action
  • 2a/doubleAction/da - Double action
  • 3a/tripleAction/ta - Triple action
  • 0r/freeReaction/fr - Free reaction
  • 1r/reaction/r - Reaction
  • sr/shortRest/s - Short rest
  • lr/longRest/l - Long rest
  • Time duration format: XmXhXdXwXy (minutes, hours, days, weeks, years)

Interaction Type (interaction/int/i)

  • attack/atk/a - Attack interaction
  • block/blk/b - Block interaction
  • manifest/man/m - Manifest interaction
  • feat/fea/f - Feat interaction

Delivery Method (delivery/del/d)

  • self/sel/s - Self delivery
  • missile/mis/m - Missile delivery
  • hand/han/h/claw - Hand delivery
  • bite/bit/b/mouth - Bite delivery
  • item/itm/i - Item delivery
  • magelore/mag/ml - Magelore delivery
  • weapon/wep/w - Weapon delivery
  • shield/shl/sh - Shield delivery
  • armor/rmr/r - Armor delivery
  • sight/sit/eye/e - Sight delivery
  • aura/aur/a - Aura delivery
  • cone/con/c - Cone delivery
  • other/oth/o - Other delivery

Target Type (target/tar/t)

  • self/sel/s - Self target
  • creature/cre/c - Creature target
  • body/bod/b - Body target
  • vitals/vit/v - Vitals target
  • limb/lim/l - Limb target
  • arm - Arm target
  • leg - Leg target
  • item/itm/i - Item target
  • weapon/wep/w - Weapon target
  • shield/shl/sh - Shield target
  • armor/rmr/r - Armor target
  • attack/atk/a - Attack target
  • other/oth/o - Other target

Duration (duration/dur/dr)

  • instant/in/i/0 - Instant duration
  • always/forever/4/inf - Always active
    • Note: Use one of the aliases. Entering always is currently bugged.
  • whileUp/up/u - While up
  • whileDown/dn/d - While down
  • whileAlive/al/a - While alive
  • whileDead/dd - While dead
  • endOfTurn/end/e - Until end of turn
  • dawn/d - Until dawn
  • startOfTargetNextTurn/tStart/ts - Until start of target's next turn
  • endOfTargetNextTurn/tEnd/te - Until end of target's next turn
  • startOfYourNextTurn/uStart/us - Until start of your next turn
  • endOfYourNextTurn/uEnd/ue - Until end of your next turn
  • endOfCombat/ec - Until end of combat
  • Time duration format: XmXhXdXwXy (minutes, hours, days, weeks, years)
Sustained Flag
  • sustained/sus/s - Ability is sustained

Range (range/rng/r)

  • melee/m - Melee range
  • weapon/w - Weapon range
  • hand/h - Hand range
  • bite/b - Bite range
  • item/i - Item range
  • shield/sh - Shield range
  • armor/a - Armor range
  • sight/eye/e - Sight range
  • self/s - Self range
  • Distance format: Xf or Xm (feet or miles)

Attribute Saves (attribute/attr/a)

  • int/INT/i - Intelligence save
  • str/STR/s - Strength save
  • mov/MOV/m - Movement save
  • per/PER/p - Perception save
  • snk/SNK/s - Sneak save

Expansion Type (expansion/exp)

  • detonate/det/d - Detonate expansion
  • ripple/rip/r - Ripple expansion
  • cascade/cas/c - Cascade expansion
  • fork/for/f - Fork expansion

Piercing (piercing/prc/p)

  • av0/a - AV0 piercing
  • unblockable/ub/u - Unblockable

Component Flags

  • verbal/ver/v - Verbal component
  • somatic/som/s - Somatic component
  • material/mat/m - Material component
  • magelore/mag/ml - Magelore component
  • invoked/inv/i - Invoked component

Resource Costs

  • mp - Mana point cost
  • mpx - Variable mana point cost description
  • hp - Hit point cost
  • hpx - Variable hit point cost description
  • matx - Material component cost description

Element Flags

  • life - Life element
  • storm - Storm element
  • necro - Necro element
  • flame - Flame element
  • nature - Nature element

Power Source Flags

  • magic - Magical power source
  • divine - Divine power source
  • spirit - Spirit power source
  • primal - Primal power source
  • martial - Martial power source
  • psionic - Psionic power source
  • techo - Techno power source

Effect Type Flags

  • mental - Mental effect
  • truth - Truth detection effect
  • duelMod - Duel modification effect
  • movement - Movement effect
  • displacement - Displacement effect
  • transformation - Transformation effect
  • control - Control effect
  • resist - Resistance effect
  • immune - Immunity effect
  • long - Long range effect
  • sense - Sensory effect
  • revive - Revival effect
  • summon - Summoning effect
  • heal - Healing effect

State Parameters

  • end - The condition under which the ability ends

Results Parameters

  • crithit - Critical hit effect
  • hit - Hit effect
  • miss - Miss effect
  • critmiss - Critical miss effect
  • critfail - Critical fail effect
  • fail - Fail effect
  • save - Save effect
  • critsave - Critical save effect

Attribute Modification

  • vstat - Attribute to modify
  • val - New minimum value for the attribute
  • fstat - Feat save attribute to modify
  • flu - Flag for fluency in feat save
  • pro - Flag for proficiency in feat save

Premade Templates

The module includes several premade templates that can be used as a base for abilities:

Strike Template (pre=strike)

{
    maneuver = 'active',
    executionTime = '1a',
    interaction = 'attack',
    delivery = 'weapon',
    target = 'creature',
    duration = 'instant',
    range = 'weapon',
}

Ray Template (pre=ray)

{
    maneuver = 'active',
    executionTime = '1a',
    interaction = 'attack',
    delivery = 'missile',
    target = 'creature',
    duration = 'instant',
    range = '60f',
    piercing = 'av0',
}

Ball Template (pre=ball)

{
    maneuver = 'active',
    executionTime = '1a',
    interaction = 'attack',
    delivery = 'missile',
    target = 'creature',
    duration = 'instant',
    range = '30f',
    piercing = 'ub',
}

Touch Template (pre=touch)

{
    maneuver = 'active',
    executionTime = '1a',
    interaction = 'attack',
    delivery = 'hand',
    target = 'creature',
    duration = 'instant',
    range = 'hand',
    piercing = 'ub',
}

Ritual Template (pre=ritual)

{
    maneuver = 'slow',
    executionTime = '10m',
    interaction = 'manifest',
    delivery = 'sight',
    target = 'creature',
    duration = 'instant',
    range = '5f',
}

Additional Features

The module automatically handles:

  • Adding AC modifiers for limb (+2), vitals (+5), and other specific targets
  • Managing item interaction DCs
  • Handling class archetypes and their hierarchies
  • Processing time and distance formats
  • Managing component requirements for invoked abilities



local p = {}

local aliases = {
    keys = {
        pre = {
            'pre',
            'premade',
        },
        maneuver = {
            'man',
            'maneuver',
            'm'
        },
        interaction = {
            'int',
            'interaction',
            'i'
        },
        delivery = {
            'del',
            'delivery',
            'd'
        },
        target = {
            'tar',
            'target',
            't'
        },
        duration = {
            'dur',
            'duration',
            'dr'
        },
        upgrade = {
            'upg',
            'upgrade',
            'u'
        },
        executionTime = {
            'executionTime',
            'et',
            'x'
        },
        piercing = {
            'prc',
            'piercing',
            'p'
        },
        -- nearRange = {
        --     'nearRange',
        --     'nr'
        -- },
        -- farRange = {
        --     'farRange',
        --     'fr'
        -- },
        flaw = {
            'flaw',
            'fl',
            'f'
        },
        special = {
            'special',
            'sp',
            's'
        },
        range = {
            'range',
            'rng',
            'r'
        },
        attribute = {
            'attribute',
            'attr',
            'a'
        },
        expansion = {
            'expansion',
            'exp',
        },
        expansionRange = {
            'expansionRange',
            'er'
        },
        expansionCount = {
            'expansionCount',
            'ec'
        },
        expansionAttribute = {
            'expansionAttribute',
            'ea'
        },
        sustained = {
            'sustained',
            'sus'
        },
        requirement = {
            'req',
            'requirement',
            'rq'
        },
        verbal = {
            'ver',
            'verbal',
        },
        somatic = {
            'som',
            'somatic',
        },
        material = {
            'mat',
            'material',
        },
        magelore = {
            'mag',
            'magelore',
            'ml'
        },
        invoked = {
            'inv',
            'invoked',
            'invoke',
        },
        hp = {
            'hp',
            'health',
            'hitpoints',
            'hitPoints',
            'hit points',
        },
        hpx = {
            'hpx',
            'healthx',
            'hitpointsx',
            'hitPointsx',
            'hit pointsx',
        },
        mp = {
            'mp',
            'mana',
            'magic',
            'magick',
            'magik',
            'mana points',
            'magic points',
            'magick points',
            'magik points',
        },
        mpx = {
            'mpx',
            'manax',
            'manapointsx',
            'mana pointsx',
            'magic pointsx',
            'magick pointsx',
            'magik pointsx',
        },
        gp = {
            'gp',
            'gold',
            'goldPieces',
            'gold pieces',
        },
        gpx = {
            'gpx',
            'goldx',
            'goldPiecesx',
            'gold piecesx',
        },
        matx = {
            'matx',
            'materialx',
        },
        class = {
            'class',
        },
    },
    values = {
        maneuver = {
            active = {
                'ac',
                'active',
                'a'
            },
            reactive = {
                're',
                'reaction',
                'r'
            },
            passive = {
                'ps',
                'passive',
                'p'
            },
            slow = {
                'sl',
                'slow',
                's'
            }
        },
        interaction = {
            attack = {
                'atk',
                'attack',
                'a'
            },
            block = {
                'blk',
                'block',
                'b'
            },
            manifest = {
                'man',
                'manifest',
                'm'
            },
            feat = {
                'fea',
                'feat',
                'f'
            }
        },
        delivery = {
            self = {
                'sel',
                'self',
                's'
            },
            missile = {
                'mis',
                'missile',
                'm'
            },
            hand = {
                'han',
                'hand',
                'h',
                'claw'
            },
            bite = {
                'bit',
                'bite',
                'b',
                'mouth'
            },
            item = {
                'itm',
                'item',
                'i'
            },
            magelore = {
                'mag',
                'magelore',
                'ml'
            },
            weapon = {
                'wep',
                'weapon',
                'w'
            },
            shield = {
                'shl',
                'shield',
                'sh'
            },
            armor = {
                'rmr',
                'armor',
                'r'
            },
            sight = {
                'sit',
                'sight',
                'eye',
                'e'
            },
            aura = {
                'aur',
                'aura',
                'a'
            },
            cone = {
                'con',
                'cone',
                'c'
            },
            other = {
                'oth',
                'other',
                'o'
            }
        },
        target = {
            self = {
                'sel',
                'self',
                's'
            },
            creature = {
                'cre',
                'creature',
                'c'
            },
            body = {
                'bod',
                'body',
                'b'
            },
            vitals = {
                'vit',
                'vitals',
                'v'
            },
            limb = {
                'lim',
                'limb',
                'l'
            },
            arm = {
                'arm',
            },
            leg = {
                'leg',
            },
            item = {
                'itm',
                'item',
                'i'
            },
            weapon = {
                'wep',
                'weapon',
                'w'
            },
            shield = {
                'shl',
                'shield',
                'sh'
            },
            armor = {
                'rmr',
                'armor',
                'r'
            },
            ship = {
                'ship',
            },
            attack = {
                'atk',
                'attack',
                'a'
            },
            ability = {
            	'ab',
            	'ability'
            },
            spell = {
                'spl',
                'spell',
            },
            other = {
                'oth',
                'other',
                'o'
            },
            ci = {
                'ci',
                'creatureItem',
                'itemCreature',
                'ic'
            },
            ai = {
                'ai',
                'attackItem',
                'itemAttack',
                'ia'
            },
            area = {
                'area',
                'ar'
            },
            as = {
            	'areaSpell'
            },
            aci = {
                'cia',
                'iac',
                'aci',
                'ica',
                'cai',
                'aic',
                'creatureItemArea',
                'itemCreatureArea',
                'AreaCreatureItem',
                'itemAreaCreature',
                'creatureAreaItem',
                'AreaItemCreature',
            },
            ac = {
                'ac',
                'ca',
                'areaCreature',
                'creatureArea',
            },
            al = {
            	'al',
            	'la',
            	'armLeg',
            	'legArm',
            },
            cs = {
                'cs',
                'sc',
                'creatureSelf',
                'selfCreature',
            },
            ari = {
                'ari',
                'areaItem',
                'itemArea',
            },
            arse = {
            	'areaSelf'
            },
            si = {
            	'selfItem',
            	'itemSelf'
            }
        },
        duration = {
            instant = {
                '0',
                'in',
                'instant',
                'i'
            },
            always = {
                'always',
                'forever',
                '4',
                'inf',
            },
            noLimit = {
                'noLimit',
                '1',
                'nl',
            },
            whileUp = {
                'up',
                'whileUp',
                'u'
            },
            whileDown = {
                'dn',
                'whileDown',
                'd'
            },
            whileAlive = {
                'al',
                'whileAlive',
                'a'
            },
            whileDead = {
                'dd',
                'whileDead',
            },
            endOfTurn = {
                'end',
                'endOfTurn',
                'e'
            },
            dawn = {
                'dawn',
                'd'
            },
            startOfTargetNextTurn = {
                'tStart',
                'startOfTargetNextTurn',
                'ts'
            },
            endOfTargetNextTurn = {
                'tEnd',
                'endOfTargetNextTurn',
                'te'
            },
            startOfYourNextTurn = {
                'uStart',
                'startOfYourNextTurn',
                'us'
            },
            endOfYourNextTurn = {
                'uEnd',
                'endOfYourNextTurn',
                'ue'
            },
            endOfCombat = {
                'endOfCombat',
                'ec'
            },
            timeParse = {
                '^%d+[mhdwys]$'
            }
        },
        upgrade = {
            warded = {
                'wrd',
                'warded',
                'w'
            },
            absolute = {
                'abs',
                'absolute',
                'a'
            }
        },
        executionTime = {
            freeAction = {
                '0a',
                'freeAction',
                'fa'
            },
            singleAction = {
                '1a',
                'a',
                'singleAction',
                'sa',
            },
            doubleAction = {
                '2a',
                'doubleAction',
                'da'
            },
            tripleAction = {
                '3a',
                'tripleAction',
                'ta'
            },
            freeReaction = {
                '0r',
                'freeReaction',
                'fr'
            },
            reaction = {
                '1r',
                'reaction',
                'r'
            },
            shortRest = {
                'sr',
                'shortRest',
                's'
            },
            longRest = {
                'lr',
                'longRest',
                'l'
            },
            timeParse = {
                '^%d+[mhdwy]$'
            }
        },
        piercing = {
            av0 = {
                'av0',
                'a'
            },
            unblockable = {
                'ub',
                'u'
            }
        },
        range = {
            melee = {
                'melee',
                'm'
            },
            weapon = {
                'weapon',
                'weaponReach',
                'w'
            },
            hand = {
                'hand',
                'handReach',
                'h'
            },
            bite = {
                'bite',
                'biteReach',
                'b'
            },
            item = {
                'item',
                'itemReach',
                'i'
            },
            shield = {
                'shield',
                'shieldReach',
                'sh'
            },
            armor = {
                'armor',
                'armorReach',
                'r'
            },
            sight = {
                'sight',
                'sightReach',
                'eye',
                'e'
            },
            self = {
                'self',
                's'
            },
            distParse = {
                '^%d+[fm]$'
            },
            other = {
                'other',
                'o'
            }
        },
        attribute = {
            int = {
                'int',
                'INT',
                'i'
            },
            str = {
                'str',
                'STR',
                's'
            },
            mov = {
                'mov',
                'MOV',
                'm'
            },
            per = {
                'per',
                'PER',
                'p'
            },
            snk = {
                'snk',
                'SNK',
                's'
            },
            unp = {
                'unp',
                'UNP',
                'u'
            },
        },
        expansionAttribute = {
            int = {
                'int',
                'INT',
                'i'
            },
            str = {
                'str',
                'STR',
                's'
            },
            mov = {
                'mov',
                'MOV',
                'm'
            },
            per = {
                'per',
                'PER',
                'p'
            },
            snk = {
                'snk',
                'SNK',
                's'
            },
            unp = {
                'unp',
                'UNP',
                'u'
            },
        },
        expansion = {
            detonate = {
                'det',
                'detonate',
                'd'
            },
            ripple = {
                'rip',
                'ripple',
                'r'
            },
            cascade = {
                'cas',
                'cascade',
                'c'
            },
            fork = {
                'for',
                'fork',
                'f'
            }
        },
        expansionRange = {
            distParse = {
                '^%d+[fm]$'
            }
        },
        expansionCount = {
            expansionCount = {
                'expansionCount',
                'ec',
            }
        },
        sustained = {
            sustained = {
                'sus',
                'sustained',
                's',
                '1',
            }
        },
        verbal = {
            verbal = {
                'ver',
                'verbal',
                'v',
                '1',
            }
        },
        somatic = {
            somatic = {
                'som',
                'somatic',
                's',
                '1',
            }
        },
        material = {
            material = {
                'mat',
                'material',
                'm',
                '1',
            }
        },
        magelore = {
            magelore = {
                'mag',
                'magelore',
                'ml',
                '1',
            }
        },
        invoked = {
            invoked = {
                'inv',
                'invoked',
                'i',
                '1',
            }
        },
        class = {
            ber = {
                'ber',
            },
            due = {
                'due',
            },
            vet = {
                'vet',
            },
            kni = {
                'kni',
            },
            pal = {
                'pal',
            },
            ass = {
                'ass',
            },
            cor = {
                'cor',
            },
            arc = {
                'arc',
            },
            thi = {
                'thi',
            },
            ran = {
                'ran',
            },
            fla = {
                'fla',
            },
            sto = {
                'sto',
            },
            lif = {
                'lif',
            },
            nec = {
                'nec',
            },
            nat = {
                'nat',
            },
        }
    }
}

local tags = {
    verbal = {
        verbal = {
            text = 'Verbal',
            link = 'Verbal component abilities',
            symbol = '🗣️',
            color = '#f9f06b',
            class = 'component-tagged verbal'
        },
    },
    somatic = {
        somatic = {
            text = 'Somatic',
            link = 'Somatic component abilities',
            symbol = '👐',
            color = '#f9f06b',
            class = 'component-tagged somatic'
        },
    },
    material = {
        material = {
            text = 'Material',
            link = 'Material component abilities',
            symbol = '💎',
            color = '#ff7800',
            class = 'component-tagged material'
        },
    },
    magelore = {
        magelore = {
            text = 'Magelore',
            link = 'Magelore component abilities',
            symbol = '🔮',
            color = '#f9f06b',
            class = 'component-tagged magelore'
        },
    },
    invoked = {
        invoked = {
            text = 'Invoked',
            link = 'Invoked abilities',
            symbol = '🪄',
            color = '#f9f06b',
            class = 'component-tagged invoked'
        },
    },
    flaw = {
        flaw = {
            text = 'Flaw',
            link = 'Flaw abilities',
            symbol = '❌',
            color = '#e01b24',
            class = 'flaw-tagged flaw'
        },
    },
    special = {
        special = {
            text = 'Special',
            link = 'Special abilities',
            symbol = '✴️',
            color = '#9141AC',
            class = 'special-tagged special'
        },
    },
    es = {
        es = {
            text = 'Elder Sorcery',
            link = 'Elder Sorcery abilities',
            symbol = '🌌',
            color = '#9141AC',
            class = 'elderSorcery-tagged elderSorcery'
        },
    },
    warded = {
        warded = {
            text = 'Warded',
            link = 'Warded abilities',
            symbol = '🏮',
            color = '#f9f06b',
            class = 'warded-tagged warded'
        },
    },
    elements = {
        life = {
            text = 'Life',
            link = 'Life element abilities',
            symbol = '☀️',
            color = '#ffffff',
            class = 'element-tagged life'
        },
        storm = {
            text = 'Storm',
            link = 'Storm element abilities',
            symbol = '💧',
            color = '#3584e4',
            class = 'element-tagged storm'
        },
        necromancy = {
            text = 'Necromancy',
            link = 'Necromancy element abilities',
            symbol = '💀',
            color = '#3d3846',
            class = 'element-tagged necromancy'
        },
        necro = {
            text = 'Necromancy',
            link = 'Necromancy element abilities',
            symbol = '💀',
            color = '#3d3846',
            class = 'element-tagged necromancy'
        },
        flame = {
            text = 'Flame',
            link = 'Flame element abilities',
            symbol = '🔥',
            color = '#e01b24',
            class = 'element-tagged flame'
        },
        nature = {
            text = 'Nature',
            link = 'Nature element abilities',
            symbol = '🌱',
            color = '#33d17a',
            class = 'element-tagged nature'
        },
    },
    class = {
        ber = {
            text = 'Berserker',
            link = 'Berserker class abilities',
            symbol = '🪓',
            class = 'class-tagged berserker'
        },
        due = {
            text = 'Duelist',
            link = 'Duelist class abilities',
            symbol = '🤺',
            class = 'class-tagged duelist'
        },
        vet = {
            text = 'Veteran',
            link = 'Veteran class abilities',
            symbol = '🪖',
            class = 'class-tagged veteran'
        },
        kni = {
            text = 'Knight',
            link = 'Knight class abilities',
            symbol = '⚔️',
            class = 'class-tagged knight'
        },
        pal = {
            text = 'Paladin',
            link = 'Paladin class abilities',
            symbol = '🛡️',
            class = 'class-tagged paladin'
        },
        ass = {
            text = 'Assassin',
            link = 'Assassin class abilities',
            symbol = '🗡️',
            class = 'class-tagged assassin'
        },
        cor = {
            text = 'Corsair',
            link = 'Corsair class abilities',
            symbol = '🏴‍☠️',
            class = 'class-tagged corsair'
        },
        arc = {
            text = 'Archer',
            link = 'Archer class abilities',
            symbol = '🏹',
            class = 'class-tagged archer'
        },
        thi = {
            text = 'Thief',
            link = 'Thief class abilities',
            symbol = '💰️',
            class = 'class-tagged thief'
        },
        ran = {
            text = 'Ranger',
            link = 'Ranger class abilities',
            symbol = '🐾',
            class = 'class-tagged ranger'
        },
        fla = {
            text = 'Flame Mage',
            link = 'Flame Mage class abilities',
            symbol = '🧙',
            class = 'class-tagged flameMage'
        },
        sto = {
            text = 'Storm Mage',
            link = 'Storm Mage class abilities',
            symbol = '🧙',
            class = 'class-tagged stormMage'
        },
        lif = {
            text = 'Life Mage',
            link = 'Life Mage class abilities',
            symbol = '🧙',
            class = 'class-tagged lifeMage'
        },
        nec = {
            text = 'Necromancer',
            link = 'Necromancer class abilities',
            symbol = '🧙',
            class = 'class-tagged necromancer'
        },
        nat = {
            text = 'Nature Mage',
            link = 'Nature Mage class abilities',
            symbol = '🧙',
            class = 'class-tagged natureMage'
        },
    },
    gm = {
        warr = {
            text = 'Warrior',
            link = 'Warrior guildmaster abilities',
            symbol = '⚔️',
            class = 'archetype-tagged warrior'
        },
        semi = {
            text = 'Semi',
            link = 'Semi guildmaster abilities',
            symbol = '🤹',
            class = 'archetype-tagged semi'
        }
    },
    power = {
        divine = {
            text = 'Divine',
            link = 'Divinely powered abilities',
            symbol = '🪽',
            color = '#f9f06b',
            class = 'power-tagged divine'
        },
        magic = {
            text = 'Magical',
            link = 'Magically powered abilities',
            symbol = '✨',
            color = '#9141ac',
            class = 'power-tagged magical'
        },
        spirit = {
            text = 'Spiritual',
            link = 'Spiritually powered abilities',
            symbol = '🪭',
            color = '#9a9996',
            class = 'power-tagged spiritual'
        },
        martial = {
            text = 'Martial',
            link = 'Martially powered abilities',
            symbol = '💪',
            color = '#ff7800',
            class = 'power-tagged martial'
        },
        psionic = {
            text = 'Psionic',
            link = 'Psionically powered abilities',
            symbol = '🤯',
            color = '#3584e4',
            class = 'power-tagged psionic'
        },
        primal = {
            text = 'Primal',
            link = 'Primally powered abilities',
            symbol = '⛰️',
            color = '#986a44',
            class = 'power-tagged primal'
        },
        techno = {
            text = 'Technological',
            link = 'Technologically powered abilities',
            symbol = '⚙️',
            color = '#e01b24',
            class = 'power-tagged technological'
        },
        matpow = {
        	text = 'Material',
        	link = 'Materially powered abilities',
        	symbol = '🪨️',
        	color = 'ff7800',
        	class = 'power-tagged material'
        },
        finance = {
            text = 'Financial',
            link = 'Financially powered abilities',
            symbol = '🪙',
            color = '#fcc200',
            class = 'power-tagged financial'
        },
        alchemy = {
            text = 'Alchemical',
            link = 'Alchemically powered abilities',
            symbol = '🧪',
            color = '#33d17a',
            class = 'power-tagged alchemical'
        },
        unknown = {
            text = 'Unknown',
            link = 'Unknown powered abilities',
            symbol = '❓',
            color = '#77767b',
            class = 'power-tagged unknown'
        },
    },
    category = {
        skill = {
            text = 'Skill',
            link = 'Skills',
            symbol = '🤹',
            class = 'skill'
        },
        spell = {
            text = 'Spell',
            link = 'Spells',
            symbol = '✨',
            class = 'spell'
        },
        semblant = {
            text = 'Semblant',
            link = 'Semblant skills',
            symbol = '🎭',
            class = 'standard-tagged semblant'
        },
        conjure = {
            text = 'Conjured',
            link = 'Conjured spells',
            symbol = '🔮',
            class = 'standard-tagged conjure'
        },
        standard = {
            text = 'Standard',
            link = 'Standard abilities',
            symbol = '🏁',
            class = 'standard-tagged normal'
        },
        rotator = {
            text = 'Rotator',
            link = 'Rotator abilities',
            symbol = '🔄',
            class = 'rotator'
        },
        guildmaster = {
            text = 'Guildmaster',
            link = 'Guildmaster abilities',
            symbol = '🏅',
            class = 'guildmaster'
        }
    },
    effects = {
        mental = {
            text = 'Mental',
            link = 'Mental effects',
            symbol = '🧠',
            class = 'effect-tagged mental'
        },
        truth = {
            text = 'Truth detecting',
            link = 'Truth detecting effects',
            symbol = '⚖️',
            class = 'effect-tagged truthDetecting'
        },
        duelModifying = {
            text = 'Duel modifying',
            link = 'Duel modifying effects',
            symbol = '🤺',
            class = 'effect-tagged duelModifying'
        },
        movement = {
            text = 'Movement',
            link = 'Movement effects',
            symbol = '👣',
            class = 'effect-tagged movement'
        },
        poison = {
            text = 'Poison',
            link = 'Poison effects',
            symbol = '☠️',
            class = 'effect-tagged poison'
        },
        displacement = {
            text = 'Displacement',
            link = 'Displacement effects',
            symbol = '🌀',
            class = 'effect-tagged displacement'
        },
        transformation = {
            text = 'Transformation',
            link = 'Transformation effects',
            symbol = '🌳',
            class = 'effect-tagged transformation'
        },
        illusion = {
            text = 'Illusion',
            link = 'Illusion effects',
            symbol = '🫟',
            class = 'effect-tagged illusion'
        },
        control = {
            text = 'Control',
            link = 'Control effects',
            symbol = '⛓️',
            class = 'effect-tagged control'
        },
        resist = {
            text = 'Resistance',
            link = 'Resistance effects',
            symbol = '🚫',
            class = 'effect-tagged resistance'
        },
        hexproof = {
            text = 'Hexproof',
            link = 'Hexproof effects',
            symbol = '🚫',
            class = 'effect-tagged hexproof'
        },
        awaken = {
            text = 'Awakening',
            link = 'Awakening effects',
            symbol = '🌞',
            class = 'effect-tagged awakening'
        },
        immune = {
            text = 'Immunity',
            link = 'Immunity effects',
            symbol = '🚫',
            class = 'effect-tagged immunity'
        },
        hexseal = {
            text = 'Hexseal',
            link = 'Hexseal effects',
            symbol = '🚫',
            class = 'effect-tagged hexseal'
        },
        long = {
            text = 'Long range',
            link = 'Long range effects',
            symbol = '📏',
            class = 'effect-tagged longRange'
        },
        sense = {
            text = 'Sensory',
            link = 'Sensory effects',
            symbol = '👁️',
            class = 'effect-tagged sensory'
        },
        revive = {
            text = 'Revival',
            link = 'Revival effects',
            symbol = '🤍',
            class = 'effect-tagged revival'
        },
        summon = {
            text = 'Summoning',
            link = 'Summoning effects',
            symbol = '🖤',
            class = 'effect-tagged summoning'
        },
        heal = {
            text = 'Healing',
            link = 'Healing effects',
            symbol = '❤️',
            class = 'effect-tagged healing'
        },
        reanimate = {
            text = 'Reanimation',
            link = 'Reanimation effects',
            symbol = '🩶',
            class = 'effect-tagged reanimation'
        },
        regenerate = {
            text = 'Regeneration',
            link = 'Regeneration effects',
            symbol = '💚',
            class = 'effect-tagged regeneration'
        },
        revitalize = {
            text = 'Revitalization',
            link = 'Revitalization effects',
            symbol = '🩵',
            class = 'effect-tagged revitalization'
        },
        kill = {
            text = 'Killing',
            link = 'Killing effects',
            symbol = '☠️',
            class = 'effect-tagged killing'
        },
        damage = {
            text = 'Damaging',
            link = 'Damaging effects',
            symbol = '💢',
            class = 'effect-tagged damaging'
        },
        drain = {
            text = 'Draining',
            link = 'Draining effects',
            symbol = '🩸',
            class = 'effect-tagged draining'
        },
        destroy = {
            text = 'Destruction',
            link = 'Destruction effects',
            symbol = '💥',
            class = 'effect-tagged destruction'
        },
        contract = {
            text = 'Contract',
            link = 'Contract effects',
            symbol = '🤝',
            class = 'effect-tagged contract'
        },
        steal = {
            text = 'Stealing',
            link = 'Stealing effects',
            symbol = '💰',
            class = 'effect-tagged stealing'
        },
        loud = {
            text = 'Loud',
            link = 'Loud effects',
            symbol = '🔊',
            class = 'effect-tagged loud'
        },
        knockout = {
            text = 'Knockout',
            link = 'Knockout effects',
            symbol = '💤',
            class = 'effect-tagged knockout'
        },
        time = {
            text = 'Temporal',
            link = 'Temporal effects',
            symbol = '🕰️',
            class = 'effect-tagged temporal'
        },
        auto = {
            text = 'Automatic',
            link = 'Automatic effects',
            symbol = '❗️',
            class = 'effect-tagged automatic'
        },
        lightning = {
            text = 'Lightning',
            link = 'Lightning effects',
            symbol = '⚡️',
            class = 'effect-tagged lightning'
        },
        disease = {
            text = 'Disease',
            link = 'Disease effects',
            symbol = '🦠',
            class = 'effect-tagged disease'
        },
        vision = {
        	text = 'Vision',
        	link = 'Vision effects',
        	symbol = '🥠',
        	class = 'effect-tagged vision'
        },
        morganti = {
        	text = 'Morganti',
        	link = 'Morganti effects',
        	symbol = '⚫️',
        	class = 'effect-tagged morganti'
        },
        construction = {
            text = 'Construction',
            link = 'Construction effects',
            symbol = '🔧',
            class = 'effect-tagged construction'
        },
        weather = {
            text = 'Weather',
            link = 'Weather effects',
            symbol = '🌧️',
            class = 'effect-tagged weather'
        }
    },
    pre = {
        strike = {
            text = 'Strike',
            link = 'Strike delivery abilities',
            symbol = '⚔️',
            class = 'deliveryPackage-tagged strike'
        },
        ray = {
            text = 'Ray',
            link = 'Ray delivery abilities',
            symbol = '⚡️',
            class = 'deliveryPackage-tagged ray'
        },
        ball = {
            text = 'Ball',
            link = 'Ball delivery abilities',
            symbol = '🔥',
            class = 'deliveryPackage-tagged ball'
        },
        aura = {
            text = 'Aura',
            link = 'Aura delivery abilities',
            symbol = '🌟',
            class = 'deliveryPackage-tagged aura'
        },
        ritual = {
            text = 'Ritual',
            link = 'Ritual delivery abilities',
            symbol = '🕯️',
            class = 'deliveryPackage-tagged ritual'
        },
        touch = {
            text = 'Touch',
            link = 'Touch delivery abilities',
            symbol = '👉️',
            class = 'deliveryPackage-tagged touch'
        },
    },
    maneuver = {
        active = {
            text = 'Active',
            link = 'Active abilities',
            symbol = '➡️',
            class = 'maneuver-tagged active'
        },
        reactive = {
            text = 'Reactive',
            link = 'Reactive abilities',
            symbol = '↩️',
            class = 'maneuver-tagged reactive'
        },
        passive = {
            text = 'Passive',
            link = 'Passive abilities',
            symbol = '🔁',
            class = 'maneuver-tagged passive'
        },
        slow = {
            text = 'Slow',
            link = 'Slow abilities',
            symbol = '🐢',
            class = 'maneuver-tagged slow'
        },
    },
    interaction = {
        attack = {
            text = 'Attack',
            link = 'Attack abilities',
            symbol = '⚔️',
            color = '#ff7800',
            class = 'interaction-tagged attack'
        },
        block = {
            text = 'Block',
            link = 'Block abilities',
            symbol = '🛡️',
            color = '#ff7800',
            class = 'interaction-tagged block'
        },
        manifest = {
            text = 'Manifest',
            link = 'Manifest abilities',
            symbol = '✳️',
            color = '#ff7800',
            class = 'interaction-tagged manifest'
        },
        feat = {
            text = 'Feat',
            link = 'Feat abilities',
            symbol = '🎖️',
            color = '#ff7800',
            class = 'interaction-tagged feat'
        }
    },
    delivery = {
        self = {
            text = 'Self',
            link = 'Self delivery abilities',
            symbol = '🤲',
            color = '#f6d32d',
            class = 'delivery-tagged self'
        },
        missile = {
            text = 'Missile',
            link = 'Missile delivery abilities',
            symbol = '🏹',
            color = '#f6d32d',
            class = 'delivery-tagged missile'
        },
        hand = {
            text = 'Hand',
            link = 'Hand delivery abilities',
            symbol = '🤚',
            color = '#f6d32d',
            class = 'delivery-tagged hand'
        },
        bite = {
            text = 'Bite',
            link = 'Bite delivery abilities',
            symbol = '🦷',
            color = '#f6d32d',
            class = 'delivery-tagged bite'
        },
        item = {
            text = 'Item',
            link = 'Item delivery abilities',
            symbol = '📦',
            color = '#f6d32d',
            class = 'delivery-tagged item'
        },
        magelore = {
            text = 'Magelore',
            link = 'Magelore delivery abilities',
            symbol = '🔮',
            color = '#f6d32d',
            class = 'delivery-tagged magelore'
        },
        weapon = {
            text = 'Weapon',
            link = 'Weapon delivery abilities',
            symbol = '🗡️',
            color = '#f6d32d',
            class = 'delivery-tagged weapon'
        },
        shield = {
            text = 'Shield',
            link = 'Shield delivery abilities',
            symbol = '🛡️',
            color = '#f6d32d',
            class = 'delivery-tagged shield'
        },
        armor = {
            text = 'Armor',
            link = 'Armor delivery abilities',
            symbol = '🪖',
            color = '#f6d32d',
            class = 'delivery-tagged armor'
        },
        sight = {
            text = 'Sight',
            link = 'Sight delivery abilities',
            symbol = '👁️',
            color = '#f6d32d',
            class = 'delivery-tagged sight'
        },
        aura = {
            text = 'Aura',
            link = 'Aura delivery abilities',
            symbol = '🌟',
            color = '#f6d32d',
            class = 'delivery-tagged aura'
        },
        cone = {
            text = 'Cone',
            link = 'Cone delivery abilities',
            symbol = '🐲',
            color = '#f6d32d',
            class = 'delivery-tagged cone'
        },
        other = {
            text = 'Other',
            link = 'Other delivery abilities',
            symbol = '❓',
            color = '#f6d32d',
            class = 'delivery-tagged other'
        }
    },
    target = {
        self = {
            text = 'Self',
            link = 'Self target abilities',
            symbol = '🤲',
            color = '#f6d32d',
            class = 'target-tagged self'
        },
        creature = {
            text = 'Creature',
            link = 'Creature target abilities',
            symbol = '👤',
            color = '#f6d32d',
            class = 'target-tagged creature'
        },
        body = {
            text = 'Body',
            link = 'Body target abilities',
            symbol = '🧍',
            color = '#f6d32d',
            class = 'target-tagged body'
        },
        vitals = {
            text = 'Vitals',
            link = 'Vitals target abilities',
            symbol = '🫀',
            color = '#f6d32d',
            class = 'target-tagged vitals'
        },
        limb = {
            text = 'Limb',
            link = 'Limb target abilities',
            symbol = '🦾',
            color = '#f6d32d',
            class = 'target-tagged limb'
        },
        arm = {
            text = 'Arm',
            link = 'Arm target abilities',
            symbol = '💪',
            color = '#f6d32d',
            class = 'target-tagged arm'
        },
        leg = {
            text = 'Leg',
            link = 'Leg target abilities',
            symbol = '🦵',
            color = '#f6d32d',
            class = 'target-tagged leg'
        },
        item = {
            text = 'Item',
            link = 'Item target abilities',
            symbol = '📦',
            color = '#f6d32d',
            class = 'target-tagged item'
        },
        weapon = {
            text = 'Weapon',
            link = 'Weapon target abilities',
            symbol = '🗡️',
            color = '#f6d32d',
            class = 'target-tagged weapon'
        },
        shield = {
            text = 'Shield',
            link = 'Shield target abilities',
            symbol = '🛡️',
            color = '#f6d32d',
            class = 'target-tagged shield'
        },
        armor = {
            text = 'Armor',
            link = 'Armor target abilities',
            symbol = '🪖',
            color = '#f6d32d',
            class = 'target-tagged armor'
        },
        ship = {
            text = 'Ship',
            link = 'Ship target abilities',
            symbol = '⛵️',
            color = '#f6d32d',
            class = 'target-tagged ship'
        },
        attack = {
            text = 'Attack',
            link = 'Attack target abilities',
            symbol = '⚔️',
            color = '#f6d32d',
            class = 'target-tagged attack'
        },
        ability = {
        	text = 'Ability',
        	link = 'Ability target abilities',
        	symbol = '🅰',
        	color = '#f6d32d',
            class = 'target-tagged ability'
        },
        spell = {
            text = 'Spell',
            link = 'Spell target abilities',
            symbol = '💫',
            color = '#f6d32d',
            class = 'target-tagged spell'
        },
        other = {
            text = 'Other',
            link = 'Other target abilities',
            symbol = '❓',
            color = '#f6d32d',
            class = 'target-tagged other'
        },
        area = {
            text = 'Area',
            link = 'Area target abilities',
            symbol = '🏕️',
            color = '#f6d32d',
            class = 'target-tagged area'
        },
        ci = {
            tags = {
                'creature',
                'item'
            }
        },
        ai = {
            tags = {
                'attack',
                'item'
            }
        },
        ari = {
            tags = {
                'area',
                'item'
            }
        },
        as = {
        	tags = {
        		'area',
        		'spell',
        	}
        },
        arse = {
        	tags = {
        		'area',
        		'self',
        	}
        },
        si = {
        	tags = {
        		'item',
        		'self'
        	}
        },
        aci = {
            tags = {
                'area',
                'creature',
                'item',
            }
        },
        ac = {
            tags = {
                'area',
                'creature',
            }
        },
        al = {
        	tags = {
        		'arm',
        		'leg',
        	}
        },
        cs = {
            tags = {
                'creature',
                'self',
            }
        },
    },
    upgrade = {
        warded = {
            text = 'Warded',
            link = 'Warded abilities',
            class = 'upgrade-tagged warded'
        },
        absolute = {
            text = 'Absolute',
            link = 'Absolute abilities',
            class = 'upgrade-tagged absolute'
        }
    },
    executionTime = {
        freeAction = {
            text = 'Free action',
            symbol = '0️⃣',
            link = 'Free action abilities',
            class = 'executionTime-tagged a0'
        },
        singleAction = {
            text = 'Single action',
            symbol = '1️⃣',
            link = 'Single action abilities',
            class = 'executionTime-tagged a1'
        },
        doubleAction = {
            text = 'Double action',
            symbol = '2️⃣',
            link = 'Double action abilities',
            class = 'executionTime-tagged a2'
        },
        tripleAction = {
            text = 'Triple action',
            symbol = '3️⃣',
            link = 'Triple action abilities',
            class = 'executionTime-tagged a3'
        },
        freeReaction = {
            text = 'Free reaction',
            symbol = '0️⃣',
            link = 'Free reaction abilities',
            class = 'executionTime-tagged r0'
        },
        reaction = {
            text = 'Reaction',
            symbol = '1️⃣',
            link = 'Reaction abilities',
            class = 'executionTime-tagged r1'
        },
        shortRest = {
            text = 'Short rest',
            symbol = '🌙',
            link = 'Short rest abilities',
            class = 'executionTime-tagged shortRest'
        },
        longRest = {
            text = 'Long rest',
            symbol = '🌙',
            link = 'Long rest abilities',
            class = 'executionTime-tagged longRest'
        },
    },
    piercing = {
        av0 = {
            text = 'AV0',
            symbol = '🎯',
            link = 'AV0 abilities',
            color = '#33d17a',
            class = 'piercing-tagged av0'
        },
        unblockable = {
            text = 'UB',
            symbol = '🪨',
            link = 'UB abilities',
            color = '#33d17a',
            class = 'piercing-tagged ub'
        }
    },
    duration = {
        instant = {
            text = 'Instant',
            link = 'Instant duration abilities',
            no = true
        },
        always = {
            text = 'Always active',
            link = 'Always active duration abilities',
            no = true
        },
        noLimit = {
            text = 'No limit',
            link = 'No limit duration abilities',
            no = true
        },
        whileUp = {
            text = 'While up',
            link = 'While up duration abilities',
            no = true
        },
        whileDown = {
            text = 'While down',
            link = 'While down duration abilities',
            no = true
        },
        whileAlive = {
            text = 'While alive',
            link = 'While alive duration abilities',
            no = true
        },
        whileDead = {
            text = 'While dead',
            link = 'While dead duration abilities',
            no = true
        },
        endOfTurn = {
            text = 'Until the end of the turn',
            link = 'Until end of turn duration abilities',
            no = true
        },
        dawn = {
            text = 'Until dawn',
            link = 'Until dawn duration abilities',
            no = true
        },
        startOfTargetNextTurn = {
            text = 'Until the start of target\'s next turn',
            link = 'Until start of target\'s next turn duration abilities',
            no = true
        },
        endOfTargetNextTurn = {
            text = 'Until the end of target\'s next turn',
            link = 'Until end of target\'s next turn duration abilities',
            no = true
        },
        startOfYourNextTurn = {
            text = 'Until the start of your next turn',
            link = 'Until start of your next turn duration abilities',
            no = true
        },
        endOfYourNextTurn = {
            text = 'Until the end of your next turn',
            link = 'Until end of your next turn duration abilities',
            no = true
        },
        endOfCombat = {
            text = 'Until the end of combat',
            link = 'Until end of combat duration abilities',
            no = true
        }
    },
    range = {
        melee = {
            text = 'Your melee range',
            -- link = 'Melee abilities',
            no = true
        },
        weapon = {
            text = 'Your [[:Category:Weapons|weapon\'s]] range',
            -- link = 'Weapon range abilities',
            no = true
        },
        hand = {
            text = 'Your [[:Category:Handy equipment|hand\'s]] range',
            -- link = 'Hand range abilities',
            no = true
        },
        bite = {
            text = 'Your [[:Category:Biting equipment|bite\'s]] range',
            -- link = 'Bite range abilities',
            no = true
        },
        item = {
            text = 'Your [[:Category:Items|item\'s]] range',
            -- link = 'Item range abilities',
            no = true
        },
        shield = {
            text = 'Your [[:Category:Shields|shield\'s]] range',
            -- link = 'Shield range abilities',
            no = true
        },
        armor = {
            text = 'Your [[:Category:Armor|armor\'s]] range',
            -- link = 'Armor range abilities',
            no = true
        },
    },
    attribute = {
        int = {
            text = 'Intelligence',
            symbol = 'INT',
            link = 'INT save abilities',
            class = 'saveAttribute-tagged int'
        },
        str = {
            text = 'Strength',
            symbol = 'STR',
            link = 'STR save abilities',
            class = 'saveAttribute-tagged str'
        },
        mov = {
            text = 'Movement',
            symbol = 'MOV',
            link = 'MOV save abilities',
            class = 'saveAttribute-tagged mov'
        },
        per = {
            text = 'Perception',
            symbol = 'PER',
            link = 'PER save abilities',
            class = 'saveAttribute-tagged per'
        },
        snk = {
            text = 'Sneak',
            symbol = 'SNK',
            link = 'SNK save abilities',
            class = 'saveAttribute-tagged snk'
        },
        unp = {
            text = 'Unused Presence',
            symbol = 'UNP',
            link = 'UNP save abilities',
            class = 'saveAttribute-tagged unp'
        },
    },
    expansionAttribute = {
        int = {
            text = 'Intelligence',
            symbol = 'INT',
            link = 'INT save abilities',
            class = 'expansionAttribute-tagged int'
        },
        str = {
            text = 'Strength',
            symbol = 'STR',
            link = 'STR save abilities',
            class = 'expansionAttribute-tagged str'
        },
        mov = {
            text = 'Movement',
            symbol = 'MOV',
            link = 'MOV save abilities',
            class = 'expansionAttribute-tagged mov'
        },
        per = {
            text = 'Perception',
            symbol = 'PER',
            link = 'PER save abilities',
            class = 'expansionAttribute-tagged per'
        },
        snk = {
            text = 'Sneak',
            symbol = 'SNK',
            link = 'SNK save abilities',
            class = 'expansionAttribute-tagged snk'
        },
        unp = {
            text = 'Unused Presence',
            symbol = 'UNP',
            link = 'UNP save abilities',
            class = 'expansionAttribute-tagged unp'
        },
    },
    expansion = {
        detonate = {
            text = 'Detonate',
            symbol = '💥',
            link = 'Detonate expansion abilities',
            class = 'expansion-tagged detonate'
        },
        ripple = {
            text = 'Ripple',
            symbol = '🌊',
            link = 'Ripple expansion abilities',
            class = 'expansion-tagged ripple'
        },
        cascade = {
            text = 'Cascade',
            symbol = '➰',
            link = 'Cascade expansion abilities',
            class = 'expansion-tagged cascade'
        },
        fork = {
            text = 'Fork',
            symbol = '🔱',
            link = 'Fork expansion abilities',
            class = 'expansion-tagged fork'
        }
    },
    sustained = {
        sustained = {
            text = 'Sustained',
            symbol = '⏳️',
            link = 'Sustained abilities',
            class = 'sustained'
        }
    }
}

local premades = {
    strike = {
        maneuver = 'active',
        executionTime = '1a',
        interaction = 'attack',
        delivery = 'weapon',
        target = 'creature',
        duration = 'instant',
        range = 'weapon',
    },
    ray = {
        maneuver = 'active',
        executionTime = '1a',
        interaction = 'attack',
        delivery = 'missile',
        target = 'creature',
        duration = 'instant',
        range = '60f',
        piercing = 'av0',
    },
    ball = {
        maneuver = 'active',
        executionTime = '1a',
        interaction = 'attack',
        delivery = 'missile',
        target = 'creature',
        duration = 'instant',
        range = '30f',
        piercing = 'ub',
    },
    aura = {
        skip = true,
        maneuver = 'active',
        executionTime = '1a',
        interaction = 'feat',
        delivery = 'aura',
        target = 'creature',
        duration = 'instant',
        range = '10f',
        attribute = 'mov',
    },
    ritual = {
        maneuver = 'slow',
        executionTime = '10m',
        interaction = 'manifest',
        delivery = 'sight',
        target = 'creature',
        duration = 'instant',
        range = '5f',
    },
    touch = {
        maneuver = 'active',
        executionTime = '1a',
        interaction = 'attack',
        delivery = 'hand',
        target = 'creature',
        duration = 'instant',
        range = 'hand',
        piercing = 'ub',
    },
    triumph = {
        skip = true,
        maneuver = 'reactive',
        executionTime = '0r',
        interaction = 'manifest',
        delivery = 'self',
        target = 'self',
        duration = 'instant',
        range = 'self',
    },
    self = {
        skip = true,
        maneuver = 'active',
        executionTime = '1a',
        interaction = 'man',
        delivery = 'self',
        target = 'self',
        duration = 'instant',
        range = 'self',
    },
    passive = {
        skip = true,
        maneuver = 'passive',
        interaction = 'man',
        delivery = 'self',
        target = 'self',
        duration = '4',
        range = 'self',
    },
    crown = {
        skip = true,
        maneuver = 'active',
        executionTime = '1a',
        interaction = 'man',
        delivery = 'self',
        target = 'self',
        duration = '8h',
        range = 'self',
        sustained = 'sus',
    }
}

function noPlural(word)
    -- Common irregular plural forms
    local irregulars = {
        ["children"] = "child",
        ["men"] = "man",
        ["women"] = "woman",
        ["feet"] = "foot",
        ["teeth"] = "tooth",
        ["mice"] = "mouse",
        ["geese"] = "goose"
    }

    -- Check for irregular forms
    if irregulars[word] then
        return irregulars[word]
    end

    -- Regular pluralization rules
    if word:match("ies$") then
        -- Change words ending in 'ies' to 'y' (e.g., "parties" -> "party")
        return word:sub(1, -4) .. "y"
    elseif word:match("ves$") then
        -- Change words ending in 'ves' to 'f' or 'fe' (e.g., "wolves" -> "wolf")
        return word:sub(1, -4) .. "f"
    elseif word:match("s$") and not word:match("ss$") then
        -- Remove trailing 's' (e.g., "cats" -> "cat", but keep "boss")
        return word:sub(1, -2)
    else
        -- Return the word unchanged if no pluralization rule applies
        return word
    end
end

local function addCategory(category, key, val, skill, spell, addCats, noLower)
    if addCats then
        if not noLower then
            category = category:lower()
        end
        if tags[key] and tags[key][val] then
            if tags[key][val].tags then
                out = ''
                for _, t in ipairs(tags[key][val].tags) do
                    out = out .. addCategory(category, key, t, skill, spell, addCats, true)
                end
                return out
            else
                category = tags[key][val].link
            end
        end
        if skill then
            skillCategory = category:gsub('ability', 'skill'):gsub('abilities', 'skills')
            skillCategory = skillCategory:gsub("^%l", string.upper)
        end
        if spell then
            spellCategory = category:gsub('ability', 'spell'):gsub('abilities', 'spells')
            spellCategory = spellCategory:gsub("^%l", string.upper)
        end
        category = category:gsub("^%l", string.upper)
        
        local c = '[[Category:' .. tostring(category) .. ']]'
        if skill then
            c = c .. '[[Category:' .. tostring(skillCategory) .. ']]'
        end
        if spell then
            c = c .. '[[Category:' .. tostring(spellCategory) .. ']]'
        end
        return c
    else
        return ''
    end
end

local function makeTag(frame, key, value, makeCat, transparent)
    if not tags[key] or not tags[key][value] then
        if value then
            local out = frame:preprocess("{{ucfirst:" .. tostring(value) .. "}}")
            if not ('.' == out:sub(-1)) then
                out = out .. '.'
            end
            return out
        else
            return ''
        end
    end
    local tag = tags[key][value]
    if tag.no then
        local out = frame:preprocess("{{ucfirst:" .. tag.text .. "}}")
        if not ('.' == out:sub(-1)) then
            out = out .. '.'
        end
        return out
    end
    if tag.tags then
        local out = ''
        for _, t in ipairs(tag.tags) do
            out = out .. makeTag(frame, key, t, makeCat, transparent)
        end
        return out
    end
    local tagText = "{{Tag|{{ucfirst:" .. tag.text .. "}}"
    if tag.symbol then
        tagText = tagText .. "|" .. tag.symbol
    end
    if tag.link then
        tagText = tagText .. "|l=:Category:{{ucfirst:" .. tag.link .. "}}"
    end
    if tag.color then
        tagText = tagText .. "|c=" .. tag.color
    end
    if tag.class then
        tagText = tagText .. "|class=" .. tag.class
    end
    if transparent then
        tagText = tagText .. "|o=1"
    end
    tagText = tagText .. "}}"
    -- out = frame:preprocess(tagText)
    out = tagText
    return out
end

local function makeContent(frame, table, keys, makeCat)
    local content = ''
    local subContent = ''
    local hasPre = false
    for _, key in ipairs(keys) do
        if ('pre' == key and table['pre']) or ('executionTime' == key and table['executionTime']) or ('target' == key) or ('duration' == key) or ('invoked' == key and table['invoked']) then
            hasPre = true
            content = content .. frame:preprocess(makeTag(frame, key, table[key], makeCat))
        else
            if hasPre then
                subContent = subContent .. makeTag(frame, key, table[key], makeCat)
            else
                content = content .. frame:preprocess(makeTag(frame, key, table[key], makeCat))
            end
        end
    end
    if hasPre then
        content = content .. frame:preprocess('{{TagSub|' .. subContent .. '}}')
        -- content = content .. '{{TagSub|' .. subContent .. '}}'
    end
    if content == '' then
        for _, key in ipairs(keys) do
            if table[key] then
                content = frame:preprocess('{{ucfirst:' .. content .. table[key] .. '}}')
            end
        end
    end
    return content
end

local function makeBar(frame, title, content, link, flags, bottom)
    if content == '' then
        return ''
    end
    local barSpace = mw.html.create('span')
    barSpace
        :wikitext(frame:preprocess('&nbsp;'))
        :css('display', 'none')
    local barTitle = mw.html.create('span')
    local barTitleClass = title:lower()
    barTitleClass = barTitleClass:gsub(' ', '-')
    barTitleClass = barTitleClass:gsub('\'', '')
    barTitleClass = barTitleClass:gsub('\"', '')
    local barText = "{{ucfirst:" .. title .. "}}"
    if link then
        barText = "[[" .. link .. "|" .. barText .. "]]"
    end
    barText = barText .. ":"
    barTitle
        :addClass('ability-bar-title')
        :wikitext(frame:preprocess(barText))
        :css('font-weight', 'bold')
        :css('margin-right', '0.5em')
    local barContent = mw.html.create('span')
    barContent
        :addClass('ability-bar-content')
        :wikitext(content)
    local output = mw.html.create('div')
    if bottom then
        output = mw.html.create('span')
    end
    if not flags then
        flags = {}
    end
    for k, v in pairs(flags) do
        if type(v) == 'string' then
            output:addClass('flag-' .. k .. '-' .. v)
        end
    end
    output
        :addClass('ability-bar')
        :addClass('ability-bar-' .. barTitleClass)
        :attr(flags)
        :attr('test', 'out')
        :node(barSpace)
        :node(barTitle)
        :node(barSpace)
        :node(barContent)
        :css('display', 'block')
    -- if flags then
        -- for k, v in ipairs(flags) do
        --     output:attr(k, v)
        -- end
    -- end
    return tostring(output)
end

local function resolveAlias(args, aliases)
    local resolved = {}

    -- Resolve keys
    for canonicalKey, keyAliasList in pairs(aliases.keys) do
        for _, alias in ipairs(keyAliasList) do
            if args[alias] then
                resolved[canonicalKey] = args[alias]
                break
            end
        end
    end

    -- Resolve values
    for canonicalKey, canonicalValueTable in pairs(aliases.values) do
        local rawValue = resolved[canonicalKey]

        if rawValue then
            for canonicalValue, valueAliasList in pairs(canonicalValueTable) do
                for _, alias in ipairs(valueAliasList) do
                    if rawValue == '' then
                        resolved[canonicalKey] = false
                        break
                    elseif rawValue == alias then
                        resolved[canonicalKey] = canonicalValue
                        break
                    -- Handle patterns like timeParse or distParse
                    elseif rawValue and type(valueAliasList) == "table" and valueAliasList[1] and rawValue:match(valueAliasList[1]) then
                        if canonicalKey == "duration" or canonicalKey == "executionTime" then
                            -- Parse time duration (e.g., 5d -> "5 days")
                            local num = tonumber(rawValue:match("^(%d+)"))
                            local unit = rawValue:match("[%a]+$")
                            local unitMap = {m = "minute", h = "hour", d = "day", w = "week", y = "year", r = "round", s = "second"}
                            if unitMap[unit] then
                                local parsedValue = num .. " " .. unitMap[unit] .. (num > 1 and "s" or "")
                                resolved[canonicalKey] = parsedValue
                            else
                                resolved[canonicalKey] = rawValue
                            end
                        elseif canonicalKey == "range" or canonicalKey == "expansionRange" then
                            -- Parse distance (e.g., 30f -> "30 feet")
                            local num = tonumber(rawValue:match("^(%d+)"))
                            local unit = rawValue:match("[%a]+$")
                            local unitMap = {f = "feet", m = "miles"}
                            if unitMap[unit] then
                                local parsedValue = num .. " " .. unitMap[unit]
                                resolved[canonicalKey] = parsedValue
                            else
                                resolved[canonicalKey] = rawValue
                            end
                        end
                    end
                end
            end
        end
    end

    return resolved
end

local function exists(arg)
    return arg ~= nil and arg ~= '' and arg ~= false
end

local classFixes = {
    bar = 'ber',
    sam = 'due',
    ama = 'cor'
}

local classArchetypes = {
    ber = 'warr',
    due = 'warr',
    vet = 'warr',
    kni = 'warr',
    pal = 'warr',
    ass = 'semi',
    cor = 'semi',
    arc = 'semi',
    thi = 'semi',
    ran = 'semi',
    fla = 'mage',
    sto = 'mage',
    lif = 'mage',
    nec = 'mage',
    nat = 'mage'
}

local className = {
    ber = 'Berserker',
    due = 'Duelist',
    vet = 'Veteran',
    kni = 'Knight',
    pal = 'Paladin',
    ass = 'Assassin',
    cor = 'Corsair',
    arc = 'Archer',
    thi = 'Thief',
    ran = 'Ranger',
    fla = 'Flame Mage',
    sto = 'Storm Mage',
    lif = 'Life Mage',
    nec = 'Necromancer',
    nat = 'Nature Mage',
}

local archetypeName = {
    warr = 'Warrior',
    semi = 'Semi',
    mage = 'Mage',
}

function p.a ( frame )

    makeCat = true

    -- Figure out all the default values
    local args = frame.args
    local resolved = {}
    if args['pre'] then
        local toResolve = resolveAlias(premades[args['pre']], aliases)
        for k, v in pairs(toResolve) do
            resolved[k] = v
        end
    end
    local userResolve = resolveAlias(args, aliases)
    for k, v in pairs(userResolve) do
        resolved[k] = v
    end
    if resolved['pre'] and premades[args['pre']]['skip'] then
        resolved['pre'] = nil
    end
    if not resolved['duration'] then
        resolved['duration'] = 'instant'
    end

    if resolved['interaction'] == 'attack' then
        local dc = "Hit target's {{AC}}"
        if resolved['target'] == 'limb' then
            dc = "Hit target's {{Var:ACLimb}}"
        end
        if resolved['target'] == 'al' then
        	dc = "Hit target's {{Var:ACLimb}}"
    	end
        if resolved['target'] == 'arm' then
            dc = "Hit target's {{Var:ACLimb}}"
        end
        if resolved['target'] == 'leg' then
            dc = "Hit target's {{Var:ACLimb}}"
        end
        if resolved['target'] == 'vitals' then
            dc = "Hit target's {{Var:ACVitals}}"
        end
        if resolved['target'] == 'item' or resolved['target'] == 'ari' then
            dc = "Hit {{DC}} [[Core:Item Target|depends on item]]"
        end
        if resolved['target'] == 'shield' then
            dc = "Hit user's {{Var:ACWielded}}"
        end
        if resolved['target'] == 'armor' then
            dc = "Hit user's {{Var:ACWorn}}"
        end
        if resolved['target'] == 'weapon' then
            dc = "Hit user's {{Var:ACWielded}}"
        end
        resolved['hitDC'] = dc
    end

    if resolved['expansionCount'] then
        if resolved['expansionCount'] == '1' then
            resolved['expansionCount'] = '{{Space}}' .. resolved['expansionCount'] .. ' extra execution.'
        else
            resolved['expansionCount'] = '{{Space}}' .. resolved['expansionCount'] .. ' extra executions.'
        end
    end

    if resolved['invoked'] then
        resolved['verbal'] = 'verbal'
        resolved['somatic'] = 'somatic'
        resolved['mage'] = 'magelore'
    end

    local skill = false
    local spell = false
    local standard = false

    local class = nil
    local classFull = nil
    local archetype = nil
    local archetypeFull = nil
    local rank = nil
    if args['class'] then
        class = args['class']
        if classFixes[class] then
            class = classFixes[class]
        end
    end
    if args['class'] or args['arch'] then
        archetype = classArchetypes[class]
        if args['arch'] then
            archetype = args['arch']
        end
        classFull = className[class]
        archetypeFull = archetypeName[archetype]
        standard = true
        if archetype == 'warr' or archetype == 'semi' then
            skill = true
        end
        if archetype == 'mage' then
            spell = true
        end
    end
    local costMP = nil
    local costHP = nil
    local costGP = nil
    if args['pre'] == 'crown' then
        spell = true
        costMP = '1'
        rank = '2'
    end
    if args['rank'] then
        rank = args['rank']
    end
    
    if args['skill'] then
        skill = true
        if args['skill'] == '0' or args['skill'] == 'false' then
            skill = false
        end
    end
    if args['spell'] then
        spell = true
        if args['spell'] == '0' or args['spell'] == 'false' then
            spell = false
        end
    end
    if args['standard'] then
        standard = true
        if args['standard'] == '0' or args['standard'] == 'false' then
            standard = false
        end
    end
    if args['mp'] and args['mp']:len() > 0 then
        costMP = args['mp']
    end
    if args['hp'] and args['hp']:len() > 0 then
        costHP = args['hp']
    end
    if args['gp'] and args['gp']:len() > 0 then
        costGP = args['gp']
    end
    if exists(args['shatter']) then
    	costShatter = args['shatter']
    end

    local basic = false
    local journeyman = false
    if args['basic'] then
        basic = true
    end
    if args['journeyman'] or args['jm'] then
        journeyman = true
    end

    -- Category string
    local c = ''

    local name = args['name']
    local page = mw.title.getCurrentTitle().text
    local namespace = frame:preprocess('{{NAMESPACE}}')
    local addCats = ((namespace == 'Ability') and (page == name))
    c = c .. addCategory('Abilities', nil, nil, skill, spell, addCats)
    if basic then
        c = c .. addCategory('Basic abilities', 'basic', nil, skill, spell, addCats)
    end
    if journeyman then
        c = c .. addCategory('Journeyman abilities', 'journeyman', nil, skill, spell, addCats)
    end
    local esContent = ''
    if args['es'] and args['es']:len() > 0 then
        esContent = esContent .. makeTag(frame, 'es', 'es', makeCat)
        c = c .. addCategory('Elder Sorcery abilities', 'es', 'es', skill, spell, addCats)
    else
    	if spell then
    		standard = '1'
		end
    end
    if standard then
        c = c .. addCategory('Standard abilities', nil, nil, false, false, addCats)
        if skill then
            c = c .. addCategory('Semblant skills', nil, nil, skill, spell, addCats)
        end
        if spell then
            c = c .. addCategory('Conjured spells', nil, nil, skill, spell, addCats)
        end
    else
        c = c .. addCategory('Nonstandard abilities', nil, nil, skill, spell, addCats)
    end
    if args['ethereal'] then
        c = c .. addCategory('Ethereal abilities', nil, nil, skill, spell, addCats)
    end
    if args['av'] then
    	c = c .. addCategory('AV granting abilities', nil, nil, skill, spell, addCats, true)
    	c = c .. addCategory('AV' .. args['av'] .. ' granting abilities', nil, nil, skill, spell, addCats, true)
    end
    if (archetype and archetypeFull) then
        c = c .. addCategory(archetypeFull .. ' archetype abilities', 'archetype', archetype, skill, spell, addCats)
    end
    if (class and classFull) then
        c = c .. addCategory(classFull .. ' class abilities', 'class', class, skill, spell, addCats, true)
    end
    if (rank and (class and classFull)) then
        if rank == '3' then
            rank = '3+'
        end
        c = c .. addCategory('Rank ' .. rank .. ' ' .. classFull .. ' abilities', 'rank', rank, skill, spell, addCats, true)
    end
    if resolved['pre'] then
        c = c .. addCategory(resolved['pre'] .. 'abilities', 'pre', resolved['pre'], skill, spell, addCats)
    end
    if resolved['interaction'] then
        c = c .. addCategory(resolved['interaction'] .. ' interaction abilities', 'interaction', resolved['interaction'], skill, spell, addCats)
    end
    if resolved['delivery'] then
        c = c .. addCategory(resolved['delivery'] .. ' delivery abilities', 'delivery', resolved['delivery'], skill, spell, addCats)
    end
    if resolved['target'] then
        c = c .. addCategory(resolved['target'] .. ' target abilities', 'target', resolved['target'], skill, spell, addCats)
    end
    if resolved['duration'] then
        c = c .. addCategory(noPlural(resolved['duration']) .. ' duration abilities', 'duration', resolved['duration'], skill, spell, addCats)
    end
    -- if resolved['range'] then
    --     c = c .. addCategory(resolved['range'] .. ' range abilities', 'range', resolved['range'], skill, spell, addCats)
    -- end
    if resolved['expansion'] then
        c = c .. addCategory(resolved['expansion'] .. ' expansion abilities', 'expansion', resolved['expansion'], skill, spell, addCats)
    end
    -- if resolved['expansionRange'] then
    --     c = c .. addCategory(resolved['expansionRange'] .. ' expansion range abilities', 'expansionRange', resolved['expansionRange'], skill, spell, addCats)
    -- end
    if resolved['attribute'] then
        c = c .. addCategory(resolved['attribute'] .. ' save abilities', 'attribute', resolved['attribute'], skill, spell, addCats)
    end
    if resolved['piercing'] then
        c = c .. addCategory(resolved['piercing'] .. ' abilities', 'piercing', resolved['piercing'], skill, spell, addCats)
    end
    if resolved['sustained'] then
        c = c .. addCategory('Sustained abilities', 'sustained', resolved['sustained'], skill, spell, addCats)
    end
    if resolved['upgrade'] then
        c = c .. addCategory(resolved['upgrade'] .. ' abilities', 'upgrade', resolved['upgrade'], skill, spell, addCats)
    end
    if resolved['executionTime'] then
        c = c .. addCategory(noPlural(resolved['executionTime']) .. ' execution time abilities', 'executionTime', resolved['executionTime'], skill, spell, addCats)
    end
    if resolved['maneuver'] then
        c = c .. addCategory(resolved['maneuver'] .. ' abilities', 'maneuver', resolved['maneuver'], skill, spell, addCats)
    end
    if resolved['verbal'] then
        c = c .. addCategory('Verbal component abilities', 'verbal', resolved['verbal'], skill, spell, addCats)
    end
    if resolved['somatic'] then
        c = c .. addCategory('Somatic component abilities', 'somatic', resolved['somatic'], skill, spell, addCats)
    end
    if resolved['material'] then
        c = c .. addCategory('Material component abilities', 'material', resolved['material'], skill, spell, addCats)
    end
    if resolved['magelore'] then
        c = c .. addCategory('Magelore component abilities', 'magelore', resolved['magelore'], skill, spell, addCats)
    end
    if resolved['invoked'] then
        c = c .. addCategory('Invoke abilities', 'invoked', resolved['invoked'], skill, spell, addCats)
    end

    local flawContent = ''
    if args['flaw'] or args['f'] or args['fl'] then
        flawContent = flawContent .. makeTag(frame, 'flaw', 'flaw', makeCat)
        c = c .. addCategory('Flaw abilities', 'flaw', 'flaw', skill, spell, addCats)
    end
    local specialContent = ''
    if args['special'] or args['s'] or args['sp'] and ((args['special']:len() > 0) or (args['s']:len() > 0) or (args['sp']:len() > 0)) then
        specialContent = specialContent .. makeTag(frame, 'special', 'special', makeCat)
        c = c .. addCategory('Special abilities', 'special', 'special', skill, spell, addCats)
    end
    local wardedContent = ''
    if args['warded'] and args['warded']:len() > 0 then
        wardedContent = wardedContent .. makeTag(frame, 'warded', 'warded', makeCat)
        c = c .. addCategory('Warded abilities', 'warded', 'warded', skill, spell, addCats)
    end

    local elementContent = ''
    if args['life'] and args['life']:len() > 0 then
        elementContent = elementContent .. makeTag(frame, 'elements', 'life', makeCat)
        c = c .. addCategory('Life element abilities', 'elements', 'life', skill, spell, addCats)
    end
    if args['storm'] and args['storm']:len() > 0 then
        elementContent = elementContent .. makeTag(frame, 'elements', 'storm', makeCat)
        c = c .. addCategory('Storm element abilities', 'elements', 'storm', skill, spell, addCats)
    end
    if (args['necro'] and args['necro']:len() > 0) or (args['necromancy'] and args['necromancy']:len() > 0) then
        elementContent = elementContent .. makeTag(frame, 'elements', 'necro', makeCat)
        c = c .. addCategory('Necromancy element abilities', 'elements', 'necro', skill, spell, addCats)
    end
    if args['flame'] and args['flame']:len() > 0 then
        elementContent = elementContent .. makeTag(frame, 'elements', 'flame', makeCat)
        c = c .. addCategory('Flame element abilities', 'elements', 'flame', skill, spell, addCats)
    end
    if args['nature'] and args['nature']:len() > 0 then
        elementContent = elementContent .. makeTag(frame, 'elements', 'nature', makeCat)
        c = c .. addCategory('Nature element abilities', 'elements', 'nature', skill, spell, addCats)
    end

    local powerContent = ''
    local martial = true
    if args['magic'] and args['magic']:len() > 0 then
        martial = false
        powerContent = powerContent .. makeTag(frame, 'power', 'magic', makeCat)
        c = c .. addCategory('Magically powered abilities', 'power', 'magic', skill, spell, addCats) .. addCategory('Magical effects', nil, nil, false, false, addCats)
    end
    if args['divine'] and args['divine']:len() > 0 then
        martial = false
        powerContent = powerContent .. makeTag(frame, 'power', 'divine', makeCat)
        c = c .. addCategory('Divinely powered abilities', 'power', 'divine', skill, spell, addCats) .. addCategory('Divine effects', nil, nil, false, false, addCats)
    end
    if args['spirit'] and args['spirit']:len() > 0 then
        martial = false
        powerContent = powerContent .. makeTag(frame, 'power', 'spirit', makeCat)
        c = c .. addCategory('Spiritually powered abilities', 'power', 'spirit', skill, spell, addCats) .. addCategory('Spiritual effects', nil, nil, false, false, addCats)
    end
    if args['primal'] and args['primal']:len() > 0 then
        martial = false
        powerContent = powerContent .. makeTag(frame, 'power', 'primal', makeCat)
        c = c .. addCategory('Primally powered abilities', 'power', 'primal', skill, spell, addCats) .. addCategory('Primal effects', nil, nil, false, false, addCats)
    end
    if args['psionic'] and args['psionic']:len() > 0 then
        martial = false
        powerContent = powerContent .. makeTag(frame, 'power', 'psionic', makeCat)
        c = c .. addCategory('Psionically powered abilities', 'power', 'psionic', skill, spell, addCats) .. addCategory('Mental effects', nil, nil, false, false, addCats)
    end
    if args['techno'] and args['techno']:len() > 0 then
        martial = false
        powerContent = powerContent .. makeTag(frame, 'power', 'techno', makeCat)
        c = c .. addCategory('Technologically powered abilities', 'power', 'techno', skill, spell, addCats) .. addCategory('Technological effects', nil, nil, false, false, addCats)
    end
    if args['finance'] and args['finance']:len() > 0 then
        martial = false
        powerContent = powerContent .. makeTag(frame, 'power', 'finance', makeCat)
        c = c .. addCategory('Financially powered abilities', 'power', 'finance', skill, spell, addCats) .. addCategory('Financial effects', nil, nil, false, false, addCats)
    end
    if args['matpow'] and args['matpow']:len() > 0 then
        martial = false
        powerContent = powerContent .. makeTag(frame, 'power', 'matpow', makeCat)
        c = c .. addCategory('Financially powered abilities', 'power', 'matpow', skill, spell, addCats) .. addCategory('Material effects', nil, nil, false, false, addCats)
    end
    if args['alchemy'] and args['alchemy']:len() > 0 then
        martial = false
        powerContent = powerContent .. makeTag(frame, 'power', 'alchemy', makeCat)
        c = c .. addCategory('Alchemically powered abilities', 'power', 'alchemy', skill, spell, addCats) .. addCategory('Alchemical effects', nil, nil, false, false, addCats)
    end
    if args['unknown'] and args['unknown']:len() > 0 then
        martial = false
        powerContent = powerContent .. makeTag(frame, 'power', 'unknown', makeCat)
        c = c .. addCategory('Unknown powered abilities', 'power', 'unknown', skill, spell, addCats)
    end
    if args['martial'] and args['martial']:len() > 0 then
        martial = true
    end
    if martial then
        powerContent = powerContent .. makeTag(frame, 'power', 'martial', makeCat)
        c = c .. addCategory('Martially powered abilities', 'power', 'martial', skill, spell, addCats)
    end
    if class then
        classContent = makeContent(frame, resolved, {'class'}, makeCat)
        powerContent = powerContent .. classContent
    end
    if args['rotator'] and args['rotator']:len() > 0 then
        powerContent = powerContent .. makeTag(frame, 'category', 'rotator', makeCat)
    end
    if args['gm'] and args['gm']:len() > 0 then
        powerContent = powerContent .. makeTag(frame, 'gm', args['gm'], makeCat)
    end
    if args['guildmaster'] and args['guildmaster']:len() > 0 then
        powerContent = powerContent .. makeTag(frame, 'category', 'guildmaster', makeCat)
    end
    powerContent = powerContent .. elementContent
    if skill then
        powerContent = powerContent .. makeTag(frame, 'category', 'skill', makeCat)
    end
    if spell then
        powerContent = powerContent .. makeTag(frame, 'category', 'spell', makeCat)
    end

    local deliveryContent = ''
    if standard and skill then
        deliveryContent = deliveryContent .. makeTag(frame, 'category', 'semblant', makeCat)
    end
    if standard and spell then
        deliveryContent = deliveryContent .. makeTag(frame, 'category', 'conjure', makeCat)
    end

    local effectContent = ''
    if exists(args['mental']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'mental', makeCat)
        c = c .. addCategory('Mental effects', 'effect', 'mental', skill, spell, addCats)
    end
    if exists(args['truth']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'truth', makeCat)
        c = c .. addCategory('Truth detecting effects', 'effect', 'truthDetecting', skill, spell, addCats)
    end
    if exists(args['duelMod']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'duelModifying', makeCat)
        c = c .. addCategory('Duel modifying effects', 'effect', 'duelModifying', skill, spell, addCats)
    end
    if exists(args['movement']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'movement', makeCat)
        c = c .. addCategory('Movement effects', 'effect', 'movement', skill, spell, addCats)
    end
    if exists(args['poison']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'poison', makeCat)
        c = c .. addCategory('Poison effects', 'effect', 'poison', skill, spell, addCats)
    end
    if exists(args['illusion']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'illusion', makeCat)
        c = c .. addCategory('Illusion effects', 'effect', 'illusion', skill, spell, addCats)
    end
    if exists(args['displacement']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'displacement', makeCat)
        c = c .. addCategory('Displacement effects', 'effect', 'displacement', skill, spell, addCats)
    end
    if exists(args['transformation']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'transformation', makeCat)
        c = c .. addCategory('Transformation effects', 'effect', 'transformation', skill, spell, addCats)
    end
    if exists(args['control']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'control', makeCat)
        c = c .. addCategory('Control effects', 'effect', 'control', skill, spell, addCats)
    end
    if exists(args['resist']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'resist', makeCat)
        c = c .. addCategory('Resistance effects', 'effect', 'resist', skill, spell, addCats)
    end
    if exists(args['hexproof']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'hexproof', makeCat)
        c = c .. addCategory('Hexproof effects', 'effect', 'hexproof', skill, spell, addCats)
    end
    if exists(args['awaken']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'awaken', makeCat)
        c = c .. addCategory('Awakening effects', 'effect', 'awaken', skill, spell, addCats)
    end
    if exists(args['immune']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'immune', makeCat)
        c = c .. addCategory('Immunity effects', 'effect', 'immune', skill, spell, addCats)
    end
    if exists(args['hexseal']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'hexseal', makeCat)
        c = c .. addCategory('Hexseal effects', 'effect', 'hexseal', skill, spell, addCats)
    end
    if exists(args['long']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'long', makeCat)
        c = c .. addCategory('Long range effects', 'effect', 'long', skill, spell, addCats)
    end
    if exists(args['sense']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'sense', makeCat)
        c = c .. addCategory('Sensory effects', 'effect', 'sense', skill, spell, addCats)
    end
    if exists(args['revive'] or args['rev']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'revive', makeCat)
        c = c .. addCategory('Revival effects', 'effect', 'revive', skill, spell, addCats)
    end
    if exists(args['summon']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'summon', makeCat)
        c = c .. addCategory('Summoning effects', 'effect', 'summon', skill, spell, addCats)
    end
    if exists(args['heal']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'heal', makeCat)
        c = c .. addCategory('Healing effects', 'effect', 'heal', skill, spell, addCats)
    end
    if exists(args['reanimate'] or args['rean']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'reanimate', makeCat)
        c = c .. addCategory('Reanimation effects', 'effect', 'reanimate', skill, spell, addCats)
    end
    if exists(args['regenerate'] or args['regen']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'regenerate', makeCat)
        c = c .. addCategory('Regeneration effects', 'effect', 'regenerate', skill, spell, addCats)
    end
    if exists(args['revitalize'] or args['revit']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'revitalize', makeCat)
        c = c .. addCategory('Revitalization effects', 'effect', 'revitalize', skill, spell, addCats)
    end
    if exists(args['kill']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'kill', makeCat)
        c = c .. addCategory('Killing effects', 'effect', 'kill', skill, spell, addCats)
    end
    if exists(args['damage']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'damage', makeCat)
        c = c .. addCategory('Damaging effects', 'effect', 'damage', skill, spell, addCats)
    end
    if exists(args['drain']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'drain', makeCat)
        c = c .. addCategory('Draining effects', 'effect', 'drain', skill, spell, addCats)
    end
    if exists(args['destroy']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'destroy', makeCat)
        c = c .. addCategory('Destruction effects', 'effect', 'destroy', skill, spell, addCats)
    end
    if exists(args['contract']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'contract', makeCat)
        c = c .. addCategory('Contract effects', 'effect', 'contract', skill, spell, addCats)
    end
    if exists(args['steal']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'steal', makeCat)
        c = c .. addCategory('Stealing effects', 'effect', 'steal', skill, spell, addCats)
    end
    if exists(args['loud']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'loud', makeCat)
        c = c .. addCategory('Loud effects', 'effect', 'loud', skill, spell, addCats)
    end
    if exists(args['knockout']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'knockout', makeCat)
        c = c .. addCategory('Knockout effects', 'effect', 'knockout', skill, spell, addCats)
    end
    if exists(args['time']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'time', makeCat)
        c = c .. addCategory('Temporal effects', 'effect', 'time', skill, spell, addCats)
    end
    if exists(args['lightning']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'lightning', makeCat)
        c = c .. addCategory('Lightning effects', 'effect', 'lightning', skill, spell, addCats)
    end
    if exists(args['disease']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'disease', makeCat)
        c = c .. addCategory('Disease effects', 'effect', 'disease', skill, spell, addCats)
    end
    if exists(args['vision']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'vision', makeCat)
        c = c .. addCategory('Vision effects', 'effect', 'vision', skill, spell, addCats)
    end
    if exists(args['morganti']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'morganti', makeCat)
        c = c .. addCategory('Morganti effects', 'effect', 'morganti', skill, spell, addCats)
    end
    if exists(args['construction']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'construction', makeCat)
        c = c .. addCategory('Construction effects', 'effect', 'construction', skill, spell, addCats)
    end
    if exists(args['weather']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'weather', makeCat)
        c = c .. addCategory('Weather effects', 'effect', 'weather', skill, spell, addCats)
    end

    local autoContent = ''
    if exists(args['auto']) then
        effectContent = effectContent .. makeTag(frame, 'effects', 'auto', makeCat)
        c = c .. addCategory('Automatic effects', 'effect', 'auto', skill, spell, addCats)
        autoContent = autoContent .. ' This triggers automatically. You cannot choose to not use it if you are able to.'
    end

    local costContent = ''
    if costMP then
        c = c .. addCategory('MP cost abilities', 'costMP', costMP, skill, spell, addCats, true)
        if costMP == 'x' then
            costContent = costContent .. frame:preprocess("{{Tag|X MP|🩵|l=:Category:MP cost abilities|c=#3584e4|class=cost-tagged mpx}}")
            c = c .. addCategory('Variable MP cost abilities', 'costMP', 'x', skill, spell, addCats, true)
        else
            costContent = costContent .. frame:preprocess("{{Tag|" .. costMP .. " MP|🩵|l=:Category:MP cost abilities|c=#3584e4|class=cost-tagged mp" .. costMP .. "}}")
            c = c .. addCategory(costMP .. ' MP cost abilities', 'costMP', costMP, skill, spell, addCats, true)
        end
    end
    if costHP then
        c = c .. addCategory('HP cost abilities', 'costHP', costHP, skill, spell, addCats, true)
        if costHP == 'x' then
            costContent = costContent .. frame:preprocess("{{Tag|X HP|❤️|l=:Category:HP cost abilities|c=#e01b24|class=cost-tagged hpx}}")
            c = c .. addCategory('Variable HP cost abilities', 'costHP', 'x', skill, spell, addCats, true)
        else
            costContent = costContent .. frame:preprocess("{{Tag|" .. costHP .. " HP|❤️|l=:Category:HP cost abilities|c=#e01b24|class=cost-tagged hp" .. costHP .. "}}")
            c = c .. addCategory(costHP .. ' HP cost abilities', 'costHP', costHP, skill, spell, addCats, true)
        end
    end
    if costGP then
        c = c .. addCategory('GP cost abilities', 'costGP', costGP, skill, spell, addCats, true)
        if costGP == 'x' then
            costContent = costContent .. frame:preprocess("{{Tag|X GP|🪙|l=:Category:GP cost abilities|c=#F6D32D|class=cost-tagged gpx}}")
            c = c .. addCategory('Variable GP cost abilities', 'costGP', 'x', skill, spell, addCats, true)
        else
            costContent = costContent .. frame:preprocess("{{Tag|" .. costGP .. " GP|🪙|l=:Category:GP cost abilities|c=#F6D32D|class=cost-tagged gp" .. costGP .. "}}")
            c = c .. addCategory(costGP .. ' GP cost abilities', 'costGP', costGP, skill, spell, addCats, true)
        end
    end
    if costShatter then
        c = c .. addCategory('Shatter cost abilities', 'costShatter', costShatter, skill, spell, addCats)
        costContent = costContent .. frame:preprocess("{{Tag|Shatter|💥|l=:Category:Shatter cost abilities|class=cost-tagged shatter}}")
    end
    if args['cost'] then
        costContent = costContent .. frame:preprocess(args['cost'])
    end

    local executionTimeTitle = 'Execution time'
    if spell then
        executionTimeTitle = 'Casting time'
    end

    local expansionContent = 'TEST'
    -- if args['ec'] or args['expCount'] or args['expansionCount'] then
    --     -- local ec = args['ec'] or args['expCount'] or args['expansionCount']
    --     -- ec = tostring(ec)
    --     local ec = '1'
    --     expansionContent = 'This ability expands ' .. ec .. ' time' .. (tonumber(ec) > 1 and 's' or '') .. '.'
    -- end

    local heightenedContent = ''
    if args['heightened'] and args['heightened']:len() > 0 then
        heightenedContent = heightenedContent .. 'For each additional {{MP}} spent, ' .. args['heightened']
        -- heightenedContent = heightenedContent .. ' You can only {{L|Core|Heightening|Heighten}} if you are {{L|Core|Proficiency Bonus|Proficient}} or {{L|Core|Fluency Bonus|Fluent}} in ' .. args['name'] .. ' and only up to the corresponding bonus.'
        c = c .. addCategory('Heightened abilities', 'heightened', args['heightened'], skill, spell, addCats, true)
    end

    local proficiencyContent = ''
    if args['pro'] then
        proficiencyContent = proficiencyContent .. frame:preprocess(args['pro'])
    end

    local fluencyContent = ''
    if args['flu'] then
        fluencyContent = fluencyContent .. frame:preprocess(args['flu'])
    end

    local restrictionContent = ''
    if args['restrict'] then
        restrictionContent = restrictionContent .. frame:preprocess(args['restrict'])
    end

    local statValContent = ''
    local statFeatContent = ''
    if args['vstat'] and args['val'] then
        local vstat = frame:preprocess("{{uc:" .. args['vstat'] .. "}}")
        statValContent = 'This ability sets your {{L|Core|' .. vstat .. '}}' .. ' score to a minimum of ' .. args['val'] .. '.'
        c = c .. addCategory('Attribute setting abilities', 'val', args['val'], skill, spell, addCats, true)
        c = c .. addCategory(vstat .. ' setting abilities', 'vstat', args['vstat'], skill, spell, addCats, true)
        c = c .. addCategory(vstat .. ' value of ' .. args['val'] .. ' setting abilities', 'val', args['val'], skill, spell, addCats, true)
    end
    local f = 'proficiency'
    if args['fflu'] then
        f = 'fluency'
    end
    if args['fstat'] and (args['fflu'] or args['fpro']) then
        local fstat = frame:preprocess("{{uc:" .. args['fstat'] .. "}}")
        statFeatContent = 'This ability gives {{L|Core|' .. f .. ' Bonus|' .. f .. '}} in {{L|Core|' .. fstat .. '}} {{L|Core|Feat Interaction|Feat Saves}}.'
        c = c .. addCategory('Feat save improvement abilities', 'flu', args['fflu'], skill, spell, addCats)
        c = c .. addCategory('Feat save ' .. f .. ' granting abilities', 'fstat', args['fstat'], skill, spell, addCats, true)
        c = c .. addCategory(fstat .. ' feat save ' .. f .. ' granting abilities', 'fstat', args['fstat'], skill, spell, addCats, true)
    end
    if args['rotator'] and args['rotator']:len() > 0 then
        c = c .. addCategory('Rotator abilities', 'rotator', args['rotator'], skill, spell, addCats)
    end
    if args['gm'] then
        c = c .. addCategory(tags['gm'][args['gm']]['link'], 'gm', args['gm'], skill, spell, addCats)
    end
    if args['guildmaster'] then
        c = c .. addCategory('Guildmaster abilities', 'guildmaster', args['guildmaster'], skill, spell, addCats)
    end
    if args['style'] then
        c = c .. addCategory('Casting style abilities', 'style', args['style'], skill, spell, addCats)
    end
    if args['weapon'] then
        c = c .. addCategory('Weapon fighting style abilities', 'weapon', args['weapon'], skill, spell, addCats)
    end

    -- Remove range from self targeted abilities
    if resolved['target'] == 'self' or resolved['range'] == 'self' then
        resolved['range'] = nil
    end

    local barsTop = {
        -- {
        --     title = 'elements',
        --     content = frame:preprocess(elementContent)
        -- },
        {
            title = 'power sources',
            content = frame:preprocess(esContent .. powerContent),
            link = ':Category:Powered abilities'
        },
        {
            title = 'effect types',
            content = frame:preprocess(flawContent .. specialContent .. effectContent),
            link = ':Category:Effects'
        },
        {
            title = 'delivery',
            content = frame:preprocess(wardedContent .. deliveryContent) .. makeContent(frame, resolved, {'expansion', 'pre', 'upgrade', 'piercing', 'delivery', 'interaction'}, makeCat),
            link = ':Category:Delivery abilities'
        },
        {
            title = 'save attribute',
            content = makeContent(frame, resolved, {'attribute'}, makeCat),
            link = 'Core:Feat Interaction'
        },
        {
            title = 'expansion save attribute',
            content = makeContent(frame, resolved, {'expansionAttribute'}, makeCat),
        },
        {
            title = 'target',
            content = makeContent(frame, resolved, {'target', 'hitDC'}, makeCat),
            link = ':Category:Target abilities'
        },
        {
            title = executionTimeTitle,
            content = makeContent(frame, resolved, {'executionTime', 'maneuver'}, makeCat),
            link = 'Core:Maneuvers'
        },
        {
            title = 'trigger',
            content = (args['trigger'] or '') .. autoContent,
            link = 'Core:Reactive Maneuvers'
        },
        {
            title = 'cost and components',
            content = frame:preprocess(costContent) .. makeContent(frame, resolved, {'material', 'invoked', 'verbal', 'somatic', 'magelore'}, makeCat),
            link = ':Category:Cost abilities'
        },
        {
            title = 'Mana cost',
            content = args['mpx'] or '',
            link = ':Category:MP cost abilities'
        },
        {
            title = 'Hit cost',
            content = args['hpx'] or '',
            link = ':Category:HP cost abilities'
        },
        {
            title = 'Gold cost',
            content = args['gpx'] or '',
            link = ':Category:GP cost abilities'
        },
        {
            title = 'Material cost',
            content = makeContent(frame, resolved, {'matx'}, makeCat),
            link = ':Category:Material component abilities'
        },
        {
            title = 'duration',
            content = makeContent(frame, resolved, {'duration', 'sustained'}, makeCat),
            link = ':Category:Duration abilities'
        },
        {
            title = 'range',
            content = makeContent(frame, resolved, {'range'}, makeCat),
            link = 'Core:Range'
        },
        -- {
        --     title = 'expansion',
        --     content = makeContent(frame, resolved, {'expansion'}, makeCat)
        -- },
        {
            title = 'expansion range',
            content = makeContent(frame, resolved, {'expansionRange'}, makeCat),
            link = 'Core:Expansions'
        },
        {
            title = 'expansion cap',
            content = makeContent(frame, resolved, {'expansionCount'}, makeCat),
            link = 'Core:Expansions'
        },
        {
            title = 'Requirements',
            content = makeContent(frame, resolved, {'requirement'}, makeCat)
        },
    }

    local barsBottom = {
        {
            title = 'End condition',
            content = args['end'] or ''
        },
        {
            title = 'On critical hit',
            content = args['crithit'] or ''
        },
        {
            title = 'On hit',
            content = args['hit'] or ''
        },
        {
            title = 'On miss',
            content = args['miss'] or ''
        },
        {
            title = 'On critically miss',
            content = args['critmiss'] or ''
        },
        {
            title = 'On critical fail',
            content = args['critfail'] or ''
        },
        {
            title = 'On fail',
            content = args['fail'] or ''
        },
        {
            title = 'On success',
            content = args['success'] or ''
        },
        {
            title = 'On critical success',
            content = args['critsuccess'] or ''
        },
        {
            title = 'Heightened',
            content = frame:preprocess(heightenedContent),
            link = ':Category:Heightened abilities'
        },
        {
            title = 'If proficient',
            content = proficiencyContent,
            link = 'Core:Proficiency Bonus'
        },
        {
            title = 'If fluent',
            content = fluencyContent,
            link = 'Core:Fluency Bonus'
        },
        {
            title = 'Attribute improvement',
            content = frame:preprocess(statValContent),
            link = 'Core:Attributes',
            flags = {
                attribute = args['vstat'] and frame:preprocess('{{lc:' .. args['vstat'] .. '}}') or "",
                value = args['val']
            }
        },
        {
            title = 'Feat save improvement',
            content = frame:preprocess(statFeatContent),
            link = 'Core:Feat Interaction',
            flags = {
                attribute = args['fstat'] and frame:preprocess('{{lc:' .. args['fstat'] .. '}}'),
                value = f
            }
        },
    }

    local outputTop = ''
    for _, bar in ipairs(barsTop) do
        outputTop = outputTop .. makeBar(frame, bar['title'], bar['content'], bar['link'], bar['flags'], false)
    end
    local outputBottom = ''

    for _, bar in ipairs(barsBottom) do
        outputBottom = outputBottom .. makeBar(frame, bar['title'], bar['content'], bar['link'], bar['flags'], true)
    end

    local outputMiddle = ''
    if args['e'] then
        outputMiddle = frame:preprocess(args['e'])
    end

    local output = mw.html.create('span')
    output
        :addClass('ability-variables')
    if args['basic'] then
        output
            :addClass('ability-basic')
    end
    output:wikitext(outputTop)
    
    if outputMiddle ~= '' then
        output
            :wikitext('<hr>')
            :wikitext('<span class="ability-overview-base">' .. outputMiddle .. '</span>')
    end

    if outputBottom ~= '' then
        output
            :wikitext('<hr>')
            :wikitext(outputBottom)
    end

    output = tostring(output) .. c
    output = output .. frame:preprocess('<templatestyles src="Template:Ability/styles.css" />')
    if not name then
        output = output .. '<span style="color: red;>NO NAME PROVIDED VERY BAD EVERY ABILITY NEEDS A NAME OKAY</span>'
    end

    return output
end

return p