User:Irismus/Sandbox

Added aghshard to Module:Ability local symbol = require( 'Module:Symbol' )._main local symbol_aghs = symbol({ 'Aghanim' }) local symbol_tal = symbol({ 'Talent' }) local symbol_aghshard = symbol({ 'aghshard' }) local getArgs = require( 'Module:Arguments' ).getArgs local p = {}

-- Implements the mechanics symbols in the header. function p.symbols(frame) local args = getArgs(frame, {   wrappers = {      'Template:Ability'    }  }) local default_size = '20px' local symbols = {} if args['oncastproc'] then table.insert( symbols, symbol({ 'on cast proc', size=default_size }) ) end if args['rootdisables'] then table.insert( symbols, symbol({ 'root', args['rootdisables'], size=default_size }) ) end if args['illusionuse'] then table.insert( symbols, symbol({ 'illusion', args['illusionuse'], size=default_size }) ) end if args['disjointable'] then table.insert( symbols, symbol({ 'disjoint', args['disjointable'], size=default_size }) ) end if args['breakable'] then table.insert( symbols, symbol({ 'break', args['breakable'], size=default_size }) ) end if args['linkenblock'] then table.insert( symbols, symbol({ 'linken', args['linkenblock'], size=default_size }) ) end if args['bkbblock'] then table.insert( symbols, symbol({ 'bkb', args['bkbblock'], size=default_size }) ) end return table.concat( symbols, ' ' ) .. ' ' end

function p.target(frame) local args = getArgs(frame, {   wrappers = {      'Template:Ability'    }  }) local target_dict = { ["No Target"] = 'No Target', ["Target Unit"] = 'Target Unit', ["Target Point"] = 'Target Point', ["Target Area"] = 'Target Area', ["Passive"] = 'Passive', ["Aura"] = 'Aura', ["Toggle"] = 'Toggle', } local target2_dict = { ["No Target"] = ' / No Target', ["No Target aghs"] = ' (' .. symbol_aghs .. ' No Target )', ["No Target tal"] = ' (' .. symbol_tal .. ' No Target)', ["No Target aghshard"] = ' (' .. symbol_aghshard .. ' No Target )', ["Target Unit"] = ' / Target Unit', ["Target Unit aghs"] = ' (' .. symbol_aghs .. ' Target Unit )', ["Target Unit tal"] = ' (' .. symbol_tal .. ' Target Unit)', ["Target Unit aghshard"] = ' (' .. symbol_aghshard .. ' Target Unit )', ["Target Point"] = ' / Target Point', ["Target Point aghs"] = ' (' .. symbol_aghs .. ' Target Point )', ["Target Point tal"] = ' (' .. symbol_tal .. ' Target Point)', ["Target Point aghshard"] = ' (' .. symbol_aghshard .. ' Target Point )', ["Target Area"] = ' / Target Area', ["Target Area aghs"] = ' (' .. symbol_aghs .. ' Target Area )', ["Target Area tal"] = ' (' .. symbol_tal .. ' Target Area)', ["Target Area aghshard"] = ' (' .. symbol_aghshard .. ' Target Area )', ["Passive"] = ' / Passive', ["Passive aghs"] = ' (' .. symbol_aghs .. ' Passive )', ["Passive tal"] = ' (' .. symbol_tal .. ' Passive)', ["Passive aghshard"] = ' (' .. symbol_aghshard .. ' Passive )', ["Aura"] = ' / Aura', ["Aura aghs"] = ' (' .. symbol_aghs .. ' Aura )', ["Aura tal"] = ' (' .. symbol_tal .. ' Aura)', ["Aura aghshard"] = ' (' .. symbol_aghshard .. ' Aura )', ["Channeled"] = ' / Channeled', -- Should always be 2nd. ["Channeled aghs"] = ' (' .. symbol_aghs .. ' Channeled )', ["Channeled tal"] = ' (' .. symbol_tal .. ' Channeled)', ["Channeled aghshard"] = ' (' .. symbol_aghshard .. ' Channeled )', ["Autocast"] = ' / Autocast', --Should always be 2nd. ["Autocast aghs"] = ' (' .. symbol_aghs .. ' Autocast )', ["Autocast tal"] = ' (' .. symbol_tal .. ' Autocast)', ["Autocast aghshard"] = ' (' .. symbol_aghshard .. ' Autocast )', ["Toggle"] = ' / Toggle', ["Toggle aghs"] = ' (' .. symbol_aghs .. ' Toggle )', ["Toggle tal"] = ' (' .. symbol_tal .. ' Toggle)', ["Toggle aghshard"] = ' (' .. symbol_aghshard .. ' Toggle )', ["Target Unit / Channeled"] = ' / Target Unit / Channeled', --Specifically for travel boots/tp scrolls. ["Target Unit aghs / Channeled"] = ' (' .. symbol_aghs .. ' Target Unit ) / Channeled ', --Specifically for Tricks of the Trade. ["Target Unit aghshard / Channeled"] = ' (' .. symbol_aghshard .. ' Target Unit ) / Channeled ', ["Target Unit or Area aghs"] = ' (' .. symbol_aghs .. ' Target Unit  /  Target Area ) ', --Specifically for Eclipse. ["Target Unit or Area aghshard"] = ' (' .. symbol_aghshard .. ' Target Unit  /  Target Area ) ', ["Target Unit / Target Area tal"] = ' / Target Unit (' .. symbol_tal .. ' Target Area) ', --Specifically for Living Armor. ["Target Unit / Target Area aghshard"] = ' / Target Unit (' .. symbol_aghshard .. ' Target Area) ', ["Vector"] = ' / Vector Targeting', } local target = target_dict[args['target']] or 'N/A' if args['target'] and args['target2'] then local target2 = target2_dict[args['target2']] or 'N/A' target = target .. ' ' .. target2 end return target end

