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
Tag: Reverted
// via Wikitext Extension for VSCode
Tag: Manual revert
Line 3: Line 3:
local aliases = {
local aliases = {
     keys = {
     keys = {
         pre = {'pre', 'premade'},
         pre = {
        maneuver = {'man', 'maneuver', 'm'},
             'pre',
        interaction = {'int', 'interaction', 'i'},
             'premade',
        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 = {
         maneuver = {
             active = {'ac', 'active', 'a'},
             'man',
             reactive = {'re', 'reaction', 'r'},
             'maneuver',
             passive = {'ps', 'passive', 'p'},
             'm'
            slow = {'sl', 'slow', 's'}
         },
         },
         interaction = {
         interaction = {
             attack = {'atk', 'attack', 'a'},
             'int',
             block = {'blk', 'block', 'b'},
             'interaction',
             manifest = {'man', 'manifest', 'm'},
             'i'
            feat = {'fea', 'feat', 'f'}
         },
         },
         delivery = {
         delivery = {
             self = {'sel', 'self', 's'},
             'del',
             missile = {'mis', 'missile', 'm'},
             'delivery',
             hand = {'han', 'hand', 'h', 'claw'},
             'd'
            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 = {
         target = {
             self = {'sel', 'self', 's'},
             'tar',
            creature = {'cre', 'creature', 'c'},
             'target',
            body = {'bod', 'body', 'b'},
             't'
            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'},
            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'}
         },
         },
         duration = {
         duration = {
             instant = {'0', 'in', 'instant', 'i'},
             'dur',
            always = {'always', 'forever', '4', 'inf'},
             'duration',
            noLimit = {'noLimit', '1', 'nl'},
             'dr'
             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 = {
         upgrade = {
             warded = {'wrd', 'warded', 'w'},
             'upg',
             absolute = {'abs', 'absolute', 'a'}
            'upgrade',
             'u'
         },
         },
         executionTime = {
         executionTime = {
             freeAction = {'0a', 'freeAction', 'fa'},
             'executionTime',
            singleAction = {'1a', 'a', 'singleAction', 'sa'},
            'et',
             doubleAction = {'2a', 'doubleAction', 'da'},
            'x'
            tripleAction = {'3a', 'tripleAction', 'ta'},
        },
            freeReaction = {'0r', 'freeReaction', 'fr'},
        piercing = {
            reaction = {'1r', 'reaction', 'r'},
            'prc',
            shortRest = {'sr', 'shortRest', 's'},
            'piercing',
             longRest = {'lr', 'longRest', 'l'},
             'p'
             timeParse = {'^%d+[mhdwy]$'}
        },
        -- nearRange = {
        --    'nearRange',
        --    'nr'
        -- },
        -- farRange = {
        --    'farRange',
        --    'fr'
        -- },
        flaw = {
            'flaw',
            'fl',
            'f'
        },
        special = {
            'special',
             'sp',
             's'
         },
         },
        piercing = {av0 = {'av0', 'a'}, unblockable = {'ub', 'u'}},
         range = {
         range = {
             melee = {'melee', 'm'},
             'range',
            weapon = {'weapon', 'weaponReach', 'w'},
             'rng',
            hand = {'hand', 'handReach', 'h'},
             'r'
            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 = {
         attribute = {
             int = {'int', 'INT', 'i'},
             'attribute',
            str = {'str', 'STR', 's'},
             'attr',
            mov = {'mov', 'MOV', 'm'},
             'a'
            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 = {
         expansion = {
             detonate = {'det', 'detonate', 'd'},
             'expansion',
            ripple = {'rip', 'ripple', 'r'},
            'exp',
             cascade = {'cas', 'cascade', 'c'},
        },
            fork = {'for', 'fork', 'f'}
        expansionRange = {
            'expansionRange',
            'er'
        },
        expansionCount = {
            'expansionCount',
            'ec'
        },
        expansionAttribute = {
            'expansionAttribute',
             'ea'
        },
        sustained = {
            'sustained',
            'sus'
        },
        requirement = {
            'req',
            'requirement',
            'rq'
         },
         },
        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 = {
         verbal = {
             text = 'Verbal',
             'ver',
             link = 'Verbal component abilities',
             'verbal',
            symbol = '🗣️',
         },
            color = '#f9f06b',
            class = 'component-tagged verbal'
         }
    },
    somatic = {
         somatic = {
         somatic = {
             text = 'Somatic',
             'som',
             link = 'Somatic component abilities',
            'somatic',
             symbol = '👐',
        },
             color = '#f9f06b',
        material = {
             class = 'component-tagged somatic'
            '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',
         },
     },
     },
     material = {
     values = {
         material = {
         maneuver = {
             text = 'Material',
             active = {
             link = 'Material component abilities',
                'ac',
             symbol = '💎',
                'active',
             color = '#ff7800',
                'a'
            class = 'component-tagged material'
             },
        }
            reactive = {
    },
                're',
    magelore = {
                'reaction',
        magelore = {
                'r'
             text = 'Magelore',
            },
             link = 'Magelore component abilities',
             passive = {
             symbol = '🔮',
                'ps',
            color = '#f9f06b',
                'passive',
            class = 'component-tagged magelore'
                'p'
        }
            },
    },
             slow = {
    invoked = {
                'sl',
        invoked = {
                'slow',
             text = 'Invoked',
                's'
             link = 'Invoked component abilities',
            }
             symbol = '🪄',
        },
             color = '#f9f06b',
        interaction = {
             class = 'component-tagged invoked'
            attack = {
        }
                'atk',
    },
                'attack',
    flaw = {
                'a'
        flaw = {
             },
             text = 'Flaw',
            block = {
             link = 'Flaw abilities',
                'blk',
             symbol = '',
                'block',
             color = '#e01b24',
                'b'
             class = 'flaw-tagged flaw'
             },
        }
            manifest = {
    },
                'man',
    special = {
                'manifest',
        special = {
                'm'
             text = 'Special',
            },
             link = 'Special abilities',
             feat = {
             symbol = '✴️',
                'fea',
             color = '#9141AC',
                'feat',
            class = 'special-tagged special'
                'f'
        }
            }
    },
        },
    es = {
        delivery = {
        es = {
            self = {
             text = 'Elder Sorcery',
                'sel',
             link = 'Elder Sorcery abilities',
                'self',
             symbol = '🌌',
                's'
             color = '#9141AC',
            },
            class = 'elderSorcery-tagged elderSorcery'
             missile = {
        }
                'mis',
    },
                'missile',
    warded = {
                'm'
        warded = {
            },
             text = 'Warded',
             hand = {
             link = 'Warded abilities',
                'han',
             symbol = '🏮',
                'hand',
             color = '#f9f06b',
                'h',
             class = 'warded-tagged warded'
                'claw'
        }
            },
    },
             bite = {
    elements = {
                'bit',
        life = {
                'bite',
             text = 'Life',
                'b',
             link = 'Life element abilities',
                'mouth'
             symbol = '☀️',
            },
            color = '#ffffff',
             item = {
            class = 'element-tagged life'
                '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'
            },
            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',
            }
         },
         },
         storm = {
         duration = {
             text = 'Storm',
             instant = {
             link = 'Storm element abilities',
                '0',
             symbol = '💧',
                'in',
             color = '#3584e4',
                'instant',
             class = 'element-tagged storm'
                '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]$'
            }
         },
         },
         necro = {
         upgrade = {
             text = 'Necromancy',
             warded = {
            link = 'Necromancy element abilities',
                'wrd',
             symbol = '💀',
                'warded',
            color = '#3d3846',
                'w'
            class = 'element-tagged necromancy'
            },
             absolute = {
                'abs',
                'absolute',
                'a'
            }
         },
         },
         flame = {
         executionTime = {
             text = 'Flame',
             freeAction = {
             link = 'Flame element abilities',
                '0a',
             symbol = '🔥',
                'freeAction',
             color = '#e01b24',
                'fa'
             class = 'element-tagged flame'
             },
            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]$'
            }
         },
         },
         nature = {
         piercing = {
             text = 'Nature',
             av0 = {
            link = 'Nature element abilities',
                'av0',
            symbol = '🌱',
                'a'
             color = '#33d17a',
             },
             class = 'element-tagged nature'
             unblockable = {
        }
                'ub',
    },
                'u'
    class = {
             }
        ber = {
            text = 'Berserker',
            link = 'Berserker class abilities',
            symbol = '🪓',
             class = 'class-tagged berserker'
         },
         },
         due = {
         range = {
             text = 'Duelist',
             melee = {
             link = 'Duelist class abilities',
                'melee',
             symbol = '🤺',
                'm'
             class = 'class-tagged duelist'
            },
            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'
            }
         },
         },
         vet = {
         attribute = {
             text = 'Veteran',
             int = {
             link = 'Veteran class abilities',
                'int',
             symbol = '🪖',
                'INT',
             class = 'class-tagged veteran'
                'i'
            },
             str = {
                'str',
                'STR',
                's'
             },
            mov = {
                'mov',
                'MOV',
                'm'
             },
            per = {
                'per',
                'PER',
                'p'
            },
            snk = {
                'snk',
                'SNK',
                's'
            },
            unp = {
                'unp',
                'UNP',
                'u'
            },
         },
         },
         kni = {
         expansionAttribute = {
             text = 'Knight',
             int = {
             link = 'Knight class abilities',
                'int',
             symbol = '⚔️',
                'INT',
             class = 'class-tagged knight'
                'i'
            },
             str = {
                'str',
                'STR',
                's'
             },
            mov = {
                'mov',
                'MOV',
                'm'
             },
            per = {
                'per',
                'PER',
                'p'
            },
            snk = {
                'snk',
                'SNK',
                's'
            },
            unp = {
                'unp',
                'UNP',
                'u'
            },
         },
         },
         pal = {
         expansion = {
             text = 'Paladin',
             detonate = {
             link = 'Paladin class abilities',
                'det',
             symbol = '🛡️',
                'detonate',
             class = 'class-tagged paladin'
                'd'
            },
             ripple = {
                'rip',
                'ripple',
                'r'
            },
             cascade = {
                'cas',
                'cascade',
                'c'
            },
             fork = {
                'for',
                'fork',
                'f'
            }
         },
         },
         ass = {
         expansionRange = {
             text = 'Assassin',
             distParse = {
            link = 'Assassin class abilities',
                '^%d+[fm]$'
             symbol = '🗡️',
             }
            class = 'class-tagged assassin'
         },
         },
         cor = {
         expansionCount = {
             text = 'Corsair',
             expansionCount = {
            link = 'Corsair class abilities',
                'expansionCount',
            symbol = '🏴‍☠️',
                'ec',
             class = 'class-tagged corsair'
             }
         },
         },
         arc = {
         sustained = {
             text = 'Archer',
             sustained = {
             link = 'Archer class abilities',
                'sus',
            symbol = '🏹',
                'sustained',
            class = 'class-tagged archer'
                's',
                '1',
            }
        },
        verbal = {
             verbal = {
                'ver',
                'verbal',
                'v',
                '1',
            }
         },
         },
         thi = {
         somatic = {
             text = 'Thief',
             somatic = {
            link = 'Thief class abilities',
                'som',
            symbol = '💰️',
                'somatic',
            class = 'class-tagged thief'
                's',
                '1',
            }
         },
         },
         ran = {
         material = {
             text = 'Ranger',
             material = {
            link = 'Ranger class abilities',
                'mat',
            symbol = '🐾',
                'material',
            class = 'class-tagged ranger'
                'm',
                '1',
            }
         },
         },
         fla = {
         magelore = {
             text = 'Flame Mage',
             magelore = {
            link = 'Flame Mage class abilities',
                'mag',
            symbol = '🧙',
                'magelore',
            class = 'class-tagged flameMage'
                'ml',
                '1',
            }
         },
         },
         sto = {
         invoked = {
             text = 'Storm Mage',
             invoked = {
            link = 'Storm Mage class abilities',
                'inv',
            symbol = '🧙',
                'invoked',
            class = 'class-tagged stormMage'
                'i',
                '1',
            }
         },
         },
         lif = {
         class = {
             text = 'Life Mage',
             ber = {
             link = 'Life Mage class abilities',
                'ber',
             symbol = '🧙',
            },
             class = 'class-tagged lifeMage'
            due = {
        },
                'due',
        nec = {
             },
             text = 'Necromancer',
            vet = {
             link = 'Necromancer class abilities',
                'vet',
             symbol = '🧙',
             },
             class = 'class-tagged necromancer'
            kni = {
        },
                'kni',
        nat = {
             },
             text = 'Nature Mage',
            pal = {
             link = 'Nature Mage class abilities',
                'pal',
             symbol = '🧙',
            },
             class = 'class-tagged natureMage'
            ass = {
                'ass',
             },
            cor = {
                'cor',
             },
            arc = {
                'arc',
             },
            thi = {
                'thi',
             },
            ran = {
                'ran',
            },
            fla = {
                'fla',
             },
            sto = {
                'sto',
             },
            lif = {
                'lif',
             },
            nec = {
                'nec',
             },
            nat = {
                'nat',
            },
         }
         }
     },
     }
     power = {
}
         divine = {
 
             text = 'Divine',
local tags = {
             link = 'Divinely powered abilities',
     verbal = {
             symbol = '🪽',
         verbal = {
             text = 'Verbal',
             link = 'Verbal component abilities',
             symbol = '🗣️',
             color = '#f9f06b',
             color = '#f9f06b',
             class = 'power-tagged divine'
             class = 'component-tagged verbal'
         },
         },
         magic = {
    },
             text = 'Magical',
    somatic = {
             link = 'Magically powered abilities',
         somatic = {
             symbol = '',
             text = 'Somatic',
             color = '#9141ac',
             link = 'Somatic component abilities',
             class = 'power-tagged magical'
             symbol = '👐',
             color = '#f9f06b',
             class = 'component-tagged somatic'
         },
         },
        spirit = {
    },
            text = 'Spiritual',
    material = {
            link = 'Spiritually powered abilities',
         material = {
            symbol = '🪭',
             text = 'Material',
            color = '#9a9996',
             link = 'Material component abilities',
            class = 'power-tagged spiritual'
             symbol = '💎',
        },
         martial = {
             text = 'Martial',
             link = 'Martially powered abilities',
             symbol = '💪',
             color = '#ff7800',
             color = '#ff7800',
             class = 'power-tagged martial'
             class = 'component-tagged material'
         },
         },
         psionic = {
    },
             text = 'Psionic',
    magelore = {
             link = 'Psionically powered abilities',
         magelore = {
             symbol = '🤯',
             text = 'Magelore',
             color = '#3584e4',
             link = 'Magelore component abilities',
             class = 'power-tagged psionic'
             symbol = '🔮',
             color = '#f9f06b',
             class = 'component-tagged magelore'
         },
         },
         primal = {
    },
             text = 'Primal',
    invoked = {
             link = 'Primally powered abilities',
         invoked = {
             symbol = '⛰️',
             text = 'Invoked',
             color = '#986a44',
             link = 'Invoked component abilities',
             class = 'power-tagged primal'
             symbol = '🪄',
             color = '#f9f06b',
             class = 'component-tagged invoked'
         },
         },
         techo = {
    },
             text = 'Technological',
    flaw = {
             link = 'Technologically powered abilities',
         flaw = {
             symbol = '⚙️',
             text = 'Flaw',
             link = 'Flaw abilities',
             symbol = '',
             color = '#e01b24',
             color = '#e01b24',
             class = 'power-tagged technological'
             class = 'flaw-tagged flaw'
         },
         },
         finance = {
    },
             text = 'Financial',
    special = {
             link = 'Financially powered abilities',
         special = {
             symbol = '🪙',
             text = 'Special',
             color = '#fcc200',
             link = 'Special abilities',
             class = 'power-tagged financial'
             symbol = '✴️',
             color = '#9141AC',
             class = 'special-tagged special'
         },
         },
         alchemy = {
    },
             text = 'Alchemical',
    es = {
             link = 'Alchemically powered abilities',
         es = {
             symbol = '🧪',
             text = 'Elder Sorcery',
             color = '#33d17a',
             link = 'Elder Sorcery abilities',
             class = 'power-tagged alchemical'
             symbol = '🌌',
             color = '#9141AC',
             class = 'elderSorcery-tagged elderSorcery'
         },
         },
        unknown = {
            text = 'Unknown',
            link = 'Unknown powered abilities',
            symbol = '❓',
            color = '#77767b',
            class = 'power-tagged unknown'
        }
     },
     },
     category = {
     warded = {
         skill = {
         warded = {
             text = 'Skill',
             text = 'Warded',
             link = 'Skills',
             link = 'Warded abilities',
             symbol = '🤹',
             symbol = '🏮',
             class = 'skill'
            color = '#f9f06b',
             class = 'warded-tagged warded'
         },
         },
         spell = {
    },
             text = 'Spell',
    elements = {
             link = 'Spells',
         life = {
             symbol = '',
             text = 'Life',
             class = 'spell'
             link = 'Life element abilities',
             symbol = '☀️',
            color = '#ffffff',
             class = 'element-tagged life'
         },
         },
         semblant = {
         storm = {
             text = 'Semblant',
             text = 'Storm',
             link = 'Semblant skills',
             link = 'Storm element abilities',
             symbol = '🎭',
             symbol = '💧',
             class = 'standard-tagged semblant'
            color = '#3584e4',
             class = 'element-tagged storm'
         },
         },
         conjure = {
         necro = {
             text = 'Conjured',
             text = 'Necromancy',
             link = 'Conjured spells',
             link = 'Necromancy element abilities',
             symbol = '🔮',
             symbol = '💀',
             class = 'standard-tagged conjure'
            color = '#3d3846',
             class = 'element-tagged necromancy'
         },
         },
         standard = {
         flame = {
             text = 'Standard',
             text = 'Flame',
             link = 'Standard abilities',
             link = 'Flame element abilities',
             symbol = '🏁',
             symbol = '🔥',
             class = 'standard-tagged normal'
            color = '#e01b24',
            class = 'element-tagged flame'
        },
        nature = {
            text = 'Nature',
            link = 'Nature element abilities',
            symbol = '🌱',
            color = '#33d17a',
             class = 'element-tagged nature'
         },
         },
        rotator = {
            text = 'Rotator',
            link = 'Rotator abilities',
            symbol = '🔄',
            class = 'rotator'
        }
     },
     },
     effects = {
     class = {
         mental = {
         ber = {
             text = 'Mental',
             text = 'Berserker',
             link = 'Mental effects',
             link = 'Berserker class abilities',
             symbol = '🧠',
             symbol = '🪓',
             class = 'effect-tagged mental'
             class = 'class-tagged berserker'
         },
         },
         truth = {
         due = {
             text = 'Truth detecting',
             text = 'Duelist',
             link = 'Truth detecting effects',
             link = 'Duelist class abilities',
            symbol = '⚖️',
            class = 'effect-tagged truthDetecting'
        },
        duelMod = {
            text = 'Duel modifying',
            link = 'Duel modifying effects',
             symbol = '🤺',
             symbol = '🤺',
             class = 'effect-tagged duelModifying'
             class = 'class-tagged duelist'
         },
         },
         movement = {
         vet = {
             text = 'Movement',
             text = 'Veteran',
             link = 'Movement effects',
             link = 'Veteran class abilities',
             symbol = '👣',
             symbol = '🪖',
             class = 'effect-tagged movement'
             class = 'class-tagged veteran'
         },
         },
         poison = {
         kni = {
             text = 'Poison',
             text = 'Knight',
             link = 'Poison effects',
             link = 'Knight class abilities',
             symbol = '☠️',
             symbol = '⚔️',
             class = 'effect-tagged poison'
             class = 'class-tagged knight'
         },
         },
         displacement = {
         pal = {
             text = 'Displacement',
             text = 'Paladin',
             link = 'Displacement effects',
             link = 'Paladin class abilities',
             symbol = '🌀',
             symbol = '🛡️',
             class = 'effect-tagged displacement'
             class = 'class-tagged paladin'
         },
         },
         transformation = {
         ass = {
             text = 'Transformation',
             text = 'Assassin',
             link = 'Transformation effects',
             link = 'Assassin class abilities',
             symbol = '🌳',
             symbol = '🗡️',
             class = 'effect-tagged transformation'
             class = 'class-tagged assassin'
         },
         },
         control = {
         cor = {
             text = 'Control',
             text = 'Corsair',
             link = 'Control effects',
             link = 'Corsair class abilities',
             symbol = '⛓️',
             symbol = '🏴‍☠️',
             class = 'effect-tagged control'
             class = 'class-tagged corsair'
         },
         },
         resist = {
         arc = {
             text = 'Resistance',
             text = 'Archer',
             link = 'Resistance effects',
             link = 'Archer class abilities',
             symbol = '🚫',
             symbol = '🏹',
             class = 'effect-tagged resistance'
             class = 'class-tagged archer'
         },
         },
         awaken = {
         thi = {
             text = 'Awakening',
             text = 'Thief',
             link = 'Awakening effects',
             link = 'Thief class abilities',
             symbol = '🌞',
             symbol = '💰️',
             class = 'effect-tagged awakening'
             class = 'class-tagged thief'
         },
         },
         immune = {
         ran = {
             text = 'Immunity',
             text = 'Ranger',
             link = 'Immunity effects',
             link = 'Ranger class abilities',
             symbol = '🚫',
             symbol = '🐾',
             class = 'effect-tagged immunity'
             class = 'class-tagged ranger'
         },
         },
         long = {
         fla = {
             text = 'Long range',
             text = 'Flame Mage',
             link = 'Long range effects',
             link = 'Flame Mage class abilities',
             symbol = '📏',
             symbol = '🧙',
             class = 'effect-tagged longRange'
             class = 'class-tagged flameMage'
         },
         },
         sense = {
         sto = {
             text = 'Sensory',
             text = 'Storm Mage',
             link = 'Sensory effects',
             link = 'Storm Mage class abilities',
             symbol = '👁️',
             symbol = '🧙',
             class = 'effect-tagged sensory'
             class = 'class-tagged stormMage'
         },
         },
         revive = {
         lif = {
             text = 'Revival',
             text = 'Life Mage',
             link = 'Revival effects',
             link = 'Life Mage class abilities',
             symbol = '🤍',
             symbol = '🧙',
             class = 'effect-tagged revival'
             class = 'class-tagged lifeMage'
         },
         },
         summon = {
         nec = {
             text = 'Summoning',
             text = 'Necromancer',
             link = 'Summoning effects',
             link = 'Necromancer class abilities',
             symbol = '🖤',
             symbol = '🧙',
             class = 'effect-tagged summoning'
             class = 'class-tagged necromancer'
         },
         },
         heal = {
         nat = {
             text = 'Healing',
             text = 'Nature Mage',
             link = 'Healing effects',
             link = 'Nature Mage class abilities',
             symbol = '❤️',
             symbol = '🧙',
             class = 'effect-tagged healing'
             class = 'class-tagged natureMage'
         },
         },
         reanimate = {
    },
             text = 'Reanimation',
    power = {
             link = 'Reanimation effects',
         divine = {
             symbol = '🩶',
             text = 'Divine',
             class = 'effect-tagged reanimation'
             link = 'Divinely powered abilities',
             symbol = '🪽',
            color = '#f9f06b',
             class = 'power-tagged divine'
         },
         },
         regenerate = {
         magic = {
             text = 'Regeneration',
             text = 'Magical',
             link = 'Regeneration effects',
             link = 'Magically powered abilities',
             symbol = '💚',
             symbol = '✨',
             class = 'effect-tagged regeneration'
            color = '#9141ac',
             class = 'power-tagged magical'
         },
         },
         revitalize = {
         spirit = {
             text = 'Revitalization',
             text = 'Spiritual',
             link = 'Revitalization effects',
             link = 'Spiritually powered abilities',
             symbol = '🩵',
             symbol = '🪭',
             class = 'effect-tagged revitalization'
            color = '#9a9996',
             class = 'power-tagged spiritual'
         },
         },
         kill = {
         martial = {
             text = 'Killing',
             text = 'Martial',
             link = 'Killing effects',
             link = 'Martially powered abilities',
             symbol = '☠️',
             symbol = '💪',
             class = 'effect-tagged killing'
            color = '#ff7800',
             class = 'power-tagged martial'
         },
         },
         damage = {
         psionic = {
             text = 'Damaging',
             text = 'Psionic',
             link = 'Damaging effects',
             link = 'Psionically powered abilities',
             symbol = '💢',
             symbol = '🤯',
             class = 'effect-tagged damaging'
            color = '#3584e4',
             class = 'power-tagged psionic'
         },
         },
         steal = {
         primal = {
             text = 'Stealing',
             text = 'Primal',
             link = 'Stealing effects',
             link = 'Primally powered abilities',
             symbol = '💰',
             symbol = '⛰️',
             class = 'effect-tagged stealing'
            color = '#986a44',
             class = 'power-tagged primal'
         },
         },
         loud = {
         techo = {
             text = 'Loud',
             text = 'Technological',
             link = 'Loud effects',
             link = 'Technologically powered abilities',
             symbol = '🔊',
             symbol = '⚙️',
             class = 'effect-tagged loud'
            color = '#e01b24',
             class = 'power-tagged technological'
         },
         },
         knockout = {
         finance = {
             text = 'Knockout',
             text = 'Financial',
             link = 'Knockout effects',
             link = 'Financially powered abilities',
             symbol = '💤',
             symbol = '🪙',
             class = 'effect-tagged knockout'
            color = '#fcc200',
             class = 'power-tagged financial'
         },
         },
         time = {
         alchemy = {
             text = 'Temporal',
             text = 'Alchemical',
             link = 'Temporal effects',
             link = 'Alchemically powered abilities',
             symbol = '🕰️',
             symbol = '🧪',
            class = 'effect-tagged temporal'
             color = '#33d17a',
        }
             class = 'power-tagged alchemical'
    },
    pre = {
        strike = {
            text = 'Strike',
             link = 'Strike delivery abilities',
            symbol = '⚔️',
             class = 'deliveryPackage-tagged strike'
         },
         },
         ray = {
         unknown = {
             text = 'Ray',
             text = 'Unknown',
             link = 'Ray delivery abilities',
             link = 'Unknown powered abilities',
             symbol = '⚡️',
             symbol = '❓',
             class = 'deliveryPackage-tagged ray'
            color = '#77767b',
             class = 'power-tagged unknown'
         },
         },
         ball = {
    },
             text = 'Ball',
    category = {
             link = 'Ball delivery abilities',
         skill = {
             symbol = '🔥',
             text = 'Skill',
             class = 'deliveryPackage-tagged ball'
             link = 'Skills',
             symbol = '🤹',
             class = 'skill'
         },
         },
         aura = {
         spell = {
             text = 'Aura',
             text = 'Spell',
             link = 'Aura delivery abilities',
             link = 'Spells',
             symbol = '🌟',
             symbol = '',
             class = 'deliveryPackage-tagged aura'
             class = 'spell'
         },
         },
         ritual = {
         semblant = {
             text = 'Ritual',
             text = 'Semblant',
             link = 'Ritual delivery abilities',
             link = 'Semblant skills',
             symbol = '🕯️',
             symbol = '🎭',
             class = 'deliveryPackage-tagged ritual'
             class = 'standard-tagged semblant'
         },
         },
         touch = {
         conjure = {
             text = 'Touch',
             text = 'Conjured',
             link = 'Touch delivery abilities',
             link = 'Conjured spells',
             symbol = '👉️',
             symbol = '🔮',
             class = 'deliveryPackage-tagged touch'
             class = 'standard-tagged conjure'
        }
    },
    maneuver = {
        active = {
            text = 'Active',
            link = 'Active abilities',
            symbol = '➡️',
            class = 'maneuver-tagged active'
         },
         },
         reactive = {
         standard = {
             text = 'Reactive',
             text = 'Standard',
             link = 'Reactive abilities',
             link = 'Standard abilities',
             symbol = '↩️',
             symbol = '🏁',
             class = 'maneuver-tagged reactive'
             class = 'standard-tagged normal'
         },
         },
         passive = {
         rotator = {
             text = 'Passive',
             text = 'Rotator',
             link = 'Passive abilities',
             link = 'Rotator abilities',
             symbol = '🔁',
             symbol = '🔄',
             class = 'maneuver-tagged passive'
             class = 'rotator'
         },
         },
        slow = {
            text = 'Slow',
            link = 'Slow abilities',
            symbol = '🐢',
            class = 'maneuver-tagged slow'
        }
     },
     },
     interaction = {
     effects = {
         attack = {
         mental = {
             text = 'Attack',
             text = 'Mental',
             link = 'Attack abilities',
             link = 'Mental effects',
             symbol = '⚔️',
             symbol = '🧠',
            color = '#ff7800',
             class = 'effect-tagged mental'
             class = 'interaction-tagged attack'
         },
         },
         block = {
         truth = {
             text = 'Block',
             text = 'Truth detecting',
             link = 'Block abilities',
             link = 'Truth detecting effects',
             symbol = '🛡️',
             symbol = '⚖️',
            color = '#ff7800',
             class = 'effect-tagged truthDetecting'
             class = 'interaction-tagged block'
         },
         },
         manifest = {
         duelMod = {
             text = 'Manifest',
             text = 'Duel modifying',
             link = 'Manifest abilities',
             link = 'Duel modifying effects',
             symbol = '✳️',
             symbol = '🤺',
            color = '#ff7800',
             class = 'effect-tagged duelModifying'
             class = 'interaction-tagged manifest'
         },
         },
         feat = {
         movement = {
             text = 'Feat',
             text = 'Movement',
             link = 'Feat abilities',
             link = 'Movement effects',
             symbol = '🎖️',
             symbol = '👣',
            color = '#ff7800',
             class = 'effect-tagged movement'
            class = 'interaction-tagged feat'
        }
    },
    delivery = {
        self = {
            text = 'Self',
            link = 'Self delivery abilities',
            symbol = '🤲',
            color = '#f6d32d',
             class = 'delivery-tagged self'
         },
         },
         missile = {
         poison = {
             text = 'Missile',
             text = 'Poison',
             link = 'Missile delivery abilities',
             link = 'Poison effects',
             symbol = '🏹',
             symbol = '☠️',
            color = '#f6d32d',
             class = 'effect-tagged poison'
             class = 'delivery-tagged missile'
         },
         },
         hand = {
         displacement = {
             text = 'Hand',
             text = 'Displacement',
             link = 'Hand delivery abilities',
             link = 'Displacement effects',
             symbol = '🤚',
             symbol = '🌀',
            color = '#f6d32d',
             class = 'effect-tagged displacement'
             class = 'delivery-tagged hand'
         },
         },
         bite = {
         transformation = {
             text = 'Bite',
             text = 'Transformation',
             link = 'Bite delivery abilities',
             link = 'Transformation effects',
             symbol = '🦷',
             symbol = '🌳',
            color = '#f6d32d',
             class = 'effect-tagged transformation'
             class = 'delivery-tagged bite'
         },
         },
         item = {
         control = {
             text = 'Item',
             text = 'Control',
             link = 'Item delivery abilities',
             link = 'Control effects',
             symbol = '📦',
             symbol = '⛓️',
            color = '#f6d32d',
             class = 'effect-tagged control'
             class = 'delivery-tagged item'
         },
         },
         magelore = {
         resist = {
             text = 'Magelore',
             text = 'Resistance',
             link = 'Magelore delivery abilities',
             link = 'Resistance effects',
             symbol = '🔮',
             symbol = '🚫',
            color = '#f6d32d',
             class = 'effect-tagged resistance'
             class = 'delivery-tagged magelore'
         },
         },
         weapon = {
         awaken = {
             text = 'Weapon',
             text = 'Awakening',
             link = 'Weapon delivery abilities',
             link = 'Awakening effects',
             symbol = '🗡️',
             symbol = '🌞',
            color = '#f6d32d',
             class = 'effect-tagged awakening'
             class = 'delivery-tagged weapon'
         },
         },
         shield = {
         immune = {
             text = 'Shield',
             text = 'Immunity',
             link = 'Shield delivery abilities',
             link = 'Immunity effects',
             symbol = '🛡️',
             symbol = '🚫',
            color = '#f6d32d',
             class = 'effect-tagged immunity'
             class = 'delivery-tagged shield'
         },
         },
         armor = {
         long = {
             text = 'Armor',
             text = 'Long range',
             link = 'Armor delivery abilities',
             link = 'Long range effects',
             symbol = '🪖',
             symbol = '📏',
            color = '#f6d32d',
             class = 'effect-tagged longRange'
             class = 'delivery-tagged armor'
         },
         },
         sight = {
         sense = {
             text = 'Sight',
             text = 'Sensory',
             link = 'Sight delivery abilities',
             link = 'Sensory effects',
             symbol = '👁️',
             symbol = '👁️',
            color = '#f6d32d',
             class = 'effect-tagged sensory'
             class = 'delivery-tagged sight'
         },
         },
         aura = {
         revive = {
             text = 'Aura',
             text = 'Revival',
             link = 'Aura delivery abilities',
             link = 'Revival effects',
             symbol = '🌟',
             symbol = '🤍',
            color = '#f6d32d',
             class = 'effect-tagged revival'
             class = 'delivery-tagged aura'
         },
         },
         cone = {
         summon = {
             text = 'Cone',
             text = 'Summoning',
             link = 'Cone delivery abilities',
             link = 'Summoning effects',
             symbol = '🐲',
             symbol = '🖤',
            color = '#f6d32d',
             class = 'effect-tagged summoning'
             class = 'delivery-tagged cone'
         },
         },
         other = {
         heal = {
             text = 'Other',
             text = 'Healing',
             link = 'Other delivery abilities',
             link = 'Healing effects',
             symbol = '❓',
             symbol = '❤️',
            color = '#f6d32d',
             class = 'effect-tagged healing'
            class = 'delivery-tagged other'
        }
    },
    target = {
        self = {
            text = 'Self',
            link = 'Self target abilities',
            symbol = '🤲',
            color = '#f6d32d',
             class = 'target-tagged self'
         },
         },
         creature = {
         reanimate = {
             text = 'Creature',
             text = 'Reanimation',
             link = 'Creature target abilities',
             link = 'Reanimation effects',
             symbol = '👤',
             symbol = '🩶',
            color = '#f6d32d',
             class = 'effect-tagged reanimation'
             class = 'target-tagged creature'
         },
         },
         body = {
         regenerate = {
             text = 'Body',
             text = 'Regeneration',
             link = 'Body target abilities',
             link = 'Regeneration effects',
             symbol = '🧍',
             symbol = '💚',
            color = '#f6d32d',
             class = 'effect-tagged regeneration'
             class = 'target-tagged body'
         },
         },
         vitals = {
         revitalize = {
             text = 'Vitals',
             text = 'Revitalization',
             link = 'Vitals target abilities',
             link = 'Revitalization effects',
             symbol = '🫀',
             symbol = '🩵',
            color = '#f6d32d',
             class = 'effect-tagged revitalization'
             class = 'target-tagged vitals'
         },
         },
         limb = {
         kill = {
             text = 'Limb',
             text = 'Killing',
             link = 'Limb target abilities',
             link = 'Killing effects',
             symbol = '🦾',
             symbol = '☠️',
            color = '#f6d32d',
             class = 'effect-tagged killing'
             class = 'target-tagged limb'
         },
         },
         arm = {
         damage = {
             text = 'Arm',
             text = 'Damaging',
             link = 'Arm target abilities',
             link = 'Damaging effects',
             symbol = '💪',
             symbol = '💢',
            color = '#f6d32d',
             class = 'effect-tagged damaging'
             class = 'target-tagged arm'
         },
         },
         leg = {
         steal = {
             text = 'Leg',
             text = 'Stealing',
             link = 'Leg target abilities',
             link = 'Stealing effects',
             symbol = '🦵',
             symbol = '💰',
            color = '#f6d32d',
             class = 'effect-tagged stealing'
             class = 'target-tagged leg'
         },
         },
         item = {
         loud = {
             text = 'Item',
             text = 'Loud',
             link = 'Item target abilities',
             link = 'Loud effects',
             symbol = '📦',
             symbol = '🔊',
            color = '#f6d32d',
             class = 'effect-tagged loud'
             class = 'target-tagged item'
         },
         },
         weapon = {
         knockout = {
             text = 'Weapon',
             text = 'Knockout',
             link = 'Weapon target abilities',
             link = 'Knockout effects',
             symbol = '🗡️',
             symbol = '💤',
            color = '#f6d32d',
             class = 'effect-tagged knockout'
             class = 'target-tagged weapon'
         },
         },
         shield = {
         time = {
             text = 'Shield',
             text = 'Temporal',
             link = 'Shield target abilities',
             link = 'Temporal effects',
             symbol = '🛡️',
             symbol = '🕰️',
            color = '#f6d32d',
             class = 'effect-tagged temporal'
             class = 'target-tagged shield'
         },
         },
         armor = {
    },
             text = 'Armor',
    pre = {
             link = 'Armor target abilities',
         strike = {
             symbol = '🪖',
             text = 'Strike',
            color = '#f6d32d',
             link = 'Strike delivery abilities',
             class = 'target-tagged armor'
             symbol = '⚔️',
             class = 'deliveryPackage-tagged strike'
         },
         },
         ship = {
         ray = {
             text = 'Ship',
             text = 'Ray',
             link = 'Ship target abilities',
             link = 'Ray delivery abilities',
             symbol = '⛵️',
             symbol = '⚡️',
            color = '#f6d32d',
             class = 'deliveryPackage-tagged ray'
             class = 'target-tagged ship'
         },
         },
         attack = {
         ball = {
             text = 'Attack',
             text = 'Ball',
             link = 'Attack target abilities',
             link = 'Ball delivery abilities',
             symbol = '⚔️',
             symbol = '🔥',
            color = '#f6d32d',
             class = 'deliveryPackage-tagged ball'
             class = 'target-tagged attack'
         },
         },
         ability = {
         aura = {
             text = 'Ability',
             text = 'Aura',
             link = 'Ability target abilities',
             link = 'Aura delivery abilities',
             symbol = '🅰',
             symbol = '🌟',
            color = '#f6d32d',
             class = 'deliveryPackage-tagged aura'
             class = 'target-tagged ability'
         },
         },
         spell = {
         ritual = {
             text = 'Spell',
             text = 'Ritual',
             link = 'Spell target abilities',
             link = 'Ritual delivery abilities',
             symbol = '💫',
             symbol = '🕯️',
            color = '#f6d32d',
             class = 'deliveryPackage-tagged ritual'
             class = 'target-tagged spell'
         },
         },
         other = {
         touch = {
             text = 'Other',
             text = 'Touch',
             link = 'Other target abilities',
             link = 'Touch delivery abilities',
             symbol = '❓',
             symbol = '👉️',
            color = '#f6d32d',
             class = 'deliveryPackage-tagged touch'
            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'}},
        aci = {tags = {'area', 'creature', 'item'}},
        ac = {tags = {'area', 'creature'}},
        al = {tags = {'arm', 'leg'}},
        cs = {tags = {'creature', 'self'}}
     },
     },
     upgrade = {
     maneuver = {
         warded = {
         active = {
             text = 'Warded',
             text = 'Active',
             link = 'Warded abilities',
             link = 'Active abilities',
             class = 'upgrade-tagged warded'
            symbol = '➡️',
             class = 'maneuver-tagged active'
         },
         },
         absolute = {
         reactive = {
             text = 'Absolute',
             text = 'Reactive',
             link = 'Absolute abilities',
             link = 'Reactive abilities',
            class = 'upgrade-tagged absolute'
             symbol = '↩️',
        }
             class = 'maneuver-tagged reactive'
    },
    executionTime = {
        freeAction = {
            text = 'Free action',
             symbol = '0️⃣',
            link = 'Free action abilities',
             class = 'executionTime-tagged a0'
         },
         },
         singleAction = {
         passive = {
             text = 'Single action',
             text = 'Passive',
             symbol = '1️⃣',
             link = 'Passive abilities',
             link = 'Single action abilities',
             symbol = '🔁',
             class = 'executionTime-tagged a1'
             class = 'maneuver-tagged passive'
         },
         },
         doubleAction = {
         slow = {
             text = 'Double action',
             text = 'Slow',
             symbol = '2️⃣',
             link = 'Slow abilities',
             link = 'Double action abilities',
             symbol = '🐢',
             class = 'executionTime-tagged a2'
             class = 'maneuver-tagged slow'
         },
         },
         tripleAction = {
    },
             text = 'Triple action',
    interaction = {
             symbol = '3️⃣',
         attack = {
             link = 'Triple action abilities',
             text = 'Attack',
             class = 'executionTime-tagged a3'
            link = 'Attack abilities',
             symbol = '⚔️',
             color = '#ff7800',
             class = 'interaction-tagged attack'
         },
         },
         freeReaction = {
         block = {
             text = 'Free reaction',
             text = 'Block',
             symbol = '0️⃣',
            link = 'Block abilities',
             link = 'Free reaction abilities',
             symbol = '🛡️',
             class = 'executionTime-tagged r0'
             color = '#ff7800',
             class = 'interaction-tagged block'
         },
         },
         reaction = {
         manifest = {
             text = 'Reaction',
             text = 'Manifest',
             symbol = '1️⃣',
            link = 'Manifest abilities',
             link = 'Reaction abilities',
             symbol = '✳️',
             class = 'executionTime-tagged r1'
             color = '#ff7800',
             class = 'interaction-tagged manifest'
         },
         },
         shortRest = {
         feat = {
             text = 'Short rest',
             text = 'Feat',
            symbol = '🌙',
             link = 'Feat abilities',
             link = 'Short rest abilities',
             symbol = '🎖️',
            class = 'executionTime-tagged shortRest'
             color = '#ff7800',
        },
             class = 'interaction-tagged feat'
        longRest = {
         }
            text = 'Long rest',
     },
             symbol = '🌙',
     delivery = {
             link = 'Long rest abilities',
         self = {
             class = 'executionTime-tagged longRest'
             text = 'Self',
         }
             link = 'Self delivery abilities',
     },
             symbol = '🤲',
     piercing = {
             color = '#f6d32d',
         av0 = {
             class = 'delivery-tagged self'
             text = 'AV0',
             symbol = '🎯',
             link = 'AV0 abilities',
             color = '#33d17a',
             class = 'piercing-tagged av0'
         },
         },
         unblockable = {
         missile = {
             text = 'UB',
             text = 'Missile',
             symbol = '🪨',
             link = 'Missile delivery abilities',
             link = 'UB abilities',
             symbol = '🏹',
             color = '#33d17a',
             color = '#f6d32d',
             class = 'piercing-tagged ub'
             class = 'delivery-tagged missile'
        }
    },
    duration = {
        instant = {
            text = 'Instant',
            link = 'Instant duration abilities',
            no = true
         },
         },
         always = {
         hand = {
             text = 'Always active',
             text = 'Hand',
             link = 'Always active duration abilities',
             link = 'Hand delivery abilities',
             no = true
             symbol = '🤚',
            color = '#f6d32d',
            class = 'delivery-tagged hand'
         },
         },
         noLimit = {
         bite = {
             text = 'No limit',
             text = 'Bite',
             link = 'No limit duration abilities',
             link = 'Bite delivery abilities',
             no = true
             symbol = '🦷',
            color = '#f6d32d',
            class = 'delivery-tagged bite'
         },
         },
         whileUp = {
         item = {
             text = 'While up',
             text = 'Item',
             link = 'While up duration abilities',
             link = 'Item delivery abilities',
             no = true
             symbol = '📦',
            color = '#f6d32d',
            class = 'delivery-tagged item'
         },
         },
         whileDown = {
         magelore = {
             text = 'While down',
             text = 'Magelore',
             link = 'While down duration abilities',
             link = 'Magelore delivery abilities',
             no = true
             symbol = '🔮',
            color = '#f6d32d',
            class = 'delivery-tagged magelore'
         },
         },
         whileAlive = {
         weapon = {
             text = 'While alive',
             text = 'Weapon',
             link = 'While alive duration abilities',
             link = 'Weapon delivery abilities',
             no = true
             symbol = '🗡️',
            color = '#f6d32d',
            class = 'delivery-tagged weapon'
         },
         },
         whileDead = {
         shield = {
             text = 'While dead',
             text = 'Shield',
             link = 'While dead duration abilities',
             link = 'Shield delivery abilities',
             no = true
             symbol = '🛡️',
            color = '#f6d32d',
            class = 'delivery-tagged shield'
         },
         },
         endOfTurn = {
         armor = {
             text = 'Until the end of the turn',
             text = 'Armor',
             link = 'Until end of turn duration abilities',
             link = 'Armor delivery abilities',
             no = true
             symbol = '🪖',
            color = '#f6d32d',
            class = 'delivery-tagged armor'
         },
         },
         dawn = {
         sight = {
             text = 'Until dawn',
             text = 'Sight',
             link = 'Until dawn duration abilities',
             link = 'Sight delivery abilities',
             no = true
             symbol = '👁️',
            color = '#f6d32d',
            class = 'delivery-tagged sight'
         },
         },
         startOfTargetNextTurn = {
         aura = {
             text = 'Until the start of target\'s next turn',
             text = 'Aura',
             link = 'Until start of target\'s next turn duration abilities',
            link = 'Aura delivery abilities',
             no = true
             symbol = '🌟',
            color = '#f6d32d',
             class = 'delivery-tagged aura'
         },
         },
         endOfTargetNextTurn = {
         cone = {
             text = 'Until the end of target\'s next turn',
             text = 'Cone',
             link = 'Until end of target\'s next turn duration abilities',
            link = 'Cone delivery abilities',
             no = true
             symbol = '🐲',
            color = '#f6d32d',
             class = 'delivery-tagged cone'
         },
         },
         startOfYourNextTurn = {
         other = {
             text = 'Until the start of your next turn',
             text = 'Other',
             link = 'Until start of your next turn duration abilities',
             link = 'Other delivery abilities',
             no = true
             symbol = '',
        },
             color = '#f6d32d',
        endOfYourNextTurn = {
             class = 'delivery-tagged other'
            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 = {
     target = {
         melee = {
         self = {
             text = 'Your melee range',
             text = 'Self',
             -- link = 'Melee abilities',
             link = 'Self target abilities',
             no = true
             symbol = '🤲',
            color = '#f6d32d',
            class = 'target-tagged self'
         },
         },
         weapon = {
         creature = {
             text = 'Your weapon\'s range',
             text = 'Creature',
             -- link = 'Weapon range abilities',
             link = 'Creature target abilities',
             no = true
             symbol = '👤',
            color = '#f6d32d',
            class = 'target-tagged creature'
         },
         },
         hand = {
         body = {
             text = 'Your hand\'s range',
             text = 'Body',
             -- link = 'Hand range abilities',
             link = 'Body target abilities',
             no = true
             symbol = '🧍',
            color = '#f6d32d',
            class = 'target-tagged body'
         },
         },
         bite = {
         vitals = {
             text = 'Your bite\'s range',
             text = 'Vitals',
             -- link = 'Bite range abilities',
             link = 'Vitals target abilities',
             no = true
             symbol = '🫀',
            color = '#f6d32d',
            class = 'target-tagged vitals'
         },
         },
         item = {
         limb = {
             text = 'Your item\'s range',
             text = 'Limb',
             -- link = 'Item range abilities',
             link = 'Limb target abilities',
             no = true
             symbol = '🦾',
            color = '#f6d32d',
            class = 'target-tagged limb'
         },
         },
         shield = {
         arm = {
             text = 'Your shield\'s range',
             text = 'Arm',
             -- link = 'Shield range abilities',
             link = 'Arm target abilities',
             no = true
             symbol = '💪',
            color = '#f6d32d',
            class = 'target-tagged arm'
         },
         },
         armor = {
         leg = {
             text = 'Your armor\'s range',
             text = 'Leg',
             -- link = 'Armor range abilities',
             link = 'Leg target abilities',
            no = true
             symbol = '🦵',
        }
             color = '#f6d32d',
    },
             class = 'target-tagged leg'
    attribute = {
        int = {
            text = 'Intelligence',
             symbol = 'INT',
             link = 'INT save abilities',
             class = 'saveAttribute-tagged int'
         },
         },
         str = {
         item = {
             text = 'Strength',
             text = 'Item',
             symbol = 'STR',
            link = 'Item target abilities',
             link = 'STR save abilities',
             symbol = '📦',
             class = 'saveAttribute-tagged str'
             color = '#f6d32d',
             class = 'target-tagged item'
         },
         },
         mov = {
         weapon = {
             text = 'Movement',
             text = 'Weapon',
             symbol = 'MOV',
            link = 'Weapon target abilities',
             link = 'MOV save abilities',
             symbol = '🗡️',
             class = 'saveAttribute-tagged mov'
             color = '#f6d32d',
             class = 'target-tagged weapon'
         },
         },
         per = {
         shield = {
             text = 'Perception',
             text = 'Shield',
             symbol = 'PER',
            link = 'Shield target abilities',
             link = 'PER save abilities',
             symbol = '🛡️',
             class = 'saveAttribute-tagged per'
            color = '#f6d32d',
            class = 'target-tagged shield'
        },
        armor = {
            text = 'Armor',
             link = 'Armor target abilities',
            symbol = '🪖',
            color = '#f6d32d',
             class = 'target-tagged armor'
         },
         },
         snk = {
         ship = {
             text = 'Sneak',
             text = 'Ship',
             symbol = 'SNK',
            link = 'Ship target abilities',
             link = 'SNK save abilities',
             symbol = '⛵️',
             class = 'saveAttribute-tagged snk'
             color = '#f6d32d',
             class = 'target-tagged ship'
         },
         },
         unp = {
         attack = {
             text = 'Unused Presence',
             text = 'Attack',
            symbol = 'UNP',
             link = 'Attack target abilities',
             link = 'UNP save abilities',
             symbol = '⚔️',
            class = 'saveAttribute-tagged unp'
             color = '#f6d32d',
        }
             class = 'target-tagged attack'
    },
    expansionAttribute = {
        int = {
            text = 'Intelligence',
             symbol = 'INT',
             link = 'INT save abilities',
             class = 'expansionAttribute-tagged int'
         },
         },
         str = {
         ability = {
            text = 'Strength',
        text = 'Ability',
            symbol = 'STR',
        link = 'Ability target abilities',
            link = 'STR save abilities',
        symbol = '🅰',
             class = 'expansionAttribute-tagged str'
        color = '#f6d32d',
             class = 'target-tagged ability'
         },
         },
         mov = {
         spell = {
             text = 'Movement',
             text = 'Spell',
             symbol = 'MOV',
            link = 'Spell target abilities',
             link = 'MOV save abilities',
             symbol = '💫',
             class = 'expansionAttribute-tagged mov'
             color = '#f6d32d',
             class = 'target-tagged spell'
         },
         },
         per = {
         other = {
             text = 'Perception',
             text = 'Other',
             symbol = 'PER',
            link = 'Other target abilities',
             link = 'PER save abilities',
             symbol = '❓',
             class = 'expansionAttribute-tagged per'
            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'
            }
         },
         },
         snk = {
         aci = {
             text = 'Sneak',
             tags = {
            symbol = 'SNK',
                'area',
            link = 'SNK save abilities',
                'creature',
             class = 'expansionAttribute-tagged snk'
                'item',
             }
         },
         },
         unp = {
         ac = {
             text = 'Unused Presence',
             tags = {
            symbol = 'UNP',
                'area',
            link = 'UNP save abilities',
                'creature',
             class = 'expansionAttribute-tagged unp'
             }
        }
    },
    expansion = {
        detonate = {
            text = 'Detonate',
            symbol = '💥',
            link = 'Detonate expansion abilities',
            class = 'expansion-tagged detonate'
         },
         },
         ripple = {
         al = {
            text = 'Ripple',
        tags = {
            symbol = '🌊',
        'arm',
            link = 'Ripple expansion abilities',
        'leg',
            class = 'expansion-tagged ripple'
        }
         },
         },
         cascade = {
         cs = {
             text = 'Cascade',
             tags = {
            symbol = '',
                'creature',
            link = 'Cascade expansion abilities',
                'self',
             class = 'expansion-tagged cascade'
             }
         },
         },
        fork = {
            text = 'Fork',
            symbol = '🔱',
            link = 'Fork expansion abilities',
            class = 'expansion-tagged fork'
        }
     },
     },
     sustained = {
     upgrade = {
         sustained = {
         warded = {
             text = 'Sustained',
             text = 'Warded',
             symbol = '⏳️',
             link = 'Warded abilities',
             link = 'Sustained abilities',
            class = 'upgrade-tagged warded'
             class = 'sustained'
        },
        absolute = {
            text = 'Absolute',
             link = 'Absolute abilities',
             class = 'upgrade-tagged absolute'
         }
         }
    }
}
local premades = {
    strike = {
        maneuver = 'active',
        executionTime = '1a',
        interaction = 'attack',
        delivery = 'weapon',
        target = 'creature',
        duration = 'instant',
        range = 'weapon'
     },
     },
     ray = {
     executionTime = {
         maneuver = 'active',
         freeAction = {
        executionTime = '1a',
            text = 'Free action',
        interaction = 'attack',
            symbol = '0️⃣',
        delivery = 'missile',
            link = 'Free action abilities',
         target = 'creature',
            class = 'executionTime-tagged a0'
        duration = 'instant',
        },
        range = '60f',
         singleAction = {
        piercing = 'av0'
            text = 'Single action',
    },
            symbol = '1️⃣',
    ball = {
            link = 'Single action abilities',
        maneuver = 'active',
            class = 'executionTime-tagged a1'
        executionTime = '1a',
        },
        interaction = 'attack',
        doubleAction = {
        delivery = 'missile',
            text = 'Double action',
         target = 'creature',
            symbol = '2️⃣',
        duration = 'instant',
            link = 'Double action abilities',
        range = '30f',
            class = 'executionTime-tagged a2'
        piercing = 'ub'
        },
    },
         tripleAction = {
    aura = {
            text = 'Triple action',
        skip = true,
            symbol = '3️⃣',
        maneuver = 'active',
            link = 'Triple action abilities',
        executionTime = '1a',
            class = 'executionTime-tagged a3'
        interaction = 'feat',
        },
         delivery = 'aura',
        freeReaction = {
        target = 'creature',
            text = 'Free reaction',
        duration = 'instant',
            symbol = '0️⃣',
        range = '10f',
            link = 'Free reaction abilities',
        attribute = 'mov'
            class = 'executionTime-tagged r0'
    },
        },
    ritual = {
         reaction = {
        maneuver = 'slow',
            text = 'Reaction',
        executionTime = '10m',
            symbol = '1️⃣',
        interaction = 'manifest',
            link = 'Reaction abilities',
         delivery = 'sight',
            class = 'executionTime-tagged r1'
        target = 'creature',
        },
        duration = 'instant',
        shortRest = {
        range = '5f'
            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'
        }
     },
     },
     touch = {
     piercing = {
         maneuver = 'active',
         av0 = {
        executionTime = '1a',
            text = 'AV0',
        interaction = 'attack',
            symbol = '🎯',
         delivery = 'hand',
            link = 'AV0 abilities',
        target = 'creature',
            color = '#33d17a',
        duration = 'instant',
            class = 'piercing-tagged av0'
        range = 'hand',
        },
        piercing = 'ub'
         unblockable = {
            text = 'UB',
            symbol = '🪨',
            link = 'UB abilities',
            color = '#33d17a',
            class = 'piercing-tagged ub'
        }
     },
     },
     triumph = {
     duration = {
         skip = true,
         instant = {
        maneuver = 'reactive',
            text = 'Instant',
        executionTime = '0r',
            link = 'Instant duration abilities',
         interaction = 'manifest',
            no = true
         delivery = 'self',
         },
        target = 'self',
         always = {
        duration = 'instant',
            text = 'Always active',
        range = 'self'
            link = 'Always active duration abilities',
    },
            no = true
    self = {
        },
        skip = true,
        noLimit = {
        maneuver = 'active',
            text = 'No limit',
         executionTime = '1a',
            link = 'No limit duration abilities',
         interaction = 'man',
            no = true
        delivery = 'self',
         },
         target = 'self',
         whileUp = {
         duration = 'instant',
            text = 'While up',
        range = 'self'
            link = 'While up duration abilities',
    },
            no = true
    passive = {
         },
         skip = true,
         whileDown = {
         maneuver = 'passive',
            text = 'While down',
        interaction = 'man',
            link = 'While down duration abilities',
         delivery = 'self',
            no = true
         target = 'self',
         },
        duration = '4',
         whileAlive = {
        range = 'self'
            text = 'While alive',
    },
            link = 'While alive duration abilities',
    crown = {
            no = true
        skip = true,
         },
        maneuver = 'active',
         whileDead = {
         executionTime = '1a',
            text = 'While dead',
         interaction = 'man',
            link = 'While dead duration abilities',
        delivery = 'self',
            no = true
         target = 'self',
        },
         duration = '8h',
        endOfTurn = {
        range = 'self',
            text = 'Until the end of the turn',
        sustained = 'sus'
            link = 'Until end of turn duration abilities',
    }
            no = true
}
         },
 
         dawn = {
function noPlural(word)
            text = 'Until dawn',
    -- Common irregular plural forms
            link = 'Until dawn duration abilities',
    local irregulars = {
            no = true
        ["children"] = "child",
         },
        ["men"] = "man",
         startOfTargetNextTurn = {
        ["women"] = "woman",
            text = 'Until the start of target\'s next turn',
         ["feet"] = "foot",
            link = 'Until start of target\'s next turn duration abilities',
         ["teeth"] = "tooth",
            no = true
        ["mice"] = "mouse",
        },
        ["geese"] = "goose"
        endOfTargetNextTurn = {
    }
            text = 'Until the end of target\'s next turn',
 
            link = 'Until end of target\'s next turn duration abilities',
    -- Check for irregular forms
            no = true
    if irregulars[word] then return irregulars[word] end
         },
 
         startOfYourNextTurn = {
    -- Regular pluralization rules
            text = 'Until the start of your next turn',
    if word:match("ies$") then
            link = 'Until start of your next turn duration abilities',
        -- Change words ending in 'ies' to 'y' (e.g., "parties" -> "party")
            no = true
         return word:sub(1, -4) .. "y"
         },
    elseif word:match("ves$") then
        endOfYourNextTurn = {
        -- Change words ending in 'ves' to 'f' or 'fe' (e.g., "wolves" -> "wolf")
            text = 'Until the end of your next turn',
         return word:sub(1, -4) .. "f"
            link = 'Until end of your next turn duration abilities',
    elseif word:match("s$") and not word:match("ss$") then
            no = true
        -- Remove trailing 's' (e.g., "cats" -> "cat", but keep "boss")
         },
        return word:sub(1, -2)
        endOfCombat = {
    else
            text = 'Until the end of combat',
        -- Return the word unchanged if no pluralization rule applies
            link = 'Until end of combat duration abilities',
         return word
            no = true
     end
         }
end
     },
 
     range = {
local function addCategory(category, key, val, skill, spell, addCats, noLower)
         melee = {
     if addCats then
             text = 'Your melee range',
         if not noLower then category = category:lower() end
            -- link = 'Melee abilities',
        if tags[key] and tags[key][val] then
            no = true
             if tags[key][val].tags then
        },
                out = ''
        weapon = {
                for _, t in ipairs(tags[key][val].tags) do
             text = 'Your weapon\'s range',
                    out = out ..
            -- link = 'Weapon range abilities',
                              addCategory(category, key, t, skill, spell,
             no = true
                                          addCats, true)
         },
                end
         hand = {
                return out
             text = 'Your hand\'s range',
             else
            -- link = 'Hand range abilities',
                category = tags[key][val].link
             no = true
             end
         },
         end
         bite = {
         if skill then
             text = 'Your bite\'s range',
             skillCategory = category:gsub('ability', 'skill'):gsub('abilities',
            -- link = 'Bite range abilities',
                                                                  'skills')
             no = true
             skillCategory = skillCategory:gsub("^%l", string.upper)
         },
         end
         item = {
         if spell then
            text = 'Your item\'s range',
             spellCategory = category:gsub('ability', 'spell'):gsub('abilities',
             -- link = 'Item range abilities',
                                                                  'spells')
            no = true
             spellCategory = spellCategory:gsub("^%l", string.upper)
         },
         end
         shield = {
         category = category:gsub("^%l", string.upper)
             text = 'Your shield\'s range',
 
            -- link = 'Shield range abilities',
        local c = '[[Category:' .. tostring(category) .. ']]'
            no = true
        if skill then
        },
             c = c .. '[[Category:' .. tostring(skillCategory) .. ']]'
         armor = {
         end
             text = 'Your armor\'s range',
         if spell then
            -- link = 'Armor range abilities',
             c = c .. '[[Category:' .. tostring(spellCategory) .. ']]'
             no = true
        end
         },
        return c
     },
    else
     attribute = {
        return ''
         int = {
    end
            text = 'Intelligence',
end
            symbol = 'INT',
 
            link = 'INT save abilities',
local function makeTag(frame, key, value, makeCat, transparent)
             class = 'saveAttribute-tagged int'
    if not tags[key] or not tags[key][value] then
         },
         if value then
         str = {
            local out =
            text = 'Strength',
                frame:preprocess("{{ucfirst:" .. tostring(value) .. "}}")
            symbol = 'STR',
             if not ('.' == out:sub(-1)) then out = out .. '.' end
            link = 'STR save abilities',
             return out
            class = 'saveAttribute-tagged str'
         else
        },
            return ''
        mov = {
        end
            text = 'Movement',
     end
            symbol = 'MOV',
     local tag = tags[key][value]
            link = 'MOV save abilities',
    if tag.no then
            class = 'saveAttribute-tagged mov'
         local out = frame:preprocess("{{ucfirst:" .. tag.text .. "}}")
        },
        if not ('.' == out:sub(-1)) then out = out .. '.' end
         per = {
        return out
            text = 'Perception',
    end
             symbol = 'PER',
    if tag.tags then
            link = 'PER save abilities',
        local out = ''
             class = 'saveAttribute-tagged per'
        for _, t in ipairs(tag.tags) do
        },
             out = out .. makeTag(frame, key, t, makeCat, transparent)
        snk = {
         end
            text = 'Sneak',
         return out
             symbol = 'SNK',
    end
             link = 'SNK save abilities',
    local tagText = "{{Tag|{{ucfirst:" .. tag.text .. "}}"
             class = 'saveAttribute-tagged snk'
    if tag.symbol then tagText = tagText .. "|" .. tag.symbol end
        },
    if tag.link then
         unp = {
        tagText = tagText .. "|l=:Category:{{ucfirst:" .. tag.link .. "}}"
             text = 'Unused Presence',
    end
            symbol = 'UNP',
    if tag.color then tagText = tagText .. "|c=" .. tag.color end
             link = 'UNP save abilities',
    if tag.class then tagText = tagText .. "|class=" .. tag.class end
             class = 'saveAttribute-tagged unp'
    if transparent then tagText = tagText .. "|o=1" end
         },
    tagText = tagText .. "}}"
     },
    -- out = frame:preprocess(tagText)
     expansionAttribute = {
    out = tagText
         int = {
    return out
            text = 'Intelligence',
end
            symbol = 'INT',
 
            link = 'INT save abilities',
local function makeContent(frame, table, keys, makeCat)
            class = 'expansionAttribute-tagged int'
    local content = ''
        },
    local subContent = ''
        str = {
    local hasPre = false
            text = 'Strength',
    for _, key in ipairs(keys) do
             symbol = 'STR',
         if ('pre' == key and table['pre']) or
            link = 'STR save abilities',
             ('executionTime' == key and table['executionTime']) or
             class = 'expansionAttribute-tagged str'
             ('target' == key) or ('duration' == key) or
         },
             ('invoked' == key and table['invoked']) then
        mov = {
             hasPre = true
            text = 'Movement',
             content = content ..
            symbol = 'MOV',
                          frame:preprocess(
            link = 'MOV save abilities',
                              makeTag(frame, key, table[key], makeCat))
            class = 'expansionAttribute-tagged mov'
         else
        },
             if hasPre then
        per = {
                subContent = subContent ..
            text = 'Perception',
                                makeTag(frame, key, table[key], makeCat)
            symbol = 'PER',
             else
            link = 'PER save abilities',
                content = content ..
            class = 'expansionAttribute-tagged per'
                              frame:preprocess(
        },
                                  makeTag(frame, key, table[key], makeCat))
        snk = {
             end
            text = 'Sneak',
         end
            symbol = 'SNK',
     end
            link = 'SNK save abilities',
     if hasPre then
            class = 'expansionAttribute-tagged snk'
         content = content .. frame:preprocess('{{TagSub|' .. subContent .. '}}')
        },
        -- content = content .. '{{TagSub|' .. subContent .. '}}'
        unp = {
    end
            text = 'Unused Presence',
    if content == '' then
            symbol = 'UNP',
        for _, key in ipairs(keys) do
            link = 'UNP save abilities',
             if table[key] then
            class = 'expansionAttribute-tagged unp'
                content = frame:preprocess(
        },
                              '{{ucfirst:' .. content .. table[key] .. '}}')
     },
             end
     expansion = {
         end
         detonate = {
    end
            text = 'Detonate',
    return content
             symbol = '💥',
end
            link = 'Detonate expansion abilities',
 
            class = 'expansion-tagged detonate'
local function makeBar(frame, title, content, link, flags, bottom)
         },
    if content == '' then return '' end
        ripple = {
    local barSpace = mw.html.create('span')
            text = 'Ripple',
    barSpace:wikitext(frame:preprocess(' ')):css('display', 'none')
            symbol = '🌊',
    local barTitle = mw.html.create('span')
            link = 'Ripple expansion abilities',
    local barTitleClass = "{{lc:" .. title .. "}}"
            class = 'expansion-tagged ripple'
    barTitleClass = barTitleClass:gsub(' ', '-')
        },
    barTitleClass = barTitleClass:gsub('\'', '')
        cascade = {
    barTitleClass = barTitleClass:gsub('\"', '')
             text = 'Cascade',
    local barText = "{{ucfirst:" .. title .. "}}"
            symbol = '',
    if link then barText = "[[" .. link .. "|" .. barText .. "]]" end
            link = 'Cascade expansion abilities',
    barText = barText .. ":"
            class = 'expansion-tagged cascade'
    barTitle:addClass('ability-bar-title'):wikitext(frame:preprocess(barText))
        },
        :css('font-weight', 'bold'):css('margin-right', '0.5em')
        fork = {
    local barContent = mw.html.create('span')
            text = 'Fork',
    barContent:addClass('ability-bar-content'):wikitext(content)
            symbol = '🔱',
    local output = mw.html.create('div')
            link = 'Fork expansion abilities',
    if bottom then output = mw.html.create('span') end
            class = 'expansion-tagged fork'
     if not flags then flags = {} end
        }
     for k, v in pairs(flags) do
    },
         if type(v) == 'string' then
     sustained = {
             output:addClass('flag-' .. k .. '-' .. v)
        sustained = {
         end
            text = 'Sustained',
    end
            symbol = '⏳️',
    output:addClass('ability-bar'):addClass('ability-bar-' .. barTitleClass)
             link = 'Sustained abilities',
        :attr(flags):attr('test', 'out'):node(barSpace):node(barTitle):node(
             class = 'sustained'
             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 nonempty(v)
    if v == nil then return false end
    if type(v) ~= 'string' then return true end
    return mw.text.trim(v) ~= ''
end
 
local function resolveAlias(args, aliases)
     local resolved = {}
 
    -- Resolve keys
    for canonicalKey, keyAliasList in pairs(aliases.keys) do
        for _, alias in ipairs(keyAliasList) do
             local v = args[alias]
             if nonempty(v) then
                resolved[canonicalKey] = v
                break
            end
         end
     end


    -- Resolve values
local premades = {
     for canonicalKey, canonicalValueTable in pairs(aliases.values) do
     strike = {
         local rawValue = resolved[canonicalKey]
         maneuver = 'active',
 
         executionTime = '1a',
         -- Treat empty/whitespace as false
         interaction = 'attack',
         if rawValue ~= nil and not nonempty(rawValue) then
        delivery = 'weapon',
            resolved[canonicalKey] = false
         target = 'creature',
         elseif rawValue ~= nil then
        duration = 'instant',
            for canonicalValue, valueAliasList in pairs(canonicalValueTable) do
        range = 'weapon',
                for _, alias in ipairs(valueAliasList) do
    },
                    if rawValue == alias then
    ray = {
                        resolved[canonicalKey] = canonicalValue
        maneuver = 'active',
                        break
        executionTime = '1a',
                    elseif type(valueAliasList) == "table" and valueAliasList[1] and
        interaction = 'attack',
                        type(rawValue) == "string" and
        delivery = 'missile',
                        rawValue:match(valueAliasList[1]) then
        target = 'creature',
                        -- (keep your existing time/range parsing here unchanged)
        duration = 'instant',
                        if canonicalKey == "duration" or canonicalKey ==
        range = '60f',
                            "executionTime" then
        piercing = 'av0',
                            local num = tonumber(rawValue:match("^(%d+)"))
    },
                            local unit = rawValue:match("[%a]+$")
    ball = {
                            local unitMap = {
        maneuver = 'active',
                                m = "minute",
        executionTime = '1a',
                                h = "hour",
        interaction = 'attack',
                                d = "day",
        delivery = 'missile',
                                w = "week",
        target = 'creature',
                                y = "year",
         duration = 'instant',
                                r = "round",
        range = '30f',
                                s = "second"
        piercing = 'ub',
                            }
    },
                            resolved[canonicalKey] = unitMap[unit] and
    aura = {
                                                        (num .. " " ..
        skip = true,
                                                            unitMap[unit] ..
        maneuver = 'active',
                                                            (num > 1 and "s" or
        executionTime = '1a',
                                                                "")) or
        interaction = 'feat',
                                                        rawValue
        delivery = 'aura',
                        elseif canonicalKey == "range" or canonicalKey ==
        target = 'creature',
                            "expansionRange" then
        duration = 'instant',
                            local num = tonumber(rawValue:match("^(%d+)"))
        range = '10f',
                            local unit = rawValue:match("[%a]+$")
        attribute = 'mov',
                            local unitMap = {f = "feet", m = "miles"}
     },
                            resolved[canonicalKey] = unitMap[unit] and
    ritual = {
                                                        (num .. " " ..
        maneuver = 'slow',
                                                            unitMap[unit]) or
        executionTime = '10m',
                                                        rawValue
        interaction = 'manifest',
                        end
        delivery = 'sight',
                    end
        target = 'creature',
                end
        duration = 'instant',
            end
        range = '5f',
         end
    },
    end
    touch = {
 
        maneuver = 'active',
    return resolved
        executionTime = '1a',
end
        interaction = 'attack',
 
        delivery = 'hand',
local classFixes = {bar = 'ber', sam = 'due', ama = 'cor'}
        target = 'creature',
 
        duration = 'instant',
local classArchetypes = {
        range = 'hand',
    ber = 'warr',
        piercing = 'ub',
    due = 'warr',
     },
    vet = 'warr',
    triumph = {
    kni = 'warr',
        skip = true,
    pal = 'warr',
        maneuver = 'reactive',
    ass = 'semi',
        executionTime = '0r',
    cor = 'semi',
        interaction = 'manifest',
    arc = 'semi',
        delivery = 'self',
     thi = 'semi',
        target = 'self',
    ran = 'semi',
        duration = 'instant',
    fla = 'mage',
        range = 'self',
    sto = 'mage',
    },
    lif = 'mage',
    self = {
    nec = 'mage',
        skip = true,
    nat = 'mage'
        maneuver = 'active',
}
        executionTime = '1a',
 
        interaction = 'man',
local className = {
        delivery = 'self',
    ber = 'Berserker',
        target = 'self',
    due = 'Duelist',
        duration = 'instant',
    vet = 'Veteran',
        range = 'self',
    kni = 'Knight',
     },
    pal = 'Paladin',
     passive = {
    ass = 'Assassin',
        skip = true,
    cor = 'Corsair',
        maneuver = 'passive',
    arc = 'Archer',
         interaction = 'man',
     thi = 'Thief',
         delivery = 'self',
    ran = 'Ranger',
        target = 'self',
    fla = 'Flame Mage',
        duration = '4',
    sto = 'Storm Mage',
         range = 'self',
    lif = 'Life Mage',
     },
    nec = 'Necromancer',
     crown = {
    nat = 'Nature Mage'
        skip = true,
}
        maneuver = 'active',
 
        executionTime = '1a',
local archetypeName = {warr = 'Warrior', semi = 'Semi', mage = 'Mage'}
        interaction = 'man',
 
         delivery = 'self',
function p.a(frame)
         target = 'self',
 
        duration = '8h',
    makeCat = true
         range = 'self',
 
         sustained = 'sus',
    -- Figure out all the default values
    }
    -- Prefer parent args if invoked via a template
}
    local parent = frame:getParent()
 
    local rawArgs = parent and parent.args or frame.args
function noPlural(word)
 
    -- Common irregular plural forms
     -- Drop empty/whitespace-only values so "" behaves like false/nil
    local irregulars = {
     local args = {}
         ["children"] = "child",
    for k, v in pairs(rawArgs) do if nonempty(v) then args[k] = v end end
        ["men"] = "man",
    local resolved = {}
         ["women"] = "woman",
    if args['pre'] then
         ["feet"] = "foot",
         local toResolve = resolveAlias(premades[args['pre']], aliases)
         ["teeth"] = "tooth",
         for k, v in pairs(toResolve) do resolved[k] = v end
         ["mice"] = "mouse",
    end
         ["geese"] = "goose"
    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
    -- Check for irregular forms
         resolved['pre'] = nil
    if irregulars[word] then
     end
         return irregulars[word]
     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'] == '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' 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['expansionCount'] then
    -- Regular pluralization rules
         if resolved['expansionCount'] == '1' then
     if word:match("ies$") then
            resolved['expansionCount'] = '{{Space}}' ..
         -- Change words ending in 'ies' to 'y' (e.g., "parties" -> "party")
                                            resolved['expansionCount'] ..
        return word:sub(1, -4) .. "y"
                                            ' extra execution.'
    elseif word:match("ves$") then
         else
        -- Change words ending in 'ves' to 'f' or 'fe' (e.g., "wolves" -> "wolf")
            resolved['expansionCount'] = '{{Space}}' ..
        return word:sub(1, -4) .. "f"
                                            resolved['expansionCount'] ..
    elseif word:match("s$") and not word:match("ss$") then
                                            ' extra executions.'
         -- Remove trailing 's' (e.g., "cats" -> "cat", but keep "boss")
         end
        return word:sub(1, -2)
    else
        -- Return the word unchanged if no pluralization rule applies
         return word
     end
     end
end


     if resolved['invoked'] then
local function addCategory(category, key, val, skill, spell, addCats, noLower)
         resolved['verbal'] = 'verbal'
     if addCats then
         resolved['somatic'] = 'somatic'
        if not noLower then
         resolved['mage'] = 'magelore'
            category = category:lower()
    end
        end
 
        if tags[key] and tags[key][val] then
     local skill = false
            if tags[key][val].tags then
     local spell = false
                out = ''
    local standard = false
                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 class = nil
local function makeTag(frame, key, value, makeCat, transparent)
     local classFull = nil
     if not tags[key] or not tags[key][value] then
    local archetype = nil
        if value then
    local archetypeFull = nil
            local out = frame:preprocess("{{ucfirst:" .. tostring(value) .. "}}")
    local rank = nil
            if not ('.' == out:sub(-1)) then
    if args['class'] then
                out = out .. '.'
         class = args['class']
            end
         if classFixes[class] then class = classFixes[class] end
            return out
         else
            return ''
         end
     end
     end
     if args['class'] or args['arch'] then
     local tag = tags[key][value]
        archetype = classArchetypes[class]
    if tag.no then
        if args['arch'] then archetype = args['arch'] end
         local out = frame:preprocess("{{ucfirst:" .. tag.text .. "}}")
        classFull = className[class]
         if not ('.' == out:sub(-1)) then
        archetypeFull = archetypeName[archetype]
            out = out .. '.'
         standard = true
        end
         if archetype == 'warr' or archetype == 'semi' then skill = true end
        return out
        if archetype == 'mage' then spell = true end
     end
     end
     local costMP = nil
     if tag.tags then
     local costHP = nil
        local out = ''
     local costGP = nil
        for _, t in ipairs(tag.tags) do
     if args['pre'] == 'crown' then
            out = out .. makeTag(frame, key, t, makeCat, transparent)
         spell = true
        end
         costMP = '1'
        return out
        rank = '2'
     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
     end
     if args['rank'] then rank = args['rank'] end
     if tag.color then
 
         tagText = tagText .. "|c=" .. tag.color
    if args['skill'] then
        skill = true
         if args['skill'] == '0' or args['skill'] == 'false' then
            skill = false
        end
     end
     end
     if args['spell'] then
     if tag.class then
         spell = true
         tagText = tagText .. "|class=" .. tag.class
        if args['spell'] == '0' or args['spell'] == 'false' then
            spell = false
        end
     end
     end
     if args['standard'] then
     if transparent then
         standard = true
         tagText = tagText .. "|o=1"
        if args['standard'] == '0' or args['standard'] == 'false' then
            standard = false
        end
     end
     end
     if args['mp'] then costMP = args['mp'] end
     tagText = tagText .. "}}"
     if args['hp'] then costHP = args['hp'] end
     -- out = frame:preprocess(tagText)
     if args['gp'] then costGP = args['gp'] end
     out = tagText
     if args['shatter'] then costShatter = args['shatter'] end
     return out
 
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 function makeContent(frame, table, keys, makeCat)
     local c = ''
     local content = ''
 
     local subContent = ''
     local name = args['name']
     local hasPre = false
     local page = mw.title.getCurrentTitle().text
    for _, key in ipairs(keys) do
    local namespace = frame:preprocess('{{NAMESPACE}}')
        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 addCats = ((namespace == 'Ability') and (page == name))
            hasPre = true
    c = c .. addCategory('Abilities', nil, nil, skill, spell, addCats)
            content = content .. frame:preprocess(makeTag(frame, key, table[key], makeCat))
    if basic then
        else
        c = c ..
            if hasPre then
                 addCategory('Basic abilities', 'basic', nil, skill, spell,
                subContent = subContent .. makeTag(frame, key, table[key], makeCat)
                            addCats)
            else
                 content = content .. frame:preprocess(makeTag(frame, key, table[key], makeCat))
            end
        end
     end
     end
     if journeyman then
     if hasPre then
         c = c ..
         content = content .. frame:preprocess('{{TagSub|' .. subContent .. '}}')
                addCategory('Journeyman abilities', 'journeyman', nil, skill,
        -- content = content .. '{{TagSub|' .. subContent .. '}}'
                            spell, addCats)
     end
     end
     if standard then
     if content == '' then
         c = c ..
         for _, key in ipairs(keys) do
                addCategory('Standard abilities', nil, nil, false, false,
            if table[key] then
                            addCats)
                content = frame:preprocess('{{ucfirst:' .. content .. table[key] .. '}}')
        if skill then
            end
            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
         end
    else
        c = c ..
                addCategory('Nonstandard abilities', nil, nil, skill, spell,
                            addCats)
     end
     end
     if args['ethereal'] then
     return content
        c = c ..
end
                addCategory('Ethereal abilities', nil, nil, skill, spell,
 
                            addCats)
local function makeBar(frame, title, content, link, flags, bottom)
    if content == '' then
        return ''
     end
     end
     if args['av'] then
     local barSpace = mw.html.create('span')
         c = c ..
    barSpace
                addCategory('AV granting abilities', nil, nil, skill, spell,
         :wikitext(frame:preprocess(' '))
                            addCats, true)
        :css('display', 'none')
        c = c ..
    local barTitle = mw.html.create('span')
                addCategory('AV' .. args['av'] .. ' granting abilities', nil,
    local barTitleClass = "{{lc:" .. title .. "}}"
                            nil, skill, spell, addCats, true)
    barTitleClass = barTitleClass:gsub(' ', '-')
    barTitleClass = barTitleClass:gsub('\'', '')
    barTitleClass = barTitleClass:gsub('\"', '')
    local barText = "{{ucfirst:" .. title .. "}}"
    if link then
        barText = "[[" .. link .. "|" .. barText .. "]]"
     end
     end
     if (archetype and archetypeFull) then
     barText = barText .. ":"
         c = c ..
    barTitle
                addCategory(archetypeFull .. ' archetype abilities',
        :addClass('ability-bar-title')
                            'archetype', archetype, skill, spell, addCats)
        :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
     end
     if (class and classFull) then
     if not flags then
         c = c ..
         flags = {}
                addCategory(classFull .. ' class abilities', 'class', class,
                            skill, spell, addCats, true)
     end
     end
     if (rank and (class and classFull)) then
     for k, v in pairs(flags) do
         if rank == '3' then rank = '3+' end
         if type(v) == 'string' then
        c = c ..
            output:addClass('flag-' .. k .. '-' .. v)
                addCategory('Rank ' .. rank .. ' ' .. classFull .. ' abilities',
        end
                            'rank', rank, skill, spell, addCats, true)
     end
     end
     if resolved['pre'] then
     output
         c = c ..
         :addClass('ability-bar')
                addCategory(resolved['pre'] .. 'abilities', 'pre',
         :addClass('ability-bar-' .. barTitleClass)
                            resolved['pre'], skill, spell, addCats)
        :attr(flags)
    end
         :attr('test', 'out')
    if resolved['interaction'] then
        :node(barSpace)
         c = c ..
         :node(barTitle)
                addCategory(resolved['interaction'] .. ' interaction abilities',
         :node(barSpace)
                            'interaction', resolved['interaction'], skill,
        :node(barContent)
                            spell, addCats)
        :css('display', 'block')
    end
     -- if flags then
    if resolved['delivery'] then
        -- for k, v in ipairs(flags) do
         c = c ..
        --    output:attr(k, v)
                addCategory(resolved['delivery'] .. ' delivery abilities',
        -- end
                            '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
     -- end
     if resolved['expansion'] then
     return tostring(output)
        c = c ..
end
                 addCategory(resolved['expansion'] .. ' expansion abilities',
 
                            'expansion', resolved['expansion'], skill, spell,
local function resolveAlias(args, aliases)
                            addCats)
    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
     end
     -- if resolved['expansionRange'] then
 
     --    c = c .. addCategory(resolved['expansionRange'] .. ' expansion range abilities', 'expansionRange', resolved['expansionRange'], skill, spell, addCats)
     -- Resolve values
    -- end
     for canonicalKey, canonicalValueTable in pairs(aliases.values) do
    if resolved['attribute'] then
         local rawValue = resolved[canonicalKey]
         c = c ..
 
                addCategory(resolved['attribute'] .. ' save abilities',
        if rawValue then
                            'attribute', resolved['attribute'], skill, spell,
            for canonicalValue, valueAliasList in pairs(canonicalValueTable) do
                            addCats)
                for _, alias in ipairs(valueAliasList) do
    end
                    if rawValue == '' then
    if resolved['piercing'] then
                        resolved[canonicalKey] = false
        c = c .. addCategory(resolved['piercing'] .. ' abilities', 'piercing',
                        break
                            resolved['piercing'], skill, spell, addCats)
                    elseif rawValue == alias then
    end
                        resolved[canonicalKey] = canonicalValue
    if resolved['sustained'] then
                        break
        c = c ..
                    -- Handle patterns like timeParse or distParse
                addCategory('Sustained abilities', 'sustained',
                    elseif rawValue and type(valueAliasList) == "table" and valueAliasList[1] and rawValue:match(valueAliasList[1]) then
                            resolved['sustained'], skill, spell, addCats)
                        if canonicalKey == "duration" or canonicalKey == "executionTime" then
    end
                            -- Parse time duration (e.g., 5d -> "5 days")
    if resolved['upgrade'] then
                            local num = tonumber(rawValue:match("^(%d+)"))
        c = c ..
                            local unit = rawValue:match("[%a]+$")
                addCategory(resolved['upgrade'] .. ' abilities', 'upgrade',
                            local unitMap = {m = "minute", h = "hour", d = "day", w = "week", y = "year", r = "round", s = "second"}
                            resolved['upgrade'], skill, spell, addCats)
                            if unitMap[unit] then
    end
                                local parsedValue = num .. " " .. unitMap[unit] .. (num > 1 and "s" or "")
    if resolved['executionTime'] then
                                resolved[canonicalKey] = parsedValue
        c = c ..
                            else
                addCategory(
                                resolved[canonicalKey] = rawValue
                    noPlural(resolved['executionTime']) ..
                             end
                        ' execution time abilities', 'executionTime',
                        elseif canonicalKey == "range" or canonicalKey == "expansionRange" then
                    resolved['executionTime'], skill, spell, addCats)
                            -- Parse distance (e.g., 30f -> "30 feet")
    end
                            local num = tonumber(rawValue:match("^(%d+)"))
    if resolved['maneuver'] then
                             local unit = rawValue:match("[%a]+$")
        c = c .. addCategory(resolved['maneuver'] .. ' abilities', 'maneuver',
                            local unitMap = {f = "feet", m = "miles"}
                            resolved['maneuver'], skill, spell, addCats)
                            if unitMap[unit] then
    end
                                local parsedValue = num .. " " .. unitMap[unit]
    if resolved['verbal'] then
                                resolved[canonicalKey] = parsedValue
        c = c ..
                            else
                addCategory('Verbal component abilities', 'verbal',
                                resolved[canonicalKey] = rawValue
                             resolved['verbal'], skill, spell, addCats)
                            end
    end
                        end
    if resolved['somatic'] then
                    end
        c = c ..
                 end
                addCategory('Somatic component abilities', 'somatic',
            end
                             resolved['somatic'], skill, spell, addCats)
        end
    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 flawContent = ''
     return resolved
    if args['flaw'] or args['f'] or args['fl'] then
end
        flawContent = flawContent .. makeTag(frame, 'flaw', 'flaw', makeCat)
 
        c = c ..
local classFixes = {
                addCategory('Flaw abilities', 'flaw', 'flaw', skill, spell,
     bar = 'ber',
                            addCats)
     sam = 'due',
    end
     ama = 'cor'
    local specialContent = ''
}
     if args['special'] or args['s'] or args['sp'] then
        specialContent = specialContent ..
                            makeTag(frame, 'special', 'special', makeCat)
        c = c ..
                addCategory('Special abilities', 'special', 'special', skill,
                            spell, addCats)
     end
    local esContent = ''
    if args['es'] then
        esContent = esContent .. makeTag(frame, 'es', 'es', makeCat)
        c = c ..
                addCategory('Elder Sorcery abilities', 'es', 'es', skill, spell,
                            addCats)
     end
    local wardedContent = ''
    if args['warded'] then
        wardedContent = wardedContent ..
                            makeTag(frame, 'warded', 'warded', makeCat)
        c = c ..
                addCategory('Warded abilities', 'warded', 'warded', skill,
                            spell, addCats)
    end


    local elementContent = ''
local classArchetypes = {
     if args['life'] then
     ber = 'warr',
        elementContent = elementContent ..
    due = 'warr',
                            makeTag(frame, 'elements', 'life', makeCat)
    vet = 'warr',
        c = c ..
    kni = 'warr',
                addCategory('Life element abilities', 'elements', 'life', skill,
    pal = 'warr',
                            spell, addCats)
    ass = 'semi',
     end
     cor = 'semi',
    if args['storm'] then
    arc = 'semi',
        elementContent = elementContent ..
    thi = 'semi',
                            makeTag(frame, 'elements', 'storm', makeCat)
     ran = 'semi',
        c = c ..
    fla = 'mage',
                addCategory('Storm element abilities', 'elements', 'storm',
     sto = 'mage',
                            skill, spell, addCats)
    lif = 'mage',
    end
     nec = 'mage',
     if args['necro'] then
    nat = 'mage'
        elementContent = elementContent ..
}
                            makeTag(frame, 'elements', 'necro', makeCat)
        c = c ..
                addCategory('Necromancy element abilities', 'elements', 'necro',
                            skill, spell, addCats)
     end
    if args['flame'] then
        elementContent = elementContent ..
                            makeTag(frame, 'elements', 'flame', makeCat)
        c = c ..
                addCategory('Flame element abilities', 'elements', 'flame',
                            skill, spell, addCats)
     end
    if args['nature'] then
        elementContent = elementContent ..
                            makeTag(frame, 'elements', 'nature', makeCat)
        c = c ..
                addCategory('Nature element abilities', 'elements', 'nature',
                            skill, spell, addCats)
    end


     local powerContent = ''
local className = {
     if args['magic'] then
    ber = 'Berserker',
        powerContent = powerContent .. makeTag(frame, 'power', 'magic', makeCat)
    due = 'Duelist',
        c = c ..
    vet = 'Veteran',
                addCategory('Magically powered abilities', 'power', 'magic',
    kni = 'Knight',
                            skill, spell, addCats) ..
    pal = 'Paladin',
                addCategory('Magical effects', nil, nil, false, false, addCats)
    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
     end
     if args['divine'] then
     local userResolve = resolveAlias(args, aliases)
        powerContent = powerContent ..
    for k, v in pairs(userResolve) do
                          makeTag(frame, 'power', 'divine', makeCat)
         resolved[k] = v
         c = c ..
                addCategory('Divinely powered abilities', 'power', 'divine',
                            skill, spell, addCats) ..
                addCategory('Divine effects', nil, nil, false, false, addCats)
     end
     end
     if args['spirit'] then
     if resolved['pre'] and premades[args['pre']]['skip'] then
        powerContent = powerContent ..
         resolved['pre'] = nil
                          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'] then
        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['martial'] then
        powerContent = powerContent ..
                          makeTag(frame, 'power', 'martial', makeCat)
        c = c ..
                addCategory('Martially powered abilities', 'power', 'martial',
                            skill, spell, addCats)
    end
    if args['psionic'] then
        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['techo'] then
         powerContent = powerContent .. makeTag(frame, 'power', 'techo', makeCat)
        c = c ..
                addCategory('Technologically powered abilities', 'power',
                            'techo', skill, spell, addCats) ..
                addCategory('Technological effects', nil, nil, false, false,
                            addCats)
    end
    if args['finance'] then
        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['alchemy'] then
        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'] then
        powerContent = powerContent ..
                          makeTag(frame, 'power', 'unknown', makeCat)
        c = c ..
                addCategory('Unknown powered abilities', 'power', 'unknown',
                            skill, spell, addCats)
    end
    if class then
        classContent = makeContent(frame, resolved, {'class'}, makeCat)
        powerContent = powerContent .. classContent
     end
     end
     if args['rotator'] then
     if not resolved['duration'] then
         powerContent = powerContent ..
         resolved['duration'] = 'instant'
                          makeTag(frame, 'category', 'rotator', 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 deliveryContent = ''
     if resolved['interaction'] == 'attack' then
    if standard and skill then
        local dc = "Hit target's {{AC}}"
         deliveryContent = deliveryContent ..
        if resolved['target'] == 'limb' then
                              makeTag(frame, 'category', 'semblant', makeCat)
            dc = "Hit target's {{Var:ACLimb}}"
    end
        end
    if standard and spell then
        if resolved['target'] == 'arm' then
         deliveryContent = deliveryContent ..
            dc = "Hit target's {{Var:ACLimb}}"
                              makeTag(frame, 'category', 'conjure', makeCat)
        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' 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


     local effectContent = ''
     if resolved['expansionCount'] then
    if args['mental'] then
        if resolved['expansionCount'] == '1' then
        effectContent = effectContent ..
            resolved['expansionCount'] = '{{Space}}' .. resolved['expansionCount'] .. ' extra execution.'
                            makeTag(frame, 'effects', 'mental', makeCat)
         else
         c = c ..
            resolved['expansionCount'] = '{{Space}}' .. resolved['expansionCount'] .. ' extra executions.'
                addCategory('Mental effects', 'effect', 'mental', skill, spell,
        end
                            addCats)
     end
     end
     if args['truth'] then
 
         effectContent = effectContent ..
     if resolved['invoked'] then
                            makeTag(frame, 'effects', 'truth', makeCat)
         resolved['verbal'] = 'verbal'
         c = c ..
         resolved['somatic'] = 'somatic'
                addCategory('Truth detecting effects', 'effect',
        resolved['mage'] = 'magelore'
                            'truthDetecting', skill, spell, addCats)
     end
     end
     if args['duelMod'] then
 
         effectContent = effectContent ..
    local skill = false
                            makeTag(frame, 'effects', 'duelModifying', makeCat)
    local spell = false
         c = c ..
    local standard = false
                addCategory('Duel modifying effects', 'effect', 'duelModifying',
 
                            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['movement'] then
     if args['class'] or args['arch'] then
         effectContent = effectContent ..
         archetype = classArchetypes[class]
                            makeTag(frame, 'effects', 'movement', makeCat)
        if args['arch'] then
        c = c ..
            archetype = args['arch']
                addCategory('Movement effects', 'effect', 'movement', skill,
        end
                            spell, addCats)
        classFull = className[class]
    end
        archetypeFull = archetypeName[archetype]
    if args['poison'] then
         standard = true
         effectContent = effectContent ..
        if archetype == 'warr' or archetype == 'semi' then
                            makeTag(frame, 'effects', 'poison', makeCat)
            skill = true
         c = c ..
         end
                addCategory('Poison effects', 'effect', 'poison', skill, spell,
        if archetype == 'mage' then
                            addCats)
            spell = true
        end
     end
     end
     if args['displacement'] then
    local costMP = nil
         effectContent = effectContent ..
    local costHP = nil
                            makeTag(frame, 'effects', 'displacement', makeCat)
    local costGP = nil
         c = c ..
     if args['pre'] == 'crown' then
                addCategory('Displacement effects', 'effect', 'displacement',
         spell = true
                            skill, spell, addCats)
        costMP = '1'
         rank = '2'
     end
     end
     if args['transformation'] then
     if args['rank'] then
         effectContent = effectContent ..
         rank = args['rank']
                            makeTag(frame, 'effects', 'transformation', makeCat)
        c = c ..
                addCategory('Transformation effects', 'effect',
                            'transformation', skill, spell, addCats)
     end
     end
     if args['control'] then
   
         effectContent = effectContent ..
     if args['skill'] then
                            makeTag(frame, 'effects', 'control', makeCat)
         skill = true
        c = c ..
        if args['skill'] == '0' or args['skill'] == 'false' then
                addCategory('Control effects', 'effect', 'control', skill,
            skill = false
                            spell, addCats)
        end
     end
     end
     if args['resist'] then
     if args['spell'] then
         effectContent = effectContent ..
         spell = true
                            makeTag(frame, 'effects', 'resist', makeCat)
        if args['spell'] == '0' or args['spell'] == 'false' then
        c = c ..
            spell = false
                addCategory('Resistance effects', 'effect', 'resist', skill,
        end
                            spell, addCats)
     end
     end
     if args['awaken'] then
     if args['standard'] then
         effectContent = effectContent ..
         standard = true
                            makeTag(frame, 'effects', 'awaken', makeCat)
        if args['standard'] == '0' or args['standard'] == 'false' then
        c = c ..
            standard = false
                addCategory('Awakening effects', 'effect', 'awaken', skill,
        end
                            spell, addCats)
     end
     end
     if args['immune'] then
     if args['mp'] then
         effectContent = effectContent ..
         costMP = args['mp']
                            makeTag(frame, 'effects', 'immune', makeCat)
        c = c ..
                addCategory('Immunity effects', 'effect', 'immune', skill,
                            spell, addCats)
     end
     end
     if args['long'] then
     if args['hp'] then
         effectContent = effectContent ..
         costHP = args['hp']
                            makeTag(frame, 'effects', 'long', makeCat)
        c = c ..
                addCategory('Long range effects', 'effect', 'long', skill,
                            spell, addCats)
     end
     end
     if args['sense'] then
     if args['gp'] then
         effectContent = effectContent ..
         costGP = args['gp']
                            makeTag(frame, 'effects', 'sense', makeCat)
        c = c ..
                addCategory('Sensory effects', 'effect', 'sense', skill, spell,
                            addCats)
     end
     end
     if args['revive'] or args['rev'] then
     if args['shatter'] then
        effectContent = effectContent ..
    costShatter = args['shatter']
                            makeTag(frame, 'effects', 'revive', makeCat)
        c = c ..
                addCategory('Revival effects', 'effect', 'revive', skill, spell,
                            addCats)
     end
     end
     if args['summon'] then
 
         effectContent = effectContent ..
    local basic = false
                            makeTag(frame, 'effects', 'summon', makeCat)
    local journeyman = false
        c = c ..
     if args['basic'] then
                addCategory('Summoning effects', 'effect', 'summon', skill,
         basic = true
                            spell, addCats)
     end
     end
     if args['heal'] then
     if args['journeyman'] or args['jm'] then
        effectContent = effectContent ..
         journeyman = true
                            makeTag(frame, 'effects', 'heal', makeCat)
         c = c ..
                addCategory('Healing effects', 'effect', 'heal', skill, spell,
                            addCats)
     end
     end
     if args['reanimate'] or args['rean'] then
 
        effectContent = effectContent ..
    -- Category string
                            makeTag(frame, 'effects', 'reanimate', makeCat)
     local c = ''
         c = c ..
 
                addCategory('Reanimation effects', 'effect', 'reanimate', skill,
    local name = args['name']
                            spell, addCats)
    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 args['regenerate'] or args['regen'] then
     if journeyman then
        effectContent = effectContent ..
         c = c .. addCategory('Journeyman abilities', 'journeyman', nil, skill, spell, addCats)
                            makeTag(frame, 'effects', 'regenerate', makeCat)
         c = c ..
                addCategory('Regeneration effects', 'effect', 'regenerate',
                            skill, spell, addCats)
     end
     end
     if args['revitalize'] or args['revit'] then
     if standard then
         effectContent = effectContent ..
         c = c .. addCategory('Standard abilities', nil, nil, false, false, addCats)
                            makeTag(frame, 'effects', 'revitalize', makeCat)
         if skill then
         c = c ..
            c = c .. addCategory('Semblant skills', nil, nil, skill, spell, addCats)
                addCategory('Revitalization effects', 'effect', 'revitalize',
        end
                            skill, spell, addCats)
        if spell then
    end
            c = c .. addCategory('Conjured spells', nil, nil, skill, spell, addCats)
    if args['kill'] then
        end
        effectContent = effectContent ..
    else
                            makeTag(frame, 'effects', 'kill', makeCat)
         c = c .. addCategory('Nonstandard abilities', nil, nil, skill, spell, addCats)
         c = c ..
                addCategory('Killing effects', 'effect', 'kill', skill, spell,
                            addCats)
     end
     end
     if args['damage'] then
     if args['ethereal'] then
        effectContent = effectContent ..
         c = c .. addCategory('Ethereal abilities', nil, nil, skill, spell, addCats)
                            makeTag(frame, 'effects', 'damage', makeCat)
         c = c ..
                addCategory('Damaging effects', 'effect', 'damage', skill,
                            spell, addCats)
     end
     end
     if args['steal'] then
     if args['av'] then
        effectContent = effectContent ..
    c = c .. addCategory('AV granting abilities', nil, nil, skill, spell, addCats, true)
                            makeTag(frame, 'effects', 'steal', makeCat)
    c = c .. addCategory('AV' .. args['av'] .. ' granting abilities', nil, nil, skill, spell, addCats, true)
        c = c ..
                addCategory('Stealing effects', 'effect', 'steal', skill, spell,
                            addCats)
     end
     end
     if args['loud'] then
     if (archetype and archetypeFull) then
        effectContent = effectContent ..
         c = c .. addCategory(archetypeFull .. ' archetype abilities', 'archetype', archetype, skill, spell, addCats)
                            makeTag(frame, 'effects', 'loud', makeCat)
         c = c ..
                addCategory('Loud effects', 'effect', 'loud', skill, spell,
                            addCats)
     end
     end
     if args['knockout'] then
     if (class and classFull) then
        effectContent = effectContent ..
         c = c .. addCategory(classFull .. ' class abilities', 'class', class, skill, spell, addCats, true)
                            makeTag(frame, 'effects', 'knockout', makeCat)
         c = c ..
                addCategory('Knockout effects', 'effect', 'knockout', skill,
                            spell, addCats)
     end
     end
     if args['time'] then
     if (rank and (class and classFull)) then
        effectContent = effectContent ..
         if rank == '3' then
                            makeTag(frame, 'effects', 'time', makeCat)
             rank = '3+'
        c = c ..
                addCategory('Temporal effects', 'effect', 'time', skill, spell,
                            addCats)
    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
        c = c .. addCategory('Rank ' .. rank .. ' ' .. classFull .. ' abilities', 'rank', rank, skill, spell, addCats, true)
     end
     end
     if costHP then
     if resolved['pre'] then
         c = c ..
         c = c .. addCategory(resolved['pre'] .. 'abilities', 'pre', resolved['pre'], skill, spell, addCats)
                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
     end
     if costGP then
     if resolved['interaction'] then
         c = c ..
         c = c .. addCategory(resolved['interaction'] .. ' interaction abilities', 'interaction', resolved['interaction'], skill, spell, addCats)
                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
     end
     if costShatter then
     if resolved['delivery'] then
         c = c ..
         c = c .. addCategory(resolved['delivery'] .. ' delivery abilities', 'delivery', resolved['delivery'], skill, spell, addCats)
                addCategory('Shatter cost abilities', 'costShatter',
    end
                            costShatter, skill, spell, addCats)
    if resolved['target'] then
         costContent = costContent .. frame:preprocess(
         c = c .. addCategory(resolved['target'] .. ' target abilities', 'target', resolved['target'], skill, spell, addCats)
                          "{{Tag|Shatter|💥|l=:Category:Shatter cost abilities|class=cost-tagged shatter}}")
     end
     end
     if args['cost'] then
     if resolved['duration'] then
         costContent = costContent .. frame:preprocess(args['cost'])
         c = c .. addCategory(noPlural(resolved['duration']) .. ' duration abilities', 'duration', resolved['duration'], skill, spell, addCats)
     end
     end
 
     -- if resolved['range'] then
    local executionTimeTitle = 'Execution time'
     --    c = c .. addCategory(resolved['range'] .. ' range abilities', 'range', resolved['range'], skill, spell, addCats)
    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
     -- end
 
     if resolved['expansion'] then
    local heightenedContent = ''
         c = c .. addCategory(resolved['expansion'] .. ' expansion abilities', 'expansion', resolved['expansion'], skill, spell, addCats)
     if args['heightened'] then
         heightenedContent = heightenedContent ..
                                'For each additional {{L|Core|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
     end
 
    -- if resolved['expansionRange'] then
     local proficiencyContent = ''
     --    c = c .. addCategory(resolved['expansionRange'] .. ' expansion range abilities', 'expansionRange', resolved['expansionRange'], skill, spell, addCats)
     if args['pro'] then
    -- end
         proficiencyContent = proficiencyContent .. frame:preprocess(args['pro'])
     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
     end
 
     if resolved['sustained'] then
    local fluencyContent = ''
         c = c .. addCategory('Sustained abilities', 'sustained', resolved['sustained'], skill, spell, addCats)
     if args['flu'] then
         fluencyContent = fluencyContent .. frame:preprocess(args['flu'])
     end
     end
 
     if resolved['upgrade'] then
    local restrictionContent = ''
         c = c .. addCategory(resolved['upgrade'] .. ' abilities', 'upgrade', resolved['upgrade'], skill, spell, addCats)
     if args['restrict'] then
         restrictionContent = restrictionContent ..
                                frame:preprocess(args['restrict'])
     end
     end
 
     if resolved['executionTime'] then
    local statValContent = ''
         c = c .. addCategory(noPlural(resolved['executionTime']) .. ' execution time abilities', 'executionTime', resolved['executionTime'], skill, spell, addCats)
    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
     end
    local f = 'proficiency'
     if resolved['maneuver'] then
     if args['fflu'] then f = 'fluency' end
         c = c .. addCategory(resolved['maneuver'] .. ' abilities', 'maneuver', resolved['maneuver'], skill, spell, addCats)
    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
     end
     if args['rotator'] then
     if resolved['verbal'] then
         c = c ..
         c = c .. addCategory('Verbal component abilities', 'verbal', resolved['verbal'], skill, spell, addCats)
                addCategory('Rotator abilities', 'rotator', args['rotator'],
                            skill, spell, addCats)
     end
     end
     if args['style'] then
     if resolved['somatic'] then
         c = c ..
         c = c .. addCategory('Somatic component abilities', 'somatic', resolved['somatic'], skill, spell, addCats)
                addCategory('Casting style abilities', 'style', args['style'],
                            skill, spell, addCats)
     end
     end
     if args['weapon'] then
     if resolved['material'] then
         c = c ..
         c = c .. addCategory('Material component abilities', 'material', resolved['material'], skill, spell, addCats)
                addCategory('Weapon fighting style abilities', 'weapon',
                            args['weapon'], skill, spell, addCats)
     end
     end
 
     if resolved['magelore'] then
    -- Remove range from self targeted abilities
        c = c .. addCategory('Magelore component abilities', 'magelore', resolved['magelore'], skill, spell, addCats)
     if resolved['target'] == 'self' or resolved['range'] == 'self' then
    end
         resolved['range'] = nil
    if resolved['invoked'] then
         c = c .. addCategory('Invoke component abilities', 'invoked', resolved['invoked'], skill, spell, addCats)
     end
     end


     local barsTop = {
     local flawContent = ''
        -- {
    if args['flaw'] or args['f'] or args['fl'] then
         --    title = 'elements',
         flawContent = flawContent .. makeTag(frame, 'flaw', 'flaw', makeCat)
         --    content = frame:preprocess(elementContent)
         c = c .. addCategory('Flaw abilities', 'flaw', 'flaw', skill, spell, addCats)
        -- },
    end
         {
    local specialContent = ''
            title = 'power sources',
    if args['special'] or args['s'] or args['sp'] then
            content = frame:preprocess(esContent .. powerContent),
         specialContent = specialContent .. makeTag(frame, 'special', 'special', makeCat)
            link = ':Category:Powered abilities'
        c = c .. addCategory('Special abilities', 'special', 'special', skill, spell, addCats)
         }, {
    end
            title = 'effect types',
    local esContent = ''
            content = frame:preprocess(flawContent .. specialContent ..
    if args['es'] then
                                          effectContent),
         esContent = esContent .. makeTag(frame, 'es', 'es', makeCat)
            link = ':Category:Effects'
        c = c .. addCategory('Elder Sorcery abilities', 'es', 'es', skill, spell, addCats)
         }, {
    end
            title = 'delivery',
    local wardedContent = ''
            content = frame:preprocess(wardedContent .. deliveryContent) ..
    if args['warded'] then
                makeContent(frame, resolved, {
         wardedContent = wardedContent .. makeTag(frame, 'warded', 'warded', makeCat)
                    'expansion', 'pre', 'upgrade', 'piercing', 'delivery',
        c = c .. addCategory('Warded abilities', 'warded', 'warded', skill, spell, addCats)
                    'interaction'
    end
                }, makeCat),
 
            link = ':Category:Delivery abilities'
    local elementContent = ''
        }, {
    if args['life'] then
            title = 'save attribute',
        elementContent = elementContent .. makeTag(frame, 'elements', 'life', makeCat)
            content = makeContent(frame, resolved, {'attribute'}, makeCat),
        c = c .. addCategory('Life element abilities', 'elements', 'life', skill, spell, addCats)
            link = 'Core:Feat Interaction'
    end
        }, {
    if args['storm'] then
            title = 'expansion save attribute',
        elementContent = elementContent .. makeTag(frame, 'elements', 'storm', makeCat)
            content = makeContent(frame, resolved, {'expansionAttribute'},
        c = c .. addCategory('Storm element abilities', 'elements', 'storm', skill, spell, addCats)
                                  makeCat)
    end
         }, {
    if args['necro'] then
            title = 'target',
        elementContent = elementContent .. makeTag(frame, 'elements', 'necro', makeCat)
            content = makeContent(frame, resolved, {'target', 'hitDC'}, makeCat),
        c = c .. addCategory('Necromancy element abilities', 'elements', 'necro', skill, spell, addCats)
            link = ':Category:Target abilities'
    end
        }, {
    if args['flame'] then
            title = executionTimeTitle,
        elementContent = elementContent .. makeTag(frame, 'elements', 'flame', makeCat)
            content = makeContent(frame, resolved,
         c = c .. addCategory('Flame element abilities', 'elements', 'flame', skill, spell, addCats)
                                  {'executionTime', 'maneuver'}, makeCat),
    end
            link = 'Core:Maneuvers'
    if args['nature'] then
        }, {
        elementContent = elementContent .. makeTag(frame, 'elements', 'nature', makeCat)
            title = 'trigger',
        c = c .. addCategory('Nature element abilities', 'elements', 'nature', skill, spell, addCats)
            content = args['trigger'] or '',
    end
            link = 'Core:Reactive Maneuvers'
 
        }, {
    local powerContent = ''
            title = 'cost and components',
    if args['magic'] then
            content = frame:preprocess(costContent) ..
        powerContent = powerContent .. makeTag(frame, 'power', 'magic', makeCat)
                makeContent(frame, resolved, {
        c = c .. addCategory('Magically powered abilities', 'power', 'magic', skill, spell, addCats) .. addCategory('Magical effects', nil, nil, false, false, addCats)
                    'material', 'invoked', 'verbal', 'somatic', 'magelore'
    end
                }, makeCat),
    if args['divine'] then
            link = ':Category:Cost abilities'
        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)
            title = 'Mana cost',
    end
            content = args['mpx'] or '',
    if args['spirit'] then
            link = ':Category:MP cost abilities'
        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)
            title = 'Hit cost',
    end
            content = args['hpx'] or '',
    if args['primal'] then
            link = ':Category:HP cost abilities'
        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)
            title = 'Gold cost',
    end
            content = args['gpx'] or '',
    if args['martial'] then
            link = ':Category:GP cost abilities'
        powerContent = powerContent .. makeTag(frame, 'power', 'martial', makeCat)
        }, {
        c = c .. addCategory('Martially powered abilities', 'power', 'martial', skill, spell, addCats)
            title = 'Material cost',
    end
            content = makeContent(frame, resolved, {'matx'}, makeCat),
    if args['psionic'] then
            link = ':Category:Material component abilities'
        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)
            title = 'duration',
    end
            content = makeContent(frame, resolved, {'duration', 'sustained'},
    if args['techo'] then
                                  makeCat),
        powerContent = powerContent .. makeTag(frame, 'power', 'techo', makeCat)
            link = ':Category:Duration abilities'
        c = c .. addCategory('Technologically powered abilities', 'power', 'techo', skill, spell, addCats) .. addCategory('Technological effects', nil, nil, false, false, addCats)
        }, {
    end
            title = 'range',
    if args['finance'] then
            content = makeContent(frame, resolved, {'range'}, makeCat),
        powerContent = powerContent .. makeTag(frame, 'power', 'finance', makeCat)
            link = 'Core:Range'
        c = c .. addCategory('Financially powered abilities', 'power', 'finance', skill, spell, addCats) .. addCategory('Financial effects', nil, nil, false, false, addCats)
        }, -- {
    end
        --    title = 'expansion',
    if args['alchemy'] then
         --    content = makeContent(frame, resolved, {'expansion'}, makeCat)
        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
            title = 'expansion range',
    if args['unknown'] then
            content = makeContent(frame, resolved,
        powerContent = powerContent .. makeTag(frame, 'power', 'unknown', makeCat)
                                  {'expansionRange', 'expansionCount'}, makeCat),
        c = c .. addCategory('Unknown powered abilities', 'power', 'unknown', skill, spell, addCats)
            link = 'Core:Expansions'
    end
        }, -- {
    if class then
         --    title = 'expansion count',
         classContent = makeContent(frame, resolved, {'class'}, makeCat)
         --    content = frame:preprocess('TEST')
         powerContent = powerContent .. classContent
        -- },
    end
        {
    if args['rotator'] then
            title = 'Requirements',
        powerContent = powerContent .. makeTag(frame, 'category', 'rotator', makeCat)
            content = makeContent(frame, resolved, {'requirement'}, 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 barsBottom = {
    local effectContent = ''
         {title = 'End condition', content = args['end'] or ''},
    if args['mental'] then
         {title = 'On critical hit', content = args['crithit'] or ''},
        effectContent = effectContent .. makeTag(frame, 'effects', 'mental', makeCat)
         {title = 'On hit', content = args['hit'] or ''},
        c = c .. addCategory('Mental effects', 'effect', 'mental', skill, spell, addCats)
         {title = 'On miss', content = args['miss'] or ''},
    end
         {title = 'On critically miss', content = args['critmiss'] or ''},
    if args['truth'] then
         {title = 'On critical fail', content = args['critfail'] or ''},
        effectContent = effectContent .. makeTag(frame, 'effects', 'truth', makeCat)
         {title = 'On fail', content = args['fail'] or ''},
        c = c .. addCategory('Truth detecting effects', 'effect', 'truthDetecting', skill, spell, addCats)
         {title = 'On success', content = args['success'] or ''},
    end
         {title = 'On critical success', content = args['critsuccess'] or ''}, {
    if args['duelMod'] then
             title = 'Heightened',
        effectContent = effectContent .. makeTag(frame, 'effects', 'duelModifying', makeCat)
             content = frame:preprocess(heightenedContent),
        c = c .. addCategory('Duel modifying effects', 'effect', 'duelModifying', skill, spell, addCats)
             link = ':Category:Heightened abilities'
    end
         }, {
    if args['movement'] then
             title = 'If proficient',
        effectContent = effectContent .. makeTag(frame, 'effects', 'movement', makeCat)
             content = proficiencyContent,
        c = c .. addCategory('Movement effects', 'effect', 'movement', skill, spell, addCats)
             link = 'Core:Proficiency Bonus'
    end
         },
    if args['poison'] then
         {
        effectContent = effectContent .. makeTag(frame, 'effects', 'poison', makeCat)
        c = c .. addCategory('Poison effects', 'effect', 'poison', skill, spell, addCats)
    end
    if args['displacement'] then
        effectContent = effectContent .. makeTag(frame, 'effects', 'displacement', makeCat)
        c = c .. addCategory('Displacement effects', 'effect', 'displacement', skill, spell, addCats)
    end
    if args['transformation'] then
        effectContent = effectContent .. makeTag(frame, 'effects', 'transformation', makeCat)
        c = c .. addCategory('Transformation effects', 'effect', 'transformation', skill, spell, addCats)
    end
    if args['control'] then
        effectContent = effectContent .. makeTag(frame, 'effects', 'control', makeCat)
        c = c .. addCategory('Control effects', 'effect', 'control', skill, spell, addCats)
    end
    if args['resist'] then
        effectContent = effectContent .. makeTag(frame, 'effects', 'resist', makeCat)
        c = c .. addCategory('Resistance effects', 'effect', 'resist', skill, spell, addCats)
    end
    if args['awaken'] then
        effectContent = effectContent .. makeTag(frame, 'effects', 'awaken', makeCat)
        c = c .. addCategory('Awakening effects', 'effect', 'awaken', skill, spell, addCats)
    end
    if args['immune'] then
        effectContent = effectContent .. makeTag(frame, 'effects', 'immune', makeCat)
        c = c .. addCategory('Immunity effects', 'effect', 'immune', skill, spell, addCats)
    end
    if args['long'] then
        effectContent = effectContent .. makeTag(frame, 'effects', 'long', makeCat)
        c = c .. addCategory('Long range effects', 'effect', 'long', skill, spell, addCats)
    end
    if args['sense'] then
        effectContent = effectContent .. makeTag(frame, 'effects', 'sense', makeCat)
        c = c .. addCategory('Sensory effects', 'effect', 'sense', skill, spell, addCats)
    end
    if 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 args['summon'] then
        effectContent = effectContent .. makeTag(frame, 'effects', 'summon', makeCat)
        c = c .. addCategory('Summoning effects', 'effect', 'summon', skill, spell, addCats)
    end
    if args['heal'] then
        effectContent = effectContent .. makeTag(frame, 'effects', 'heal', makeCat)
        c = c .. addCategory('Healing effects', 'effect', 'heal', skill, spell, addCats)
    end
    if 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 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 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 args['kill'] then
        effectContent = effectContent .. makeTag(frame, 'effects', 'kill', makeCat)
        c = c .. addCategory('Killing effects', 'effect', 'kill', skill, spell, addCats)
    end
    if args['damage'] then
        effectContent = effectContent .. makeTag(frame, 'effects', 'damage', makeCat)
        c = c .. addCategory('Damaging effects', 'effect', 'damage', skill, spell, addCats)
    end
    if args['steal'] then
        effectContent = effectContent .. makeTag(frame, 'effects', 'steal', makeCat)
        c = c .. addCategory('Stealing effects', 'effect', 'steal', skill, spell, addCats)
    end
    if args['loud'] then
        effectContent = effectContent .. makeTag(frame, 'effects', 'loud', makeCat)
        c = c .. addCategory('Loud effects', 'effect', 'loud', skill, spell, addCats)
    end
    if args['knockout'] then
        effectContent = effectContent .. makeTag(frame, 'effects', 'knockout', makeCat)
        c = c .. addCategory('Knockout effects', 'effect', 'knockout', skill, spell, addCats)
    end
    if args['time'] then
        effectContent = effectContent .. makeTag(frame, 'effects', 'time', makeCat)
        c = c .. addCategory('Temporal effects', 'effect', 'time', skill, spell, addCats)
    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'] then
        heightenedContent = heightenedContent .. 'For each additional {{L|Core|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'] then
        c = c .. addCategory('Rotator abilities', 'rotator', args['rotator'], 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 '',
            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', 'expansionCount'}, makeCat),
            link = 'Core:Expansions'
        },
        -- {
        --    title = 'expansion count',
        --    content = frame:preprocess('TEST')
        -- },
        {
            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',
             title = 'If fluent',
             content = fluencyContent,
             content = fluencyContent,
             link = 'Core:Fluency Bonus'
             link = 'Core:Fluency Bonus'
         }, {
         },
             title = 'Attribute improvement',
        {
             content = frame:preprocess(statValContent),
             title = 'Attribute improvement',
             link = 'Core:Attributes',
             content = frame:preprocess(statValContent),
             flags = {
             link = 'Core:Attributes',
                 attribute = args['vstat'] and
             flags = {
                    frame:preprocess('{{lc:' .. args['vstat'] .. '}}') or "",
                 attribute = args['vstat'] and frame:preprocess('{{lc:' .. args['vstat'] .. '}}') or "",
                 value = args['val']
                 value = args['val']
             }
             }
         }, {
         },
             title = 'Feat save improvement',
        {
             content = frame:preprocess(statFeatContent),
             title = 'Feat save improvement',
             link = 'Core:Feat Interaction',
             content = frame:preprocess(statFeatContent),
             flags = {
             link = 'Core:Feat Interaction',
                 attribute = args['fstat'] and
             flags = {
                    frame:preprocess('{{lc:' .. args['fstat'] .. '}}'),
                 attribute = args['fstat'] and frame:preprocess('{{lc:' .. args['fstat'] .. '}}'),
                 value = f
                 value = f
             }
             }
         }
         },
     }
     }
 
 
     local outputTop = ''
     local outputTop = ''
     for _, bar in ipairs(barsTop) do
     for _, bar in ipairs(barsTop) do
         outputTop = outputTop ..
         outputTop = outputTop .. makeBar(frame, bar['title'], bar['content'], bar['link'], bar['flags'], false)
                        makeBar(frame, bar['title'], bar['content'],
    end
                                bar['link'], bar['flags'], false)
    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
     end
    local outputBottom = ''


     for _, bar in ipairs(barsBottom) do
     if outputBottom ~= '' then
         outputBottom = outputBottom ..
         output
                          makeBar(frame, bar['title'], bar['content'],
            :wikitext('<hr>')
                                  bar['link'], bar['flags'], true)
            :wikitext(outputBottom)
     end
     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 = tostring(output) .. c
     output = output ..
     output = output .. frame:preprocess('<templatestyles src="Template:Ability/styles.css" />')
                frame:preprocess(
                    '<templatestyles src="Template:Ability/styles.css" />')
     if not name then
     if not name then
         output = output ..
         output = output .. '<span style="color: red;>NO NAME PROVIDED VERY BAD EVERY ABILITY NEEDS A NAME OKAY</span>'
                    '<span style="color: red;>NO NAME PROVIDED VERY BAD EVERY ABILITY NEEDS A NAME OKAY</span>'
     end
     end



Revision as of 04:51, 13 August 2025

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'
            },
            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',
            }
        },
        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 component 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'
        },
        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'
        },
    },
    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'
        },
        techo = {
            text = 'Technological',
            link = 'Technologically powered abilities',
            symbol = '⚙️',
            color = '#e01b24',
            class = 'power-tagged technological'
        },
        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'
        },
    },
    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'
        },
        duelMod = {
            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'
        },
        control = {
            text = 'Control',
            link = 'Control effects',
            symbol = '⛓️',
            class = 'effect-tagged control'
        },
        resist = {
            text = 'Resistance',
            link = 'Resistance effects',
            symbol = '🚫',
            class = 'effect-tagged resistance'
        },
        awaken = {
            text = 'Awakening',
            link = 'Awakening effects',
            symbol = '🌞',
            class = 'effect-tagged awakening'
        },
        immune = {
            text = 'Immunity',
            link = 'Immunity effects',
            symbol = '🚫',
            class = 'effect-tagged immunity'
        },
        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'
        },
        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'
        },
    },
    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'
            }
        },
        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 weapon\'s range',
            -- link = 'Weapon range abilities',
            no = true
        },
        hand = {
            text = 'Your hand\'s range',
            -- link = 'Hand range abilities',
            no = true
        },
        bite = {
            text = 'Your bite\'s range',
            -- link = 'Bite range abilities',
            no = true
        },
        item = {
            text = 'Your item\'s range',
            -- link = 'Item range abilities',
            no = true
        },
        shield = {
            text = 'Your shield\'s range',
            -- link = 'Shield range abilities',
            no = true
        },
        armor = {
            text = 'Your 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 = "{{lc:" .. title .. "}}"
    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 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'] == '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' 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'] then
        costMP = args['mp']
    end
    if args['hp'] then
        costHP = args['hp']
    end
    if args['gp'] then
        costGP = args['gp']
    end
    if 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
    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 component 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'] then
        specialContent = specialContent .. makeTag(frame, 'special', 'special', makeCat)
        c = c .. addCategory('Special abilities', 'special', 'special', skill, spell, addCats)
    end
    local esContent = ''
    if args['es'] then
        esContent = esContent .. makeTag(frame, 'es', 'es', makeCat)
        c = c .. addCategory('Elder Sorcery abilities', 'es', 'es', skill, spell, addCats)
    end
    local wardedContent = ''
    if args['warded'] then
        wardedContent = wardedContent .. makeTag(frame, 'warded', 'warded', makeCat)
        c = c .. addCategory('Warded abilities', 'warded', 'warded', skill, spell, addCats)
    end

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

    local powerContent = ''
    if args['magic'] then
        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'] then
        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'] then
        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'] then
        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['martial'] then
        powerContent = powerContent .. makeTag(frame, 'power', 'martial', makeCat)
        c = c .. addCategory('Martially powered abilities', 'power', 'martial', skill, spell, addCats)
    end
    if args['psionic'] then
        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['techo'] then
        powerContent = powerContent .. makeTag(frame, 'power', 'techo', makeCat)
        c = c .. addCategory('Technologically powered abilities', 'power', 'techo', skill, spell, addCats) .. addCategory('Technological effects', nil, nil, false, false, addCats)
    end
    if args['finance'] then
        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['alchemy'] then
        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'] then
        powerContent = powerContent .. makeTag(frame, 'power', 'unknown', makeCat)
        c = c .. addCategory('Unknown powered abilities', 'power', 'unknown', skill, spell, addCats)
    end
    if class then
        classContent = makeContent(frame, resolved, {'class'}, makeCat)
        powerContent = powerContent .. classContent
    end
    if args['rotator'] then
        powerContent = powerContent .. makeTag(frame, 'category', 'rotator', 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 args['mental'] then
        effectContent = effectContent .. makeTag(frame, 'effects', 'mental', makeCat)
        c = c .. addCategory('Mental effects', 'effect', 'mental', skill, spell, addCats)
    end
    if args['truth'] then
        effectContent = effectContent .. makeTag(frame, 'effects', 'truth', makeCat)
        c = c .. addCategory('Truth detecting effects', 'effect', 'truthDetecting', skill, spell, addCats)
    end
    if args['duelMod'] then
        effectContent = effectContent .. makeTag(frame, 'effects', 'duelModifying', makeCat)
        c = c .. addCategory('Duel modifying effects', 'effect', 'duelModifying', skill, spell, addCats)
    end
    if args['movement'] then
        effectContent = effectContent .. makeTag(frame, 'effects', 'movement', makeCat)
        c = c .. addCategory('Movement effects', 'effect', 'movement', skill, spell, addCats)
    end
    if args['poison'] then
        effectContent = effectContent .. makeTag(frame, 'effects', 'poison', makeCat)
        c = c .. addCategory('Poison effects', 'effect', 'poison', skill, spell, addCats)
    end
    if args['displacement'] then
        effectContent = effectContent .. makeTag(frame, 'effects', 'displacement', makeCat)
        c = c .. addCategory('Displacement effects', 'effect', 'displacement', skill, spell, addCats)
    end
    if args['transformation'] then
        effectContent = effectContent .. makeTag(frame, 'effects', 'transformation', makeCat)
        c = c .. addCategory('Transformation effects', 'effect', 'transformation', skill, spell, addCats)
    end
    if args['control'] then
        effectContent = effectContent .. makeTag(frame, 'effects', 'control', makeCat)
        c = c .. addCategory('Control effects', 'effect', 'control', skill, spell, addCats)
    end
    if args['resist'] then
        effectContent = effectContent .. makeTag(frame, 'effects', 'resist', makeCat)
        c = c .. addCategory('Resistance effects', 'effect', 'resist', skill, spell, addCats)
    end
    if args['awaken'] then
        effectContent = effectContent .. makeTag(frame, 'effects', 'awaken', makeCat)
        c = c .. addCategory('Awakening effects', 'effect', 'awaken', skill, spell, addCats)
    end
    if args['immune'] then
        effectContent = effectContent .. makeTag(frame, 'effects', 'immune', makeCat)
        c = c .. addCategory('Immunity effects', 'effect', 'immune', skill, spell, addCats)
    end
    if args['long'] then
        effectContent = effectContent .. makeTag(frame, 'effects', 'long', makeCat)
        c = c .. addCategory('Long range effects', 'effect', 'long', skill, spell, addCats)
    end
    if args['sense'] then
        effectContent = effectContent .. makeTag(frame, 'effects', 'sense', makeCat)
        c = c .. addCategory('Sensory effects', 'effect', 'sense', skill, spell, addCats)
    end
    if 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 args['summon'] then
        effectContent = effectContent .. makeTag(frame, 'effects', 'summon', makeCat)
        c = c .. addCategory('Summoning effects', 'effect', 'summon', skill, spell, addCats)
    end
    if args['heal'] then
        effectContent = effectContent .. makeTag(frame, 'effects', 'heal', makeCat)
        c = c .. addCategory('Healing effects', 'effect', 'heal', skill, spell, addCats)
    end
    if 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 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 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 args['kill'] then
        effectContent = effectContent .. makeTag(frame, 'effects', 'kill', makeCat)
        c = c .. addCategory('Killing effects', 'effect', 'kill', skill, spell, addCats)
    end
    if args['damage'] then
        effectContent = effectContent .. makeTag(frame, 'effects', 'damage', makeCat)
        c = c .. addCategory('Damaging effects', 'effect', 'damage', skill, spell, addCats)
    end
    if args['steal'] then
        effectContent = effectContent .. makeTag(frame, 'effects', 'steal', makeCat)
        c = c .. addCategory('Stealing effects', 'effect', 'steal', skill, spell, addCats)
    end
    if args['loud'] then
        effectContent = effectContent .. makeTag(frame, 'effects', 'loud', makeCat)
        c = c .. addCategory('Loud effects', 'effect', 'loud', skill, spell, addCats)
    end
    if args['knockout'] then
        effectContent = effectContent .. makeTag(frame, 'effects', 'knockout', makeCat)
        c = c .. addCategory('Knockout effects', 'effect', 'knockout', skill, spell, addCats)
    end
    if args['time'] then
        effectContent = effectContent .. makeTag(frame, 'effects', 'time', makeCat)
        c = c .. addCategory('Temporal effects', 'effect', 'time', skill, spell, addCats)
    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'] then
        heightenedContent = heightenedContent .. 'For each additional {{L|Core|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'] then
        c = c .. addCategory('Rotator abilities', 'rotator', args['rotator'], 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 '',
            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', 'expansionCount'}, makeCat),
            link = 'Core:Expansions'
        },
        -- {
        --     title = 'expansion count',
        --     content = frame:preprocess('TEST')
        -- },
        {
            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