function p.affects(frame) local args = getArgs(frame, {   wrappers = {      'Template:Ability'    }  }) -- Implements the Arc Warden easteregg. zet_easteregg = function if mw.title.getCurrentTitle.text == 'Arc Warden' then return 'The Self' else return 'Self' end end local affects_dict = { ["Heroes"] = 'Heroes', ["Enemy Heroes"] = 'Enemy Heroes', ["Allied Heroes"] = 'Allied Heroes', ["Units"] = 'Units', ["Enemy Units"] = 'Enemy Units', ["Allied Units"] = 'Allied Units', ["Self"] = zet_easteregg, ["Enemies"] = 'Enemies', ["Allies"] = 'Allies', ["Trees"] = 'Trees', ["Pumpkin Basket"] = 'Pumpkin Basket', } local affects2_dict = { ["Heroes"] = ' / Heroes', ["Heroes aghs"] = ' (' .. symbol_aghs .. ' Heroes )', ["Heroes tal"] = ' (' .. symbol_tal .. ' Heroes)', ["Heroes aghshard"] = ' (' .. symbol_aghshard .. ' Heroes )', ["Enemy Heroes"] = ' / Enemy Heroes', ["Enemy Heroes aghs"] = ' (' .. symbol_aghs .. ' Enemy Heroes )', ["Enemy Heroes tal"] = ' (' .. symbol_tal .. ' Enemy Heroes)', ["Enemy Heroes aghshard"] = ' (' .. symbol_aghshard .. ' Enemy Heroes )', ["Allied Heroes"] = ' / Allied Heroes', ["Allied Heroes aghs"] = ' (' .. symbol_aghs .. ' Allied Heroes )', ["Allied Heroes tal"] = ' (' .. symbol_tal .. ' Allied Heroes)', ["Allied Heroes aghshard"] = ' (' .. symbol_aghshard .. ' Allied Heroes )', ["Units"] = ' / Units', ["Units aghs"] = ' (' .. symbol_aghs .. ' Units )', ["Units tal"] = ' (' .. symbol_tal .. ' Units)', ["Units aghshard"] = ' (' .. symbol_aghshard .. ' Units )', ["Enemy Units"] = ' / Enemy Units', ["Enemy Units aghs"] = ' (' .. symbol_aghs .. ' Enemy Units )', ["Enemy Units tal"] = ' (' .. symbol_tal .. ' Enemy Units)', ["Enemy Units aghshard"] = ' (' .. symbol_aghshard .. ' Enemy Units )', ["Allied Units"] = ' / Allied Units', ["Allied Units aghs"] = ' (' .. symbol_aghs .. ' Allied Units )', ["Allied Units tal"] = ' (' .. symbol_tal .. ' Allied Units)', ["Allied Units aghshard"] = ' (' .. symbol_aghshard .. ' Allied Units )', ["Self"] = ' / Self', ["Self aghs"] = ' (' .. symbol_aghs .. ' Self )', ["Self tal"] = ' (' .. symbol_tal .. ' Self)', ["Self aghshard"] = ' (' .. symbol_aghshard .. ' Self )', ["Enemies"] = ' / Enemies', ["Enemies aghs"] = ' (' .. symbol_aghs .. ' Enemies )', ["Enemies tal"] = ' (' .. symbol_tal .. ' Enemies)', ["Enemies aghshard"] = ' (' .. symbol_aghshard .. ' Enemies )', ["Allies"] = ' / Allies', ["Allies aghs"] = ' (' .. symbol_aghs .. ' Allies )', ["Allies tal"] = ' (' .. symbol_tal .. ' Allies)', ["Allies aghshard"] = ' (' .. symbol_aghshard .. ' Allies )', ["Trees"] = ' / Trees', ["Trees aghs"] = ' (' .. symbol_aghs .. ' Trees )', ["Trees tal"] = ' (' .. symbol_tal .. ' Trees)', ["Trees aghshard"] = ' (' .. symbol_aghshard .. ' Trees )', } if args['affects'] then local affects = affects_dict[args['affects']] if args['affects2'] then affects = affects .. ' ' .. affects2_dict[args['affects2']] end return "Affects " .. affects end end

-- Implements the damagetypes. function p.damagetype(frame) local args = getArgs(frame, {   wrappers = {      'Template:Ability'    }  }) local damagetype_dict = { ["Physical"] = ' Physical ', ["Magical"] = ' Magical ', ["Pure"] = ' Pure ', ["Instant Attack"] = ' Instant Attack ', ["Instant Attack tal"] = '' .. symbol_tal .. ' Instant Attack ', ["Instant Attack aghs"] = '' .. symbol_aghs .. ' Instant Attack ', ["Instant Attack aghshard"] = '' .. symbol_aghshard .. ' Instant Attack ', ["Instant Kill"] = ' Instant Kill ', ["Composite"] = ' Composite ', -- Use only for old abilities. ["Universal"] = ' Universal ', -- Use only for old abilities. ["HP Removal"] = 'HP Removal', -- Use only for old abilities. } local damagetype2_dict = { ["Physical"] = ' / Physical ', ["Physical aghs"] = ' (' .. symbol_aghs .. ' Physical )', ["Physical tal"] = ' (' .. symbol_tal .. ' Physical )', ["Physical aghshard"] = ' (' .. symbol_aghshard .. ' Physical )', ["Magical"] = ' / Magical ', ["Magical aghs"] = ' (' .. symbol_aghs .. ' Magical )', ["Magical tal"] = ' (' .. symbol_tal .. ' Magical )', ["Magical aghshard"] = ' (' .. symbol_aghshard .. ' Magical )', ["Pure"] = ' / Pure ', ["Pure aghs"] = ' (' .. symbol_aghs .. ' Pure )', ["Pure tal"] = ' (' .. symbol_tal .. ' Pure )', ["Pure aghshard"] = ' (' .. symbol_aghshard .. ' Pure )', ["Instant Attack"] = ' / Instant Attack ', ["Instant Kill"] = ' / Instant Kill ', ["Instant Attack aghs"] = ' (' .. symbol_aghs .. ' Instant Attack )', ["Instant Kill aghs"] = ' (' .. symbol_aghs .. ' Instant Kill )', ["Instant Attack tal"] = ' (' .. symbol_tal .. ' Instant Attack )', ["Instant Kill tal"] = ' (' .. symbol_tal .. ' Instant Kill )', ["Instant Attack aghshard"] = ' (' .. symbol_aghshard .. ' Instant Attack )', ["Instant Kill aghshard"] = ' (' .. symbol_aghshard .. ' Instant Kill )', ["HP Removal"] = ' (HP Removal)', -- Not an actual damage type, so should always be used as 2nd. } if args['damagetype'] then local damagetype = damagetype_dict[args['damagetype']] if args['damagetype2'] then damagetype = damagetype .. ' ' .. damagetype2_dict[args['damagetype2']] end return "Damage " .. damagetype end end

return